/* ============================================================
   AGAPE CHURCH KENYA — Auth Stylesheet
   auth.css  |  Companion to Bootstrap 5
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=Instrument+Serif:ital@0;1&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --clr-primary:         #1DB954;
  --clr-primary-dark:    #17a347;
  --clr-primary-light:   #e8f8ee;
  --clr-primary-glow:    rgba(29,185,84,0.18);
  --clr-dark:            #1a1a1a;
  --clr-darker:          #111111;
  --clr-body:            #444444;
  --clr-muted:           #777777;
  --clr-border:          #e2e2e2;
  --clr-light:           #f8f8f8;
  --clr-white:           #ffffff;
  --clr-error:           #d93025;
  --clr-error-bg:        #fdf1f0;
  --ff-heading:          'Playfair Display', Georgia, serif;
  --ff-body:             'DM Sans', 'Segoe UI', sans-serif;
  --ff-accent:           'Instrument Serif', Georgia, serif;
  --shadow-sm:           0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:           0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg:           0 8px 40px rgba(0,0,0,0.15);
  --radius:              14px;
  --radius-pill:         50px;
  --transition:          all 0.3s ease;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: var(--ff-body);
  background: var(--clr-darker);
  color: var(--clr-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  height: auto;
}
/* ============================================================
   AUTH SHELL (two-column layout)
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

/* ============================================================
   LEFT — BRAND PANEL
   ============================================================ */
.panel-brand {
  position: relative;
  width: 44%;
  flex-shrink: 0;
  background: linear-gradient(158deg, #0b6b30 0%, #1aae55 48%, #0d7a38 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 52px;
  overflow: hidden;
}

/* dot-grid texture */
.panel-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

/* decorative blob circles */
.brand-blob {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}
.brand-blob-1 { width: 480px; height: 480px; top: -190px; right: -190px; }
.brand-blob-2 { width: 340px; height: 340px; bottom: -130px; left: -130px; }

/* ── Logo ── */
.brand-logo-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  position: relative; z-index: 2;
}
.brand-logo-ring svg { width: 30px; height: 30px; }

.brand-top { position: relative; z-index: 2; }

.brand-name {
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  margin: 0;
}
.brand-tagline {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.58);
  letter-spacing: 3.5px;
  text-transform: uppercase;
  margin-top: 5px;
}

/* ── Scripture ── */
.brand-mid { position: relative; z-index: 2; }

.brand-verse {
  font-family: var(--ff-accent);
  font-style: italic;
  font-size: clamp(1.4rem, 2vw, 2rem);
  color: #fff;
  line-height: 1.6;
  margin-bottom: 14px;
  border: none;
  padding: 0;
}
.brand-verse-ref {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* ── Benefits list (signup panel) ── */
.brand-benefits { position: relative; z-index: 2; }

.benefits-list {
  list-style: none;
  padding: 0; margin: 0;
}
.benefits-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.82);
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.benefits-list li:last-child { border-bottom: none; }

.benefit-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.benefit-icon svg { color: #fff; }

/* ── Stats ── */
.brand-bottom { position: relative; z-index: 2; }

.brand-stats {
  display: flex;
  gap: 26px;
  align-items: center;
}
.stat-number {
  font-family: var(--ff-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin: 0;
}
.stat-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 4px 0 0;
}
.stat-sep {
  width: 1px; height: 34px;
  background: rgba(255,255,255,0.18);
}

/* ============================================================
   RIGHT — FORM PANEL
   ============================================================ */
.panel-form {
  flex: 1;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 48px;
}

.form-box {
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.55s cubic-bezier(0.22,1,0.36,1) both;
}

/* ── Section mini-label ── */
.section-mini-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
}
.sml-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--clr-primary);
}
.sml-text {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--clr-primary);
}

/* ── Page Title ── */
.auth-heading {
  font-family: var(--ff-heading);
  font-weight: 800;
  font-size: clamp(1.7rem, 2.4vw, 2rem);
  color: var(--clr-dark);
  margin-bottom: 6px;
  line-height: 1.2;
}
.auth-subheading {
  font-size: 0.88rem;
  color: var(--clr-muted);
  margin-bottom: 30px;
}
.auth-subheading a {
  color: var(--clr-primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.auth-subheading a:hover { color: var(--clr-primary-dark); text-decoration: underline; }

/* ── Field ── */
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clr-dark);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.field-wrap { position: relative; }

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-muted);
  display: flex; align-items: center;
  pointer-events: none;
  z-index: 1;
}

.field-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: 0.9rem;
  color: var(--clr-dark);
  background: var(--clr-white);
  transition: var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.field-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3.5px var(--clr-primary-glow);
}
.field-input::placeholder { color: #c0c0c0; }
.field-input.is-error {
  border-color: var(--clr-error);
  box-shadow: 0 0 0 3px rgba(217,48,37,0.10);
}

/* password toggle */
.btn-toggle-pass {
  position: absolute;
  right: 13px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; padding: 0;
  cursor: pointer;
  color: var(--clr-muted);
  display: flex; align-items: center;
  transition: var(--transition);
}
.btn-toggle-pass:hover { color: var(--clr-primary); }

/* phone prefix */
.phone-prefix-text {
  position: absolute;
  left: 44px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--clr-body);
  pointer-events: none;
  z-index: 2;
}
.field-input.with-prefix { padding-left: 82px; }

