/**
 * DrawLeague Authentication Styles
 * Follows the graphic charter: Playful Minimal Creative
 */

/* Auth Page Layout */
.auth-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  background-color: var(--color-light-blue);
}

/* Auth Card */
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-xl);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header h2 {
  margin-bottom: var(--space-sm);
  color: var(--color-text);
  font-size: var(--font-size-3xl);
}

.auth-header .muted {
  margin: 0;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group label {
  font-weight: 500;
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.form-group input {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-group input::placeholder {
  color: var(--color-muted);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.form-hint {
  font-size: var(--font-size-sm);
  color: var(--color-muted);
}

/* Password Input */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: var(--space-sm);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  opacity: 0.6;
  transition: opacity 150ms ease;
}

.password-toggle:hover {
  opacity: 1;
}

.password-toggle:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.eye-icon {
  font-size: 1.2rem;
}

/* Form Error */
.form-error {
  padding: var(--space-sm) var(--space-md);
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  color: #dc2626;
  font-size: var(--font-size-sm);
  display: none;
}

.form-error.visible {
  display: block;
}

/* Button Styles for Auth */
.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-small {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Role Selection */
.role-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.role-option {
  display: block;
  cursor: pointer;
}

.role-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-option .role-content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all 150ms ease;
}

.role-option input:checked + .role-content {
  border-color: var(--color-accent);
  background-color: rgba(255, 152, 0, 0.05);
}

.role-option:hover .role-content {
  border-color: var(--color-accent);
}

.role-icon {
  font-size: 1.5rem;
}

.role-text {
  display: flex;
  flex-direction: column;
}

.role-text strong {
  margin-bottom: var(--space-xs);
}

.role-text .muted {
  font-size: var(--font-size-sm);
}

/* Auth Footer */
.auth-footer {
  margin-top: var(--space-xl);
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.auth-footer p {
  margin: 0;
  color: var(--color-muted);
}

.auth-footer a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Logo Link */
.logo-link {
  text-decoration: none;
  color: inherit;
}

.logo-link h1 {
  margin: 0;
}

/* Navigation Auth Links */
.auth-link {
  margin-left: var(--space-sm);
}

.user-greeting {
  color: var(--color-muted);
  font-weight: 500;
}

/* Toast Notifications */
.toast {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.toast-success {
  background-color: var(--color-accent);
}

.toast-error {
  background-color: #ef4444;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .auth-card {
    padding: var(--space-lg);
  }

  .auth-header h2 {
    font-size: var(--font-size-2xl);
  }
}
