/* ═══════════════════════════════════════════════════════════════════════════
   auth.css  —  Afrimart authentication pages
   Design system: Cormorant Garamond · Syne · DM Sans
   Tokens from base.css (--ink, --green, --gold, --cream, --border, etc.)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Page layout ────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--ink);
}

/* Left decorative panel */
.auth-panel-left {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(40px, 6vw, 80px);
  overflow: hidden;
}

/* Background image fills left side */
.auth-panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1612423284934-2850a4ea6b0f?q=80&w=1200')
              center / cover no-repeat;
  filter: brightness(.35) saturate(.8);
  z-index: 0;
}

/* Gradient over image */
.auth-panel-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(17,16,8,.92) 100%);
  z-index: 1;
}

.auth-panel-left-content {
  position: relative;
  z-index: 2;
}

/* ─── ANIMATED WELCOME TEXT ─────────────────────────────────────────────── */
.auth-welcome-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(16px);
  animation: authFadeUp .6s ease .2s forwards;
}
.auth-welcome-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}
.auth-welcome-eyebrow span {
  font-family: 'Syne', sans-serif;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
}

.auth-welcome-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -2px;
  color: #fff;
  margin-bottom: 20px;
  overflow: hidden;
}

/* Each word slides up individually */
.auth-welcome-heading .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: authWordUp .55s cubic-bezier(.22,.61,.36,1) forwards;
}
.auth-welcome-heading .word:nth-child(1) { animation-delay: .35s; }
.auth-welcome-heading .word:nth-child(2) { animation-delay: .52s; }
.auth-welcome-heading .word:nth-child(3) { animation-delay: .68s; }
.auth-welcome-heading .word:nth-child(4) { animation-delay: .83s; }
.auth-welcome-heading .word.gold        { color: var(--gold); }

.auth-welcome-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  font-weight: 300;
  line-height: 1.8;
  color: rgba(255,255,255,.55);
  max-width: 340px;
  opacity: 0;
  transform: translateY(12px);
  animation: authFadeUp .6s ease 1s forwards;
}

/* Trust strip on left panel */
.auth-trust-strip {
  display: flex;
  gap: 24px;
  margin-top: 40px;
  opacity: 0;
  animation: authFadeUp .5s ease 1.2s forwards;
}
.auth-trust-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Syne', sans-serif;
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}
.auth-trust-chip ion-icon { font-size: 14px; color: var(--gold); }

/* ─── Right form panel ───────────────────────────────────────────────────── */
.auth-form-side {
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  overflow-y: auto;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 480px;
  padding: 48px 44px;
  opacity: 0;
  animation: authFadeUp .55s ease .1s forwards;
}

.auth-card--wide { max-width: 560px; }

/* ─── Logo ───────────────────────────────────────────────────────────────── */
.auth-logo {
  display: block;
  height: 28px;
  width: auto;
  margin: 0 auto 36px;
}

/* ─── Card heading (form side) ───────────────────────────────────────────── */
.auth-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.05;
  color: var(--ink);
  text-align: center;
  margin-bottom: 6px;
}
.auth-heading em { font-style: italic; color: var(--green); }

.auth-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  font-weight: 300;
  color: var(--ink-light);
  text-align: center;
  margin-bottom: 32px;
}

/* ─── Alert ──────────────────────────────────────────────────────────────── */
.auth-alert {
  padding: 12px 16px;
  border-left: 3px solid #c0392b;
  background: #fdecea;
  font-family: 'Syne', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c0392b;
  margin-bottom: 20px;
}

