/* ============================================================
   1percent — Auth Pages (/signin, /signup)
   Two-column split: hero panel + form panel.
   Reuses the site theme from main.css:
   --primary #0d6e3f · --primary-hover #0a5c34 · ink #0e2b1d
   ============================================================ */

.auth-page {
  min-height: 100vh;
  background: var(--bg);
}

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Sides: DOM order is always [hero, form]. "left"/"right" is the FORM side. */
.auth-layout[data-form-side="left"] .auth-hero { order: 2; }
.auth-layout[data-form-side="left"] .auth-form-col { order: 1; }

/* ============================================================
   FORM SIDE
   ============================================================ */
.auth-form-col {
  display: flex;
  flex-direction: column;
  background: #fff;
  min-height: 100vh;
}

.auth-back {
  margin: 24px 0 0 24px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 8px;
}
.auth-back:hover { color: var(--primary); background: var(--primary-light); }
.auth-back:focus-visible { outline: 3px solid rgba(13, 110, 63, 0.35); outline-offset: 2px; }

.auth-form-wrap {
  margin: auto;
  width: 100%;
  max-width: 420px;
  padding: 32px 24px 40px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}
.auth-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-brand-name { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand-name b { font-size: 15px; font-weight: 800; color: var(--text); }
.auth-brand-name span { font-size: 12px; color: var(--text-muted); }

.auth-heading {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 8px;
}
.auth-subtext {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ── Form controls ─────────────────────────────── */
.auth-field { margin-bottom: 18px; }
.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-label .req { color: var(--danger); margin-left: 2px; }
.auth-label .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-input::placeholder { color: var(--text-muted); }
.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 63, 0.15);
}
.auth-input:focus-visible { border-color: var(--primary); }

/* Password field with show/hide toggle */
.auth-password-wrap { position: relative; }
.auth-password-wrap .auth-input { padding-right: 46px; }
.auth-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--text-muted);
}
.auth-eye:hover { color: var(--primary); background: var(--primary-light); }
.auth-eye:focus-visible { outline: 3px solid rgba(13, 110, 63, 0.35); }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.auth-checkbox a { color: var(--primary); font-weight: 600; }
.auth-checkbox a:hover { color: var(--primary-hover); text-decoration: underline; }

.auth-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
}
.auth-link:hover { color: var(--primary-hover); text-decoration: underline; }
.auth-link:focus-visible { outline: 3px solid rgba(13, 110, 63, 0.35); outline-offset: 2px; border-radius: 4px; }

/* ── Primary button ─────────────────────────────── */
.auth-btn {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.auth-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(13, 110, 63, 0.3);
}
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-btn:focus-visible { outline: 3px solid rgba(13, 110, 63, 0.35); outline-offset: 2px; }
.auth-btn .auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  display: none;
}
.auth-btn[data-loading="true"] .auth-spinner { display: inline-block; }
.auth-btn[data-loading="true"] { pointer-events: none; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ── Inline Alert (error / warning / success) ────── */
.auth-alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.auth-alert.show { display: flex; }
.auth-alert[hidden] { display: none; }
.auth-alert .auth-alert-icon { flex-shrink: 0; margin-top: 1px; }
.auth-alert-error { background: var(--danger-light); border-color: #fca5a5; color: #991b1b; }
.auth-alert-warning { background: var(--accent-light); border-color: #fcd34d; color: #92400e; }
.auth-alert-success { background: var(--success-light); border-color: #86efac; color: #14532d; }

.auth-alt-link-row {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 18px;
}
.auth-alt-link-row a { color: var(--primary); font-weight: 600; }
.auth-alt-link-row a:hover { text-decoration: underline; }

.auth-magic-row {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 14px;
}
.auth-magic-row button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 13.5px;
  padding: 4px 6px;
  border-radius: 4px;
}
.auth-magic-row button:hover { text-decoration: underline; }
.auth-magic-row button:focus-visible { outline: 3px solid rgba(13, 110, 63, 0.35); }

/* ============================================================
   HERO SIDE
   ============================================================ */
.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 64px;
  min-height: 100vh;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(127, 220, 175, 0.12) 0%, transparent 45%),
    linear-gradient(160deg, #0e2b1d 0%, #0a4c2c 45%, #0d6e3f 100%);
  overflow: hidden;
}
/* Subtle dotted grid overlay */
.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.auth-hero-inner {
  position: relative;
  max-width: 560px;
}
.auth-hero h1 {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -1px;
  margin-bottom: 18px;
}
.auth-hero h1 em {
  font-style: normal;
  color: #7fdcaf;
}
.auth-hero-lead {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 36px;
  max-width: 460px;
}

.auth-hero-checks { display: flex; flex-direction: column; gap: 16px; }
.auth-hero-check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
}
.auth-hero-check i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #7fdcaf;
  color: #0e2b1d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-hero-footer {
  position: relative;
  margin-top: auto;
  padding-top: 48px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================================
   RESPONSIVE — below 1024px: hero hidden, form full width
   ============================================================ */
@media (max-width: 1023px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-form-col { min-height: 100vh; }
  .auth-back { margin: 20px 0 0 20px; }
  .auth-form-wrap { padding: 24px 24px 40px; }
}

@media (max-width: 400px) {
  .auth-form-wrap { padding: 20px 16px 32px; }
  .auth-btn { font-size: 14.5px; }
}

/* Fine print: guaranteed no horizontal scroll */
.auth-layout, .auth-form-wrap, .auth-hero-inner { overflow-wrap: break-word; }

@media (prefers-reduced-motion: reduce) {
  .auth-btn .auth-spinner { animation: none; }
  * { transition: none; }
}
