/* ══════════════════════════════════════════════
   LifespanningRx — Partner Portal
   Unified stylesheet
   ══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --crimson: #a42145;
  --crimson-light: #fdf0f3;
  --crimson-border: #d9b0ba;
  --ink: #1a1a18;
  --ink-soft: #3d3d3a;
  --muted: #6b6b67;
  --border: #e4e2dc;
  --border-soft: #efefec;
  --surface: #fafaf8;
  --white: #ffffff;
  --gold: #c9a84c;
  --green: #2d7a4f;
  --green-bg: #edf7f2;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}


/* ── HEADER ─────────────────────────────────── */

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.logo span { color: var(--crimson); }
.logo-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  margin-left: 6px;
}
.header-actions { display: flex; gap: 12px; align-items: center; }
.header-actions span { font-size: 12px; color: var(--muted); }


/* ── HERO (centered, used on Apply + Login) ── */

.hero {
  text-align: center;
  padding: 52px 24px 36px;
  max-width: 560px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 12px;
}
.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.7;
}


/* ── CARD ────────────────────────────────────── */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 16px;
}


/* ── SECTION LABEL (inside cards) ────────────── */

.section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ── FORM LAYOUT ─────────────────────────────── */

.form-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 0;
}
.form-field.full { grid-column: 1 / -1; }
.form-field.mb { margin-bottom: 16px; }
.form-field.mb:last-of-type { margin-bottom: 0; }

.form-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}
.form-input {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus { border-color: var(--crimson); }
.form-input::placeholder { color: #b0aea8; }

.form-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b67' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  width: 100%;
}

.form-textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.15s;
  width: 100%;
}
.form-textarea:focus { border-color: var(--crimson); }


/* ── RADIO GROUP ─────────────────────────────── */

.radio-group { display: flex; gap: 10px; }
.radio-opt {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.radio-opt:hover { border-color: #c9c7c0; }
.radio-opt.selected {
  border-color: var(--crimson);
  background: var(--crimson-light);
  color: var(--crimson);
}
.radio-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.radio-inner {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crimson);
  display: none;
}
.radio-opt.selected .radio-inner { display: block; }


/* ── BUTTONS ─────────────────────────────────── */

.btn-primary {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 13px 28px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--ink-soft); }
.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn-primary.full-width { width: 100%; }

.btn-secondary {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover { background: var(--surface); }

.btn-google {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--border);
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.btn-google:hover { border-color: #c9c7c0; background: var(--surface); }


/* ── DIVIDER ─────────────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--muted);
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ── FORGOT LINK ─────────────────────────────── */

.forgot-link {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--crimson);
  text-decoration: none;
  margin-top: -8px;
  margin-bottom: 4px;
}
.forgot-link:hover { text-decoration: underline; }


/* ── ERROR / SUCCESS MESSAGES ────────────────── */

.form-error {
  display: none;
  font-size: 12px;
  color: var(--crimson);
  background: var(--crimson-light);
  border: 1px solid var(--crimson-border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.form-error.visible { display: block; }

.form-success {
  display: none;
  font-size: 12px;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid #b2d8c4;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.form-success.visible { display: block; }

.field-error {
  font-size: 11px;
  color: var(--crimson);
  margin-top: 2px;
  display: none;
}
.field-error.visible { display: block; }


/* ── SUBMIT AREA (Apply form) ────────────────── */

.submit-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.submit-note { font-size: 12px; color: var(--muted); }


/* ── TRUST STRIP ─────────────────────────────── */

.trust-strip {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
  padding: 16px 0;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}
.trust-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}


/* ── LOGIN PAGE LAYOUT ───────────────────────── */

.login-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.login-box { width: 100%; max-width: 400px; }
.login-hero { text-align: center; margin-bottom: 32px; }
.login-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
}
.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
}
.login-footer a {
  color: var(--crimson);
  text-decoration: none;
}
.login-footer a:hover { text-decoration: underline; }

body.layout-centered {
  display: flex;
  flex-direction: column;
}


/* ── VERIFICATION CODE INPUT ─────────────────── */

.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}
.code-inputs input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.15s;
}
.code-inputs input:focus { border-color: var(--crimson); }

.resend-link {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
}
.resend-link a {
  color: var(--crimson);
  text-decoration: none;
  cursor: pointer;
}
.resend-link a:hover { text-decoration: underline; }
.resend-link a.disabled {
  color: var(--muted);
  pointer-events: none;
}


/* ── DASHBOARD PLACEHOLDER ───────────────────── */

.dashboard-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px;
}
.dashboard-page .card { text-align: center; padding: 48px 28px; }
.dashboard-page .card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 12px;
}
.dashboard-page .card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.status-badge.pending {
  background: #fff8e6;
  color: #9a7b1a;
  border: 1px solid #e8d48a;
}
.status-badge.approved {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #b2d8c4;
}
.status-badge.rejected {
  background: var(--crimson-light);
  color: var(--crimson);
  border: 1px solid var(--crimson-border);
}


/* ── SPINNER ─────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── HIDDEN UTILITY ──────────────────────────── */

.hidden { display: none !important; }


/* ── PORTAL LAYOUT (logged-in pages) ────────── */

.portal-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.portal-header .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-company {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  margin-left: 6px;
}
.badge-tier {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--green-bg);
  color: var(--green);
  border: 0.5px solid #b8e0cc;
}
.btn-ghost {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-ghost:hover { border-color: #c9c7c0; color: var(--ink); }

.portal-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 53px);
}

/* ── Sidebar ── */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 53px;
  height: calc(100vh - 53px);
  overflow-y: auto;
}
.sidebar-account {
  padding: 0 20px 16px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
}
.sidebar-section {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 20px 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: background 0.1s;
}
.sidebar-item:hover { background: var(--surface); }
.sidebar-item.active {
  color: var(--crimson);
  border-left-color: var(--crimson);
  background: var(--crimson-light);
}
.sidebar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Portal main content ── */
.portal-main {
  padding: 36px 32px;
  background: var(--surface);
}
.page-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 8px;
}
.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 34px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 6px;
}
.page-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 32px;
}

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.stat-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}
.stat-trend {
  font-size: 11px;
  color: var(--green);
  margin-top: 4px;
}


/* ── RESPONSIVE ──────────────────────────────── */

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: 1; }
  .radio-group { flex-direction: column; }
  .submit-area { flex-direction: column; gap: 14px; align-items: flex-start; }
  .submit-area .btn-primary { width: 100%; justify-content: center; }
  .trust-strip { flex-direction: column; align-items: center; gap: 10px; }
  .hero-title { font-size: 30px; }
  .login-title { font-size: 30px; }
}

@media (max-width: 768px) {
  .portal-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .portal-main { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