/* ─── Tab switcher ───────────────────────────────────────────────────────── */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  margin-bottom: 32px;
}
.auth-tab-btn {
  padding: 13px;
  border: none;
  background: var(--cream);
  font-family: 'Syne', sans-serif;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .2s, color .2s;
}
.auth-tab-btn ion-icon { font-size: 15px; }
.auth-tab-btn:first-child { border-right: 1px solid var(--border); }
.auth-tab-btn.active { background: var(--ink); color: #fff; }

.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ─── Field layout ───────────────────────────────────────────────────────── */
.field-group { margin-bottom: 20px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ─── Labels ─────────────────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 7px;
}
.field-label .required { color: var(--gold); margin-left: 2px; }

/* Label + forgot link row */
.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.field-label-row .field-label { margin-bottom: 0; }

.forgot-link {
  font-family: 'Syne', sans-serif;
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.forgot-link:hover { border-color: var(--green); }

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
.auth-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
}
.auth-input::placeholder { color: var(--ink-light); }
.auth-input:focus { border-color: var(--ink); background: var(--white); }
.auth-input.error { border-color: #c0392b; }
textarea.auth-input { resize: vertical; min-height: 88px; }

.field-error {
  font-family: 'Syne', sans-serif;
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c0392b;
  margin-top: 5px;
}

/* ─── Phone row ──────────────────────────────────────────────────────────── */
.phone-row {
  display: flex;
  border: 1px solid var(--border);
  transition: border-color .2s;
}
.phone-row:focus-within { border-color: var(--ink); }
.phone-row select {
  flex-shrink: 0;
  max-width: 148px;
  padding: 12px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  color: var(--ink);
  background: var(--white);
  border: none;
  border-right: 1px solid var(--border);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}
.phone-row input {
  flex: 1;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  color: var(--ink);
  background: var(--cream);
  border: none;
  outline: none;
  min-width: 0;
}

/* ─── Password + toggle ──────────────────────────────────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap .auth-input { padding-right: 48px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  font-size: 17px;
  color: var(--ink-light);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color .2s;
}
.pw-toggle:hover { color: var(--green); }

/* ─── Strength bar ───────────────────────────────────────────────────────── */
.strength-track {
  height: 2px;
  background: var(--border);
  margin-top: 7px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0;
  transition: width .3s ease, background .3s ease;
}

/* ─── Match message ──────────────────────────────────────────────────────── */
.match-msg {
  font-family: 'Syne', sans-serif;
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 5px;
  min-height: 14px;
}
.match-msg.ok  { color: var(--green); }
.match-msg.err { color: #c0392b; }

/* ─── Store info box ─────────────────────────────────────────────────────── */
.store-box {
  background: var(--green-soft);
  border: 1px solid #c2dec1;
  border-left: 3px solid var(--green);
  padding: 20px;
  margin-bottom: 20px;
}
.store-box-title {
  font-family: 'Syne', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}

/* ─── Info banner ────────────────────────────────────────────────────────── */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  margin-bottom: 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  font-weight: 300;
  color: var(--ink-mid);
  line-height: 1.6;
}
.info-banner ion-icon { font-size: 16px; color: var(--gold); flex-shrink: 0; margin-top: 2px; }

/* ─── Checkbox ───────────────────────────────────────────────────────────── */
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: var(--green);
  cursor: pointer;
}
.auth-check label {
  font-family: 'Syne', sans-serif;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ink-light);
  cursor: pointer;
  line-height: 1.6;
}
.auth-check label a { color: var(--green); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
.auth-check label a:hover { border-color: var(--green); }

/* ─── Submit button ──────────────────────────────────────────────────────── */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: var(--ink);
  border-radius: var(--radius);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn-auth:hover { background: var(--green); transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }
.btn-auth ion-icon { font-size: 16px; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  font-weight: 300;
  color: var(--ink-light);
}
.auth-footer a {
  font-family: 'Syne', sans-serif;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.auth-footer a:hover { border-color: var(--green); }

/* ─── Trust icons (card bottom) ─────────────────────────────────────────── */
.auth-trust {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 24px;
  opacity: .35;
}
.auth-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: 'Syne', sans-serif;
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
}
.auth-trust-item ion-icon { font-size: 20px; }

/* ─── Keyframe animations ────────────────────────────────────────────────── */
@keyframes authFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes authWordUp {
  to { opacity: 1; transform: translateY(0); }
}



@keyframes goldShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.auth-welcome-heading .word.gold {
  background: linear-gradient(
    90deg,
    var(--gold) 0%,
    #f0d080 40%,
    var(--gold) 60%,
    #e8b84b 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation:
    authWordUp   .55s cubic-bezier(.22,.61,.36,1) .83s forwards,
    goldShimmer  3s linear 1.5s infinite;
}

/* Blinking cursor after the last word */
.auth-welcome-heading::after {
  content: '|';
  color: var(--gold);
  opacity: 0;
  animation: authCursor .9s step-end 1.4s 6;
}
@keyframes authCursor {
  0%, 100% { opacity: 0; }
  50%       { opacity: 1; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }
  .auth-form-side { min-height: calc(100vh - 68px); }
}

@media (max-width: 520px) {
  .auth-card, .auth-card--wide { padding: 32px 20px; }
  .field-row { grid-template-columns: 1fr; }
  .auth-tabs .auth-tab-btn { font-size: .5rem; padding: 12px 8px; }
}