/* ===========================
   Auth Pages (Login & Register)
   =========================== */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 50%, #F5F3FF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

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

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.auth-card .logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

.auth-card h1 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.auth-sub {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

/* Account type toggle */
.account-type-toggle {
  display: flex;
  gap: 0;
  background: var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
}

.type-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.type-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.type-btn:hover:not(.active) {
  color: var(--color-text);
}

/* Auth footer link */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

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

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

/* Auth success */
.auth-success-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

#register-success h2,
#login-success h2 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

#register-success p,
#login-success p {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

/* Code input */
.code-input-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.code-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.code-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 58, 237, 0.1);
}

.code-input.filled {
  border-color: var(--color-primary-light);
  background: #F5F3FF;
}

/* Steps */
.login-step {
  transition: opacity 0.3s ease;
}

.login-step.hidden {
  display: none;
}

/* Resend */
.resend-row {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.resend-row a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.resend-row a:hover {
  text-decoration: underline;
}

.resend-row a.disabled {
  color: var(--color-text-secondary);
  pointer-events: none;
  opacity: 0.5;
}

/* Timer */
.timer {
  font-variant-numeric: tabular-nums;
}

/* Stripe Card Element */
.stripe-card-element {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stripe-card-element:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 58, 237, 0.1);
}

.card-errors {
  color: #EF4444;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  min-height: 1.2em;
}

.card-note-text {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 0.35rem;
}

/* Form row (country + phone side by side) */
.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-group-country {
  flex: 1;
  min-width: 0;
}

.form-group-phone {
  flex: 1.2;
  min-width: 0;
}

.form-group select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: var(--color-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 58, 237, 0.1);
}

/* Legal note */
.auth-legal-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-top: 1rem;
  line-height: 1.4;
}

.auth-legal-note a {
  color: var(--color-primary);
  text-decoration: none;
}

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

/* Touch-friendly inputs */
.form-group input,
.form-group select {
  min-height: 44px;
}

.type-btn {
  min-height: 44px;
}

@media (max-width: 480px) {
  .auth-body {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 2rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .auth-card h1 {
    font-size: 1.4rem;
  }

  .auth-sub {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .code-input {
    width: 46px;
    height: 54px;
    font-size: 1.3rem;
  }

  .code-input-group {
    gap: 0.4rem;
  }
}

@media (max-width: 375px) {
  .auth-card {
    padding: 1.25rem;
  }

  .auth-card h1 {
    font-size: 1.3rem;
  }

  .code-input {
    width: 42px;
    height: 50px;
    font-size: 1.2rem;
  }

  .code-input-group {
    gap: 0.3rem;
  }

  .auth-card .logo {
    font-size: 1.2rem;
  }
}
