/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --teal:    #0d9488;
  --teal-lt: #14b8a6;
  --teal-dim:rgba(13,148,136,0.14);
  --sand:    #fef3c7;
  --sand-dk: #d97706;
  --dark:    #0a1512;
  --dark2:   #0d1f1c;
  --dark3:   #0f1a18;
  --border:  #1e3530;
  --text:    #e8f5f2;
  --muted:   #94a3b8;
  --subtle:  #475569;
  --danger:  #ef4444;
}
body { background:var(--dark); color:var(--text); font-family:'DM Sans','Helvetica Neue',Arial,sans-serif; font-size:14px; }
a { color:inherit; text-decoration:none; }
button { font-family:inherit; cursor:pointer; }
input, select, textarea { font-family:inherit; }

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; position:relative; overflow:hidden; }
.login-glow  { position:absolute; width:560px; height:560px; border-radius:50%; background:radial-gradient(circle,rgba(13,148,136,0.14),transparent 68%); top:50%; left:50%; transform:translate(-50%,-50%); pointer-events:none; }
.login-card  { background:var(--dark3); border:1px solid var(--border); border-radius:16px; padding:40px 36px; width:360px; position:relative; z-index:1; box-shadow:0 28px 80px rgba(0,0,0,0.55); }
.back-link   { display:inline-block; color:var(--subtle); font-size:12px; margin-bottom:20px; transition:color .2s; }
.back-link:hover { color:var(--teal-lt); }
.portal-tag  { color:var(--subtle); font-size:11px; letter-spacing:.14em; text-transform:uppercase; margin:6px 0 20px; }
.divider     { height:1px; background:var(--border); margin-bottom:22px; }
.err-msg     { color:var(--danger); font-size:12px; margin-top:8px; }

/* ── Brand elements ─────────────────────────────────────────────────────── */
.logo-row   { display:flex; align-items:center; gap:3px; }
.logo-dot   { width:8px; height:8px; border-radius:50%; background:var(--teal-lt); margin-right:3px; flex-shrink:0; }
.logo-coco  { color:var(--teal-lt); font-family:'Playfair Display',serif; font-weight:700; }
.logo-text-w{ color:var(--sand);    font-family:'Playfair Display',serif; font-weight:700; }

