/* ── Auth pages (login, register, verify) ─────────────────── */

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--ai4ch-bg);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #0f2922 0%, var(--ai4ch-green-dark) 35%, var(--ai4ch-green) 70%, #52b788 100%);
  color: #fff;
  padding: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand::before,
.auth-brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand::before {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-brand::after {
  width: 280px;
  height: 280px;
  bottom: -60px;
  left: -40px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.auth-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.auth-logo-wrap img {
  height: 2.5rem;
  width: auto;
}

.auth-brand h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  line-height: 1.15;
}

.auth-brand > .auth-brand-inner > p,
.auth-brand p.auth-brand-lead {
  opacity: 0.92;
  max-width: 400px;
  line-height: 1.65;
  font-size: 0.98rem;
  margin: 0;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.875rem;
  font-weight: 500;
}

.auth-feature i {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--ai4ch-surface);
  border: 1px solid var(--ai4ch-border);
  border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.02),
    0 16px 48px rgba(45, 106, 79, 0.08);
}

.auth-card.auth-card-wide {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow-y: auto;
}

.auth-card-top-accent {
  height: 4px;
  border-radius: 20px 20px 0 0;
  margin: calc(-1 * clamp(1.5rem, 4vw, 2.25rem)) calc(-1 * clamp(1.5rem, 4vw, 2.25rem)) 1.5rem;
  background: linear-gradient(90deg, var(--ai4ch-green-dark), var(--ai4ch-green-light));
}

.auth-form-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-form-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.12), rgba(64, 145, 108, 0.18));
  color: var(--ai4ch-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.auth-form-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  color: var(--ai4ch-text);
}

.auth-form-header p {
  font-size: 0.875rem;
  color: var(--ai4ch-muted);
  margin: 0;
}

.auth-form-section {
  margin-bottom: 1.5rem;
}

.auth-form-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ai4ch-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ai4ch-border);
}

.auth-form-section-title i {
  color: var(--ai4ch-green);
  font-size: 0.85rem;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field:last-child {
  margin-bottom: 0;
}

.auth-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ai4ch-text);
  margin-bottom: 0.4rem;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 0.95rem;
  color: var(--ai4ch-muted);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.auth-input-wrap .form-control,
.auth-input-wrap .form-select {
  padding-left: 2.65rem;
  padding-right: 0.95rem;
  min-height: 2.75rem;
  border-radius: 12px;
  border: 1.5px solid var(--ai4ch-border);
  background: var(--ai4ch-bg);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input-wrap .form-control:focus,
.auth-input-wrap .form-select:focus {
  border-color: var(--ai4ch-green-light);
  background: var(--ai4ch-surface);
  box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
}

.auth-input-wrap.has-toggle .form-control {
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ai4ch-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-password-toggle:hover {
  color: var(--ai4ch-green);
  background: rgba(45, 106, 79, 0.08);
}

.auth-field-hint {
  font-size: 0.75rem;
  color: var(--ai4ch-muted);
  margin-top: 0.35rem;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.auth-btn-primary {
  background: linear-gradient(135deg, var(--ai4ch-green-dark) 0%, var(--ai4ch-green) 55%, var(--ai4ch-green-light) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
  margin-top: 0.5rem;
}

.auth-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.4);
  color: #fff;
}

.auth-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.auth-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-btn-primary .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ai4ch-border);
  text-align: center;
}

.auth-footer p {
  font-size: 0.8125rem;
  color: var(--ai4ch-muted);
  margin-bottom: 0.5rem;
}

.auth-footer p:last-child {
  margin-bottom: 0;
}

.auth-link {
  color: var(--ai4ch-green);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-link:hover {
  color: var(--ai4ch-green-dark);
  text-decoration: underline;
}

.auth-lang {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
}

.auth-lang .form-select {
  width: auto;
  min-width: 8rem;
  font-size: 0.8125rem;
  border-radius: 999px;
  padding: 0.35rem 2rem 0.35rem 0.85rem;
  border: 1px solid var(--ai4ch-border);
  background-color: var(--ai4ch-bg);
}

.auth-code-input {
  font-size: 1.5rem !important;
  letter-spacing: 0.35em;
  text-align: center;
  font-weight: 600;
  padding-left: 0.95rem !important;
}

.auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 991px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: auto;
    padding: 2rem 1.5rem;
  }

  .auth-features {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 1.25rem;
  }

  .auth-feature {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: 140px;
  }
}

@media (max-width: 575px) {
  .auth-card {
    border-radius: 16px;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0.5rem 0;
  }

  .auth-card-top-accent {
    display: none;
  }

  .auth-panel {
    padding: 1rem 1.25rem 2rem;
    align-items: flex-start;
  }

  .auth-grid-2 {
    grid-template-columns: 1fr;
  }

  .auth-features {
    display: none;
  }
}
