/* ============================================
   ON THE DAY — Auth Pages
   Split-screen warm branded layout
   ============================================ */

/* ── Layout Shell ── */
.auth-split {
  display: flex;
  min-height: 100vh;
  background: var(--white);
}

/* ── Branded Panel (Left) ── */
.auth-aurora {
  position: relative;
  width: 45%;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--warm-bg) 0%, var(--otd-green-50) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Subtle green mesh gradient */
.auth-aurora::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 30%, rgba(34, 197, 94, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(76, 175, 80, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* Dot pattern overlay */
.auth-aurora::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* Brand content */
.auth-aurora__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-8);
}

.auth-aurora__logo {
  width: 120px;
  height: auto;
  margin-bottom: var(--space-8);
  animation: auth-float 6s ease-in-out infinite;
}

@keyframes auth-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.auth-aurora__tagline {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--warm-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.auth-aurora__tagline span {
  background: linear-gradient(135deg, var(--otd-green-600), var(--otd-green-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-aurora__subtitle {
  font-size: var(--text-base);
  color: var(--warm-text-secondary);
  max-width: 300px;
  line-height: 1.6;
}

/* Decorative dots on branded panel */
.auth-aurora__dots {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.auth-aurora__dot {
  position: absolute;
  border-radius: 50%;
  animation: auth-float 8s ease-in-out infinite;
}

.auth-aurora__dot:nth-child(1) {
  width: 6px; height: 6px;
  background: var(--otd-green-300);
  opacity: 0.3;
  top: 15%; left: 20%;
  animation-delay: -2s;
}
.auth-aurora__dot:nth-child(2) {
  width: 4px; height: 4px;
  background: var(--otd-green-200);
  opacity: 0.25;
  top: 70%; left: 30%;
  animation-delay: -4s;
}
.auth-aurora__dot:nth-child(3) {
  width: 8px; height: 8px;
  background: var(--otd-green-300);
  opacity: 0.15;
  top: 40%; right: 15%;
  animation-delay: -1s;
}
.auth-aurora__dot:nth-child(4) {
  width: 5px; height: 5px;
  background: var(--otd-green-200);
  opacity: 0.3;
  bottom: 20%; right: 25%;
  animation-delay: -6s;
}

/* ── Form Panel (Right) ── */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  position: relative;
  overflow-y: auto;
}

.auth-form-container {
  width: 100%;
  max-width: 420px;
}

/* Back link */
.auth-back {
  position: absolute;
  top: var(--space-6);
  left: var(--space-6);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color 0.2s;
}
.auth-back:hover {
  color: var(--otd-green-600);
}
.auth-back i {
  font-size: 12px;
}

/* ── Header ── */
.auth-header {
  margin-bottom: var(--space-8);
}

.auth-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.auth-header p {
  color: var(--text-secondary);
  font-size: var(--text-base);
  margin: 0;
}

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

.auth-form .form-group {
  margin-bottom: 0;
}

.auth-form .form-group label {
  display: block;
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.auth-form .form-group input,
.auth-form .form-group select {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--text-base);
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s, box-shadow 0.3s;
  -webkit-appearance: none;
}

.auth-form .form-group input:focus,
.auth-form .form-group select:focus {
  outline: none;
  border-color: var(--otd-green-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.auth-form .form-group input.error,
.auth-form .form-group input.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Icon wrapper */
.input-icon-wrapper {
  position: relative;
}
.input-icon-wrapper input {
  padding-left: 44px !important;
}
.input-icon-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
  transition: color 0.2s;
  pointer-events: none;
}
.input-icon-wrapper input:focus ~ i,
.input-icon-wrapper input:focus + i {
  color: var(--otd-green-500);
}
/* Also support icon before input */
.input-icon-wrapper:has(input:focus) i {
  color: var(--otd-green-500);
}

/* Field hints/errors */
.field-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

.field-error {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: 4px;
  display: block;
  min-height: 0;
}

/* Form options row */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}
.form-options label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  cursor: pointer;
}
.form-options a {
  color: var(--otd-green-600);
  font-weight: var(--font-medium);
  text-decoration: none;
}
.form-options a:hover {
  color: var(--otd-green-700);
}

/* ── Submit Button ── */
.auth-submit {
  width: 100%;
  padding: 14px 24px;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  font-family: var(--font-body);
  color: var(--white);
  background: linear-gradient(135deg, var(--otd-green-500), var(--otd-green-600));
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out-expo),
              box-shadow 0.2s var(--ease-smooth);
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.25);
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.35);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading state */
.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

.btn--loading .loading-spinner {
  display: inline-block;
}
.btn--loading .btn-text {
  display: none;
}

.btn-loading { display: none; }

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* ── Error Alert ── */
.auth-error {
  background: rgba(239, 68, 68, 0.08);
  color: var(--status-error-text);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  display: none;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid rgba(239, 68, 68, 0.15);
  margin-bottom: var(--space-4);
}
.auth-error.visible {
  display: flex;
  animation: slideDown 300ms ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-message {
  background: rgba(239, 68, 68, 0.08);
  color: var(--status-error-text);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  display: none;
  border: 1px solid rgba(239, 68, 68, 0.15);
  margin-bottom: var(--space-4);
}
.error-message.show {
  display: block;
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Social Buttons ── */
.social-login {
  display: flex;
  gap: var(--space-3);
}
.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  font-family: var(--font-body);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.social-btn:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
  transform: translateY(-1px);
}

/* ── Footer ── */
.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--gray-100);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.auth-footer a {
  color: var(--otd-green-600);
  font-weight: var(--font-semibold);
  text-decoration: none;
}
.auth-footer a:hover {
  color: var(--otd-green-700);
}

/* ── Success State ── */
.success-message {
  display: none;
  text-align: center;
  padding: var(--space-6) 0;
}
.success-message.show {
  display: block;
}
.success-icon {
  width: 72px;
  height: 72px;
  background: var(--otd-green-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}
.success-icon i {
  font-size: 32px;
  color: var(--otd-green-500);
}
.success-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.success-text {
  color: var(--text-secondary);
  font-size: var(--text-base);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.form-content.hidden {
  display: none;
}

/* ── Signup-Specific ── */

/* Progress Steps */
.signup-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: var(--space-6);
}
.progress-step {
  width: 48px;
  height: 4px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  transition: background 0.4s var(--ease-smooth);
}
.progress-step.active,
.progress-step.completed {
  background: linear-gradient(90deg, var(--otd-green-500), var(--otd-green-400));
}

.step-indicator {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

/* Hidden steps */
.signup-step {
  display: none;
}
.signup-step.active {
  display: block;
}

/* Role Selection */
.role-selection {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.role-card {
  padding: var(--space-5);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}
.role-card:hover {
  border-color: var(--otd-green-300);
  background: var(--otd-green-50);
}
.role-card.selected {
  border-color: var(--otd-green-500);
  background: var(--otd-green-50);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
.role-card__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  font-size: var(--text-xl);
  color: var(--otd-green-600);
  border: 1px solid var(--gray-100);
}
.role-card.selected .role-card__icon {
  background: var(--otd-green-500);
  color: var(--white);
  border-color: var(--otd-green-500);
}
.role-card h3 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  margin-bottom: 2px;
}
.role-card p {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* Password Strength */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.strength-bar {
  flex: 1;
  height: 3px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  transition: background 0.3s;
}
.strength-bar.weak { background: #ef4444; }
.strength-bar.medium { background: #f59e0b; }
.strength-bar.strong { background: var(--otd-green-500); }

/* Auth buttons row */
.auth-buttons {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.auth-buttons .btn,
.auth-buttons .auth-submit,
.auth-buttons button {
  flex: 1;
}
.btn--back {
  padding: 14px 24px;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  font-family: var(--font-body);
  background: var(--gray-100);
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
}
.btn--back:hover {
  background: var(--gray-200);
  color: var(--text-primary);
}

/* Form row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* Terms checkbox */
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}
.terms-checkbox input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--otd-green-500);
}
.terms-checkbox a {
  color: var(--otd-green-600);
  text-decoration: none;
}
.terms-checkbox a:hover {
  color: var(--otd-green-700);
}

/* Industry Cards */
.industry-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.industry-card:hover {
  border-color: var(--otd-green-300);
  background: var(--otd-green-50);
}
.industry-card.selected {
  border-color: var(--otd-green-500);
  background: var(--otd-green-50);
}
.industry-card__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.industry-card.selected .industry-card__icon {
  background: var(--otd-green-500);
}
.industry-card__name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

/* ── Helper Links ── */
.helper-links {
  display: flex;
  justify-content: center;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}
.helper-links a {
  color: var(--otd-green-600);
  font-weight: var(--font-semibold);
  text-decoration: none;
}
.helper-links a:hover {
  color: var(--otd-green-700);
}

.note {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .auth-aurora {
    width: 40%;
  }
  .auth-aurora__tagline {
    font-size: var(--text-xl);
  }
}

@media (max-width: 768px) {
  .auth-split {
    flex-direction: column;
  }

  .auth-aurora {
    width: 100%;
    min-height: auto;
    padding: var(--space-10) var(--space-6) var(--space-8);
  }

  .auth-aurora__logo {
    width: 80px;
    margin-bottom: var(--space-4);
  }

  .auth-aurora__tagline {
    font-size: var(--text-lg);
  }

  .auth-aurora__subtitle {
    font-size: var(--text-sm);
  }

  .auth-form-panel {
    padding: var(--space-6);
  }

  .auth-back {
    top: var(--space-4);
    left: var(--space-4);
    color: var(--warm-text-muted);
  }
  .auth-back:hover {
    color: var(--otd-green-600);
  }

  .role-selection {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .social-login {
    flex-direction: column;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .auth-aurora::before {
    animation: none;
  }
  .auth-aurora__logo {
    animation: none;
  }
  .auth-aurora__dot {
    animation: none;
  }
}
