/* ============================================================
   Divine Light Psychiatry Services — Auth System (Phase 1)
   Extends the tokens defined in style.css. Load style.css first.
   ============================================================ */

body.page-auth,
body.page-auth #hero,
body.page-auth #footer { background: var(--warm-white); }

body.page-auth { min-height: 100vh; }

/* ─── SHELL / SPLIT LAYOUT ───────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
}

/* ─── LEFT BRAND PANEL ───────────────────────────────────── */
.auth-brand-panel {
  position: relative;
  background: linear-gradient(160deg, var(--teal-deep) 0%, #0e4a57 60%, #092830 100%);
  display: flex;
  align-items: center;
  padding: 3.5rem 3rem;
  overflow: hidden;
}
.auth-brand-panel::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/svg%3E");
}
.auth-brand-panel-inner { position: relative; z-index: 1; max-width: 380px; }

.auth-brand-logo { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 3.5rem; }
.auth-brand-logo-icon {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal-mid), var(--teal-light));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(77,184,204,0.35);
}
.auth-brand-logo-icon svg { width: 24px; height: 24px; color: #fff; }
.auth-brand-logo-text { display: flex; flex-direction: column; }
.auth-brand-logo-name { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; color: #fff; line-height: 1.2; }
.auth-brand-logo-tag { font-family: 'Inter', sans-serif; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-top: 2px; }

.auth-brand-eyebrow {
  display: inline-block; font-family: 'Poppins', sans-serif; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-light); margin-bottom: 0.85rem;
}
.auth-brand-copy h2 {
  font-family: 'Playfair Display', serif; font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  font-weight: 600; color: #fff; line-height: 1.35; margin-bottom: 2.5rem;
}

.auth-trust-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
.auth-trust-list li {
  display: flex; align-items: center; gap: 0.85rem;
  font-size: 0.88rem; color: rgba(255,255,255,0.82); font-family: 'Inter', sans-serif;
}
.auth-trust-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(77,184,204,0.18); display: flex; align-items: center; justify-content: center;
}
.auth-trust-icon svg { width: 16px; height: 16px; color: var(--teal-light); }

.auth-brand-quote {
  border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1.5rem;
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 0.95rem; color: rgba(255,255,255,0.65);
}

/* ─── RIGHT FORM PANEL ───────────────────────────────────── */
.auth-form-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem;
  background: var(--warm-white);
}
.auth-form-wrap { width: 100%; max-width: 420px; }

.auth-mobile-brand {
  display: none; align-items: center; gap: 0.6rem;
  font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1rem;
  color: var(--teal-deep); margin-bottom: 2rem;
}
.auth-mobile-brand svg { width: 26px; height: 26px; color: var(--teal-mid); }

.auth-form-header { margin-bottom: 1.75rem; }
.auth-form-header h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-bottom: 0.5rem; }
.auth-form-header p { color: var(--muted); font-size: 0.94rem; line-height: 1.6; }

