/* ══════════════════════════════════════════════════════
   AUTH PAGES — Split-screen layout
   ══════════════════════════════════════════════════════ */

body {
  font-family: var(--font-family);
  background: #060d1f;
  color: var(--color-text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* ─── Page shell ─────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ─── LEFT — Branding panel ──────────────────────── */
.auth-panel {
  position: relative;
  background: #060d1f;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  min-height: 100vh;
}

/* Radial glow blobs */
.auth-panel::before {
  content: '';
  position: absolute;
  top: -120px;
  left: -80px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(4, 120, 87, 0.28) 0%, transparent 70%);
  pointer-events: none;
}

.auth-panel::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: -60px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Dot-grid background */
.auth-panel__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* QR corner decoration (top-right) */
.auth-panel__qr {
  position: absolute;
  top: 2.5rem;
  right: 2.5rem;
  opacity: 0.12;
  pointer-events: none;
}

/* Panel logo */
.auth-panel__logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  z-index: 1;
}

.auth-panel__logo-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
}

/* Main text block */
.auth-panel__body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0;
}

.auth-panel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  width: fit-content;
}

.auth-panel__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

.auth-panel__heading {
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.auth-panel__heading em {
  font-style: normal;
  background: linear-gradient(135deg, #34d399 0%, #059669 60%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-panel__sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
  max-width: 360px;
  margin-bottom: 2.5rem;
}

/* Feature list */
.auth-panel__features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-panel__feature {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.auth-panel__feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #34d399;
}

.auth-panel__feature-text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

/* Footer */
.auth-panel__footer {
  position: relative;
  z-index: 1;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.25);
}

/* ─── RIGHT — Form panel ─────────────────────────── */
.auth-form-panel {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  overflow-y: auto;
}

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

/* Back link */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.18s ease, gap 0.18s ease;
}

.auth-back:hover {
  color: var(--color-accent-emerald);
  gap: 0.625rem;
}

.auth-back svg {
  transition: transform 0.18s ease;
}

.auth-back:hover svg {
  transform: translateX(-3px);
}

/* Heading */
.auth-heading {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.auth-heading-sub {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* ─── Form ───────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
}

/* Input with icon */
.input-wrap {
  position: relative;
}

.input-wrap__icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  pointer-events: none;
  transition: color 0.18s ease;
  display: flex;
  align-items: center;
}

.input-wrap:focus-within .input-wrap__icon {
  color: var(--color-accent-emerald);
}

.form-input {
  width: 100%;
  padding: 0.8125rem 1rem 0.8125rem 2.875rem;
  border: 1.5px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.875rem;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  background: #fafafa;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--color-accent-emerald);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.08);
}

.form-input::placeholder {
  color: var(--color-text-tertiary);
}

.form-input.error {
  border-color: #ef4444;
  background: #fff8f8;
}

/* Textarea */
.form-textarea {
  width: 100%;
  padding: 0.8125rem 1rem;
  border: 1.5px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.875rem;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  background: #fafafa;
  font-family: var(--font-family);
  resize: vertical;
  min-height: 96px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}

.form-textarea:focus {
  border-color: var(--color-accent-emerald);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.08);
}

/* Password toggle */
.input-wrap__toggle {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text-tertiary);
  transition: color 0.18s ease;
  display: flex;
  align-items: center;
}

.input-wrap__toggle:hover {
  color: var(--color-text-primary);
}

.form-input.has-toggle {
  padding-right: 3rem;
}

/* Error text */
.error-message {
  font-size: 0.75rem;
  color: #ef4444;
  display: none;
  align-items: center;
  gap: 0.3rem;
}

.error-message.visible {
  display: flex;
}

/* Custom checkbox */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
}

.form-checkbox__box {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.form-checkbox__box input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(15, 23, 42, 0.2);
  border-radius: 5px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.form-checkbox__box input[type="checkbox"]:checked {
  background: var(--color-accent-emerald);
  border-color: var(--color-accent-emerald);
}

.form-checkbox__box svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #ffffff;
  pointer-events: none;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-checkbox__box input[type="checkbox"]:checked ~ svg {
  transform: translate(-50%, -50%) scale(1);
}

.form-checkbox__label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  cursor: pointer;
}

.form-checkbox__label a {
  color: var(--color-accent-emerald);
  text-decoration: none;
  font-weight: 500;
}

.form-checkbox__label a:hover {
  text-decoration: underline;
}

/* Remember / forgot row */
.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-meta a {
  font-size: 0.875rem;
  color: var(--color-accent-emerald);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.form-meta a:hover {
  color: #059669;
}

/* Submit button */
.auth-submit {
  position: relative;
  width: 100%;
  padding: 0.9375rem 1.5rem;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 18px rgba(4, 120, 87, 0.3);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  overflow: hidden;
  margin-top: 0.25rem;
}

.auth-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.auth-submit:hover {
  box-shadow: 0 6px 28px rgba(4, 120, 87, 0.45);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(4, 120, 87, 0.3);
}

/* Success / info messages */
.auth-success {
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  background: rgba(4, 120, 87, 0.06);
  border: 1px solid rgba(4, 120, 87, 0.18);
  border-radius: 0.875rem;
  font-size: 0.875rem;
  color: #065f46;
  line-height: 1.5;
}

.auth-success.visible {
  display: flex;
}

.auth-success svg {
  flex-shrink: 0;
  color: var(--color-accent-emerald);
  margin-top: 1px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 0.25rem 0;
}

.auth-divider__line {
  flex: 1;
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
}

.auth-divider__text {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* Footer links */
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.auth-footer a {
  color: var(--color-accent-emerald);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-footer a:hover {
  color: #059669;
}

/* ─── Wide variant (register) ────────────────────── */
.auth-page--wide .auth-box {
  max-width: 520px;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
    padding: 2rem 1.25rem;
    background: #f5f5f7;
  }

  .auth-box {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  }
}

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

  .auth-box {
    padding: 1.5rem 1.25rem;
  }

  .auth-heading {
    font-size: 1.5rem;
  }
}