/* ── Form elements ──────────────────────────────────────────────────────── */
.lbl { display:block; color:var(--subtle); font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; margin-bottom:6px; }
.inp { width:100%; background:var(--dark); border:1px solid var(--border); border-radius:7px; padding:9px 12px; color:var(--text); font-size:13px; outline:none; display:block; transition:border-color .2s; }
.inp:focus { border-color:var(--teal); }
.inp option { background:var(--dark2); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary { display:inline-flex; align-items:center; justify-content:center; gap:8px; background:var(--teal); color:#fff; border:none; border-radius:8px; padding:10px 20px; font-size:13px; font-weight:600; transition:background .2s; white-space:nowrap; }
.btn-primary:hover { background:var(--teal-lt); }
.btn-primary:disabled { opacity:.45; cursor:not-allowed; }
.btn-full    { width:100%; }
.btn-outline { display:inline-flex; align-items:center; justify-content:center; gap:8px; background:transparent; color:var(--subtle); border:1px solid var(--border); border-radius:8px; padding:10px 18px; font-size:13px; font-weight:600; transition:all .2s; white-space:nowrap; }
.btn-outline:hover { border-color:var(--teal); color:var(--teal-lt); }
.btn-signout { width:100%; background:transparent; border:1px solid var(--border); color:var(--subtle); border-radius:6px; padding:7px; font-size:12px; transition:all .2s; }
.btn-signout:hover { border-color:var(--teal); color:var(--teal-lt); }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell         { display:flex; height:100vh; overflow:hidden; }
.sidebar       { width:224px; background:var(--dark2); border-right:1px solid var(--border); display:flex; flex-direction:column; justify-content:space-between; padding:24px 0; flex-shrink:0; }
.sidebar-top   { padding:0 16px; }
.sidebar-nav   { display:flex; flex-direction:column; gap:3px; }
.nav-btn       { display:flex; align-items:center; gap:10px; width:100%; padding:9px 12px; border-radius:7px; border:none; background:transparent; color:var(--subtle); font-size:13px; font-weight:500; text-align:left; transition:all .15s; border-left:2px solid transparent; }
.nav-btn:hover { background:rgba(13,148,136,0.1); color:var(--text); }
.nav-btn.active{ background:rgba(13,148,136,0.18); color:var(--teal-lt); border-left-color:var(--teal); }
.nav-icon      { width:20px; text-align:center; font-size:13px; }
.sidebar-bottom{ padding:16px; border-top:1px solid var(--border); }
.avatar-row    { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.avatar        { width:36px; height:36px; border-radius:50%; background:rgba(13,148,136,0.28); color:var(--teal-lt); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; flex-shrink:0; }
.avatar.sm     { width:28px; height:28px; font-size:10px; }
.user-name     { color:var(--text); font-weight:600; font-size:13px; }
.user-role     { color:var(--subtle); font-size:11px; text-transform:capitalize; }
.main-content  { flex:1; overflow-y:auto; background:var(--dark); }

/* ── Page layout ────────────────────────────────────────────────────────── */
.page      { padding:32px 36px; max-width:1100px; }
.page-hdr  { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:28px; gap:16px; flex-wrap:wrap; }
.page-title{ color:var(--text); font-size:22px; font-weight:700; font-family:'Playfair Display',serif; margin-bottom:3px; }
.page-sub  { color:var(--subtle); font-size:13px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card       { background:var(--dark3); border:1px solid var(--border); border-radius:12px; padding:20px; }
.card-title { color:var(--text); font-size:14px; font-weight:700; margin-bottom:16px; }

/* ── Stats row ──────────────────────────────────────────────────────────── */
.stats-row { display:flex; gap:16px; margin-bottom:24px; flex-wrap:wrap; }
.stat-card { flex:1; min-width:160px; }
.stat-card .s-label { color:var(--subtle); font-size:10px; letter-spacing:.1em; text-transform:uppercase; margin-bottom:8px; }
.stat-card .s-value { color:var(--text); font-size:26px; font-weight:700; font-family:'Playfair Display',serif; margin-bottom:4px; }
.stat-card .s-sub   { color:var(--subtle); font-size:12px; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.tbl       { width:100%; border-collapse:collapse; }
.tbl th    { color:var(--subtle); font-size:11px; font-weight:600; text-align:left; padding:8px 10px; letter-spacing:.08em; text-transform:uppercase; border-bottom:1px solid var(--border); }
.tbl td    { color:var(--muted); font-size:13px; padding:10px; vertical-align:middle; }
.tbl tr:not(:last-child) td { border-bottom:1px solid var(--border); }
.tbl tr:hover td { background:rgba(13,148,136,0.04); }

/* ── Plan badge ─────────────────────────────────────────────────────────── */
.plan-badge     { padding:2px 8px; border-radius:100px; font-size:11px; font-weight:600; background:rgba(255,255,255,0.06); color:var(--muted); }
.plan-badge.feat{ background:rgba(13,148,136,0.22); color:var(--teal-lt); }

/* ── Progress steps ─────────────────────────────────────────────────────── */
.steps-bar { display:flex; gap:6px; margin-bottom:28px; }
.step-item { flex:1; }
.step-line { height:3px; border-radius:2px; background:var(--border); transition:background .3s; }
.step-line.done   { background:var(--teal); }
.step-line.active { background:rgba(13,148,136,0.55); }
.step-lbl  { font-size:11px; color:var(--subtle); margin-top:4px; transition:color .3s; }
.step-lbl.active{ color:var(--teal-lt); }

/* ── Form grid ──────────────────────────────────────────────────────────── */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-group{ display:flex; flex-direction:column; gap:6px; }
.form-group textarea { resize:vertical; min-height:72px; }

/* ── Confirm box ────────────────────────────────────────────────────────── */
.confirm-box { background:rgba(13,148,136,0.06); border:1px solid rgba(13,148,136,0.2); border-radius:10px; padding:20px; }
.confirm-row { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid rgba(255,255,255,0.05); }
.confirm-row:last-child { border-bottom:none; }
.confirm-key { color:var(--subtle); font-size:13px; }
.confirm-val { color:var(--text); font-size:13px; font-weight:500; }

/* ── Contract ───────────────────────────────────────────────────────────── */
.contract-outer  { border:1px solid var(--border); border-radius:10px; overflow:hidden; margin-bottom:16px; }
.contract-header { background:var(--dark2); border-bottom:1px solid var(--border); padding:12px 20px; display:flex; justify-content:space-between; align-items:center; }
.contract-body   { max-height:300px; overflow-y:auto; padding:20px 24px; background:var(--dark3); }
.contract-title  { color:var(--text); font-family:'Playfair Display',serif; font-size:18px; font-weight:700; text-align:center; margin-bottom:14px; }
.contract-intro  { color:var(--muted); font-size:12.5px; line-height:1.7; padding:12px 16px; background:rgba(13,148,136,0.06); border:1px solid rgba(13,148,136,0.15); border-radius:8px; margin-bottom:18px; }
.sec-title { color:var(--teal-lt); font-size:13px; font-weight:700; margin-bottom:8px; padding-bottom:5px; border-bottom:1px solid var(--border); }
.sec-para  { color:var(--muted); font-size:12px; line-height:1.75; margin-bottom:8px; }
.scroll-badge     { background:rgba(255,255,255,0.05); border:1px solid var(--border); color:var(--subtle); border-radius:100px; padding:4px 14px; font-size:11px; font-weight:600; white-space:nowrap; transition:all .3s; }
.scroll-badge.done{ background:rgba(13,148,136,0.15); border-color:var(--teal); color:var(--teal-lt); }
.ack-section      { background:var(--dark2); border:1px solid var(--border); border-radius:10px; padding:16px 20px; margin-bottom:16px; }
.ack-item         { display:flex; align-items:flex-start; gap:10px; margin-bottom:10px; cursor:pointer; }
.ack-item:last-child{ margin-bottom:0; }
.ack-item.disabled{ opacity:.4; cursor:not-allowed; }
.ack-box          { width:18px; height:18px; border-radius:4px; border:1.5px solid var(--border); background:transparent; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; transition:all .15s; }
.ack-box.checked  { background:var(--teal); border-color:var(--teal); }
.ack-text         { color:var(--muted); font-size:13px; line-height:1.5; }
.ack-text.checked { color:var(--text); }
.sig-box          { background:var(--dark2); border:1px solid var(--border); border-radius:10px; padding:16px 20px; margin-bottom:20px; }
.sig-input        { width:100%; background:var(--dark); border:1px solid var(--border); border-radius:8px; padding:12px; color:var(--teal-lt); font-size:22px; font-family:'Playfair Display',serif; text-align:center; outline:none; display:block; transition:border-color .2s; letter-spacing:.03em; }
.sig-input:focus  { border-color:var(--teal); }
.sig-match        { font-size:11px; margin-top:6px; font-weight:600; }
.sig-match.ok     { color:var(--teal-lt); }
.sig-match.err    { color:var(--danger); }

/* ── Print doc ──────────────────────────────────────────────────────────── */
.print-doc       { background:var(--dark3); border:1px solid var(--border); border-radius:12px; padding:32px 36px; max-width:820px; }
.print-letterhead{ display:flex; justify-content:space-between; align-items:flex-start; }
.print-divider   { height:1px; background:var(--border); margin:16px 0; }
.print-parties   { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:16px 0; }
.party-box       { border:1px solid var(--border); border-radius:8px; padding:14px 16px; }
.party-label     { color:var(--teal-lt); font-size:10px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; margin-bottom:8px; }
.print-sig-grid  { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-top:20px; }
.sig-display     { height:64px; border:1px solid var(--border); border-radius:6px; background:var(--dark2); display:flex; align-items:center; justify-content:center; }

/* ── Quick actions ──────────────────────────────────────────────────────── */
.quick-grid  { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:20px; }
.quick-btn   { background:var(--dark3); border:1px solid var(--border); border-radius:12px; padding:18px; text-align:left; cursor:pointer; transition:border-color .2s; display:block; width:100%; }
.quick-btn:hover{ border-color:var(--teal); }
.quick-icon  { width:34px; height:34px; border-radius:8px; display:flex; align-items:center; justify-content:center; margin-bottom:10px; font-size:14px; }
.quick-title { color:var(--text); font-weight:600; font-size:13px; margin-bottom:3px; }
.quick-desc  { color:var(--subtle); font-size:12px; }

/* ── Phone mockup (test SMS) ────────────────────────────────────────────── */
.phone-mock  { background:var(--dark2); border:1px solid rgba(20,184,166,0.3); border-radius:14px; overflow:hidden; }
.phone-mock-bar  { background:#1a3530; padding:9px 14px; display:flex; justify-content:space-between; align-items:center; }
.phone-mock-body { padding:12px; }
.sms-bubble  { background:var(--teal); border-radius:10px 10px 10px 3px; padding:10px 12px; color:#fff; font-size:12px; line-height:1.55; max-width:88%; word-break:break-word; }
.tab-btn     { padding:6px 14px; border-radius:6px; font-size:12px; font-weight:600; border:1px solid var(--border); background:transparent; color:var(--subtle); transition:all .15s; }
.tab-btn.active{ background:var(--teal-dim); border-color:var(--teal); color:var(--teal-lt); }

/* ── Leaderboard ────────────────────────────────────────────────────────── */
.leader-row { display:flex; align-items:center; gap:12px; padding:10px 0; }
.leader-row:not(:last-child) { border-bottom:1px solid var(--border); }

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

/* ── Utility ────────────────────────────────────────────────────────────── */
.text-teal   { color:var(--teal-lt); }
.text-muted  { color:var(--muted); }
.text-subtle { color:var(--subtle); }
.text-sand   { color:var(--sand-dk); }
.fw-600      { font-weight:600; }
.fw-700      { font-weight:700; }
.font-serif  { font-family:'Playfair Display',serif; }
.font-mono   { font-family:monospace; }
.mt-8  { margin-top:8px; }
.mt-12 { margin-top:12px; }
.mt-16 { margin-top:16px; }
.mt-20 { margin-top:20px; }
.mt-24 { margin-top:24px; }
.flex  { display:flex; }
.flex-center { display:flex; align-items:center; }
.gap-8  { gap:8px; }
.gap-12 { gap:12px; }
.gap-16 { gap:16px; }

/* ── Print ──────────────────────────────────────────────────────────────── */
@media print {
  body { background:#0a1512 !important; -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
  .no-print { display:none !important; }
  .sidebar, .page-hdr { display:none !important; }
  .shell { display:block; }
  .main-content { overflow:visible; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width:768px) {
  .sidebar { display:none; }
  .page { padding:20px; }
  .form-grid { grid-template-columns:1fr; }
  .stats-row { flex-direction:column; }
}