/* ─── ALERTS ─────────────────────────────────────────────── */
.auth-alert {
  display: none; padding: 0.85rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; line-height: 1.5; margin-bottom: 1.25rem;
}
.auth-alert.is-visible { display: block; animation: fadeIn 0.3s ease; }
.auth-alert-error   { background: rgba(214,69,69,0.08); border: 1px solid rgba(214,69,69,0.25); color: #b3311f; }
.auth-alert-success { background: rgba(122,171,143,0.15); border: 1px solid var(--sage); color: #2d6a4f; }
.auth-alert-info     { background: rgba(42,128,149,0.08); border: 1px solid rgba(42,128,149,0.25); color: var(--teal-deep); }

/* ─── FORM ELEMENTS (extends .form-group from style.css) ─── */
.auth-form-wrap .form-group input { background: #fff; }
.field-error {
  display: none; font-size: 0.78rem; color: #b3311f; margin-top: 0.4rem; font-family: 'Inter', sans-serif;
}
.form-group.has-error input { border-color: #d64545 !important; }
.form-group.has-error .field-error { display: block; }

.optional-tag { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Honeypot: present in the DOM for bots, invisible + unreachable for humans */
.auth-hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ─── PASSWORD FIELD ─────────────────────────────────────── */
.password-field { position: relative; }
.password-field input { padding-right: 3rem; }
.password-toggle {
  position: absolute; top: 50%; right: 0.9rem; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--muted); transition: var(--transition);
}
.password-toggle:hover { background: var(--cream); color: var(--teal-mid); }
.password-toggle svg { width: 18px; height: 18px; }

.password-strength { margin-top: 0.6rem; display: flex; align-items: center; gap: 0.6rem; }
.password-strength-bar { flex: 1; height: 4px; background: var(--border); border-radius: 3px; overflow: hidden; }
.password-strength-bar span { display: block; height: 100%; width: 0%; border-radius: 3px; transition: width 0.3s ease, background 0.3s ease; }
.password-strength-label { font-size: 0.74rem; font-weight: 600; color: var(--muted); font-family: 'Poppins', sans-serif; min-width: 46px; }
.password-strength[data-level="weak"] .password-strength-bar span   { width: 25%;  background: #d64545; }
.password-strength[data-level="fair"] .password-strength-bar span   { width: 50%;  background: #d69a1f; }
.password-strength[data-level="good"] .password-strength-bar span   { width: 75%;  background: var(--sage); }
.password-strength[data-level="strong"] .password-strength-bar span { width: 100%; background: var(--teal-mid); }
.password-strength[data-level="weak"] .password-strength-label   { color: #d64545; }
.password-strength[data-level="fair"] .password-strength-label   { color: #d69a1f; }
.password-strength[data-level="good"] .password-strength-label   { color: #4d8a6a; }
.password-strength[data-level="strong"] .password-strength-label { color: var(--teal-mid); }

.password-requirements { margin-top: 0.65rem; display: flex; flex-direction: column; gap: 0.3rem; }
.password-requirements li {
  position: relative; padding-left: 1.4rem; font-size: 0.78rem; color: var(--muted); font-family: 'Inter', sans-serif;
  transition: color var(--transition);
}
.password-requirements li::before {
  content: ''; position: absolute; left: 0; top: 0.2rem; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--border); transition: var(--transition);
}
.password-requirements li.is-met { color: #2d6a4f; }
.password-requirements li.is-met::before {
  border-color: var(--sage); background: var(--sage);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 9px; background-position: center; background-repeat: no-repeat;
}

/* ─── CHECKBOXES ─────────────────────────────────────────── */
.form-group-checkbox { margin-top: 0.5rem; }
.auth-checkbox {
  display: flex; align-items: flex-start; gap: 0.65rem; cursor: pointer;
  font-size: 0.85rem; color: var(--body-text); line-height: 1.55;
}
.auth-checkbox input {
  width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--teal-mid); cursor: pointer;
}
.auth-checkbox a { color: var(--teal-mid); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.auth-checkbox-inline { font-size: 0.85rem; }

.auth-form-row-split {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0.25rem 0 1.5rem; flex-wrap: wrap; gap: 0.5rem;
}
.auth-inline-link { font-size: 0.85rem; font-weight: 600; color: var(--teal-mid); }
.auth-inline-link:hover { text-decoration: underline; }

/* ─── SUBMIT BUTTON ──────────────────────────────────────── */
.auth-submit-btn {
  width: 100%; justify-content: center; margin-top: 0.5rem;
  position: relative; padding: 0.95rem 2rem;
}
.btn-spinner {
  display: none; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: authSpin 0.7s linear infinite;
}
.auth-submit-btn.is-loading .btn-label { visibility: hidden; }
.auth-submit-btn.is-loading .btn-spinner {
  display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.auth-submit-btn:disabled { opacity: 0.75; cursor: not-allowed; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-form-note { margin-top: 1.5rem; font-size: 0.78rem; color: var(--muted); line-height: 1.6; text-align: center; }
.auth-switch { margin-top: 2rem; text-align: center; font-size: 0.9rem; color: var(--body-text); }
.auth-switch a { color: var(--teal-mid); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ─── PORTAL WELCOME SCREEN ──────────────────────────────── */
.portal-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem; background: linear-gradient(160deg, var(--teal-deep) 0%, #0e4a57 55%, #092830 100%);
}
.portal-card {
  width: 100%; max-width: 460px; background: #fff; border-radius: var(--radius-lg);
  padding: 3rem 2.5rem; text-align: center; box-shadow: var(--shadow-lg);
  animation: modalIn 0.4s ease;
}
.portal-brand { justify-content: center; color: var(--teal-deep); }
.portal-avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0.5rem auto 1.25rem;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-mid));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; color: #fff;
  box-shadow: 0 8px 24px rgba(26,95,110,0.3);
}
.portal-role-badge {
  display: inline-block; font-family: 'Poppins', sans-serif; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--teal-mid);
  background: rgba(42,128,149,0.1); padding: 0.35rem 0.9rem; border-radius: 30px; margin-bottom: 1rem;
}
.portal-greeting { font-size: 1.7rem; margin-bottom: 0.5rem; }
.portal-subtext { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.5rem; }
.portal-notice {
  display: flex; align-items: center; gap: 0.6rem; text-align: left;
  background: rgba(214,154,31,0.1); border: 1px solid rgba(214,154,31,0.3); color: #8a6414;
  border-radius: var(--radius-sm); padding: 0.85rem 1rem; font-size: 0.82rem; margin-top: 1.25rem;
}
.portal-notice svg { width: 18px; height: 18px; flex-shrink: 0; }
.portal-divider { height: 1px; background: var(--border); margin: 1.75rem 0; }
.portal-coming-soon { font-size: 0.85rem; color: var(--muted); line-height: 1.7; margin-bottom: 1.75rem; }
.portal-card .auth-submit-btn { max-width: 220px; margin-left: auto; margin-right: auto; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-mobile-brand { display: flex; }
  .auth-form-panel { padding: 2.5rem 1.5rem; min-height: 100vh; }
}
@media (max-width: 480px) {
  .auth-form-panel { padding: 2rem 1.1rem; }
  .portal-card { padding: 2.25rem 1.5rem; }
}