/* OTP inputs */
.otp-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 6px;
}
.otp-input {
  width: 56px; height: 60px;
  text-align: center;
  font-family: var(--ff-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-dark);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  background: var(--clr-white);
  outline: none;
  transition: var(--transition);
  caret-color: var(--clr-primary);
}
.otp-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3.5px var(--clr-primary-glow);
}
.otp-input.is-filled {
  border-color: var(--clr-primary);
  background: var(--clr-primary-light);
}

/* select */
select.field-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23777' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}

/* ── Inline validation msg ── */
.field-hint {
  font-size: 0.75rem;
  color: var(--clr-muted);
  margin-top: 5px;
}
.field-error {
  font-size: 0.75rem;
  color: var(--clr-error);
  margin-top: 5px;
  display: none;
}
.is-error ~ .field-error,
.is-error + .field-error { display: block; }

/* ── Forgot row ── */
.forgot-row {
  display: flex; justify-content: flex-end;
  margin-top: -4px; margin-bottom: 18px;
}
.forgot-link {
  font-size: 0.8rem;
  color: var(--clr-primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.forgot-link:hover { color: var(--clr-primary-dark); text-decoration: underline; }

/* ── Checkbox ── */
.auth-check-label {
  font-size: 0.8rem;
  color: var(--clr-muted);
  line-height: 1.55;
  cursor: pointer;
}
.auth-check-label a {
  color: var(--clr-primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-check-label a:hover { text-decoration: underline; }
.form-check-input:checked {
  background-color: var(--clr-primary);
  border-color: var(--clr-primary);
}
.form-check-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
}

/* ── Password strength ── */
.strength-bar {
  display: flex; gap: 5px;
  margin-top: 8px;
}
.strength-seg {
  flex: 1; height: 3px;
  border-radius: 4px;
  background: var(--clr-border);
  transition: background 0.35s ease;
}
.strength-hint {
  font-size: 0.72rem;
  color: var(--clr-muted);
  margin-top: 5px;
  min-height: 14px;
  transition: color 0.3s;
}

/* ── Submit button ── */
.btn-auth-submit {
  width: 100%;
  padding: 14px;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: var(--transition);
  box-shadow: 0 5px 20px rgba(29,185,84,0.28);
  position: relative;
  overflow: hidden;
}
.btn-auth-submit:hover {
  background: var(--clr-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(29,185,84,0.38);
}
.btn-auth-submit:active { transform: translateY(0); }

/* ── Outline / secondary button ── */
.btn-auth-outline {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--clr-body);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-pill);
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  display: block;
}
.btn-auth-outline:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: var(--clr-primary-light);
}

/* ── Alert banner ── */
.auth-alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.84rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.auth-alert.success {
  background: #e6f9ee;
  border: 1px solid #a3e6be;
  color: #0f6b30;
}
.auth-alert.error {
  background: var(--clr-error-bg);
  border: 1px solid #f1b8b5;
  color: var(--clr-error);
}
.auth-alert svg { flex-shrink: 0; margin-top: 1px; }

/* ── OTP resend ── */
.resend-row {
  text-align: center;
  font-size: 0.82rem;
  color: var(--clr-muted);
  margin-top: 4px;
}
.resend-row a {
  color: var(--clr-primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.resend-row a:hover { text-decoration: underline; }
.resend-row .countdown { font-weight: 600; color: var(--clr-dark); }

/* ── Step indicators (forgot password) ── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--clr-border);
  border: 2px solid var(--clr-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--clr-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.step-dot.active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--clr-primary-glow);
}
.step-dot.done {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
}
.step-line {
  flex: 1; height: 2px;
  background: var(--clr-border);
  transition: background 0.4s ease;
}
.step-line.done { background: var(--clr-primary); }

/* step labels */
.step-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  margin-bottom: 28px;
}
.step-lbl {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--clr-muted);
  text-align: center;
  flex: 1;
}
.step-lbl.active { color: var(--clr-primary); }

/* ── Divider ── */
.section-divider {
  height: 1px;
  background: var(--clr-border);
  margin: 24px 0;
}

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clr-muted);
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 24px;
}
.back-link:hover { color: var(--clr-primary); }
.back-link svg { transition: transform 0.25s ease; }
.back-link:hover svg { transform: translateX(-3px); }

/* ── Panel brand stagger animations ── */
.brand-top    { animation: slideUp 0.65s 0.05s cubic-bezier(0.22,1,0.36,1) both; }
.brand-mid    { animation: slideUp 0.65s 0.15s cubic-bezier(0.22,1,0.36,1) both; }
.brand-bottom,
.brand-benefits { animation: slideUp 0.65s 0.25s cubic-bezier(0.22,1,0.36,1) both; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--clr-light); }
::-webkit-scrollbar-thumb { background: var(--clr-primary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-primary-dark); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
  .panel-brand { display: none; }
  .panel-form { padding: 50px 28px; }
}
@media (max-width: 575.98px) {
  .panel-form { padding: 40px 18px; }
  .auth-heading { font-size: 1.55rem; }
  .otp-input { width: 44px; height: 52px; font-size: 1.25rem; }
}