@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --g-950: #052e16;
    --g-900: #14532d;
    --g-800: #166534;
    --g-700: #15803d;
    --g-500: #22c55e;
    --g-400: #4ade80;
    --g-300: #86efac;
    --g-100: #dcfce7;
    --g-50:  #f0fdf4;

    --doc-bg:     #ffffff;
    --doc-alt:    #f9fafb;
    --doc-border: #e5e9e7;
    --doc-text:   #111827;
    --doc-muted:  #6b7280;

    --shadow: 0 28px 72px rgba(0,0,0,0.36), 0 8px 24px rgba(0,0,0,0.20);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    background:
        linear-gradient(rgba(5,46,22,0.72), rgba(5,46,22,0.72)),
        url('../images/bg.jpg') center/cover no-repeat fixed;
}

a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════ */
.page-shell {
    min-height: 100vh;
    padding: 28px 20px 48px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.page-grid {
    width: 100%;
    max-width: 1260px;
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

/* ══════════════════════════════════════
   SIDE PANEL
   ══════════════════════════════════════ */
.side-panel {
    position: sticky;
    top: 28px;
    border-radius: 24px;
    padding: 26px 22px 22px;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(160deg, #051f0f 0%, #0c3d20 50%, #14572e 100%);
    box-shadow: var(--shadow);
}

.side-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 85% 8%,  rgba(74,222,128,0.22) 0%, transparent 52%),
        radial-gradient(ellipse at 15% 92%, rgba(34,197,94,0.13)  0%, transparent 52%);
    pointer-events: none;
}

/* ── Brand ── */
.sp-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sp-logo {
    width: 34px; height: 34px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 9px;
    background: rgba(255,255,255,0.08);
    padding: 5px;
    border: 1px solid rgba(255,255,255,0.13);
}

.sp-wordmark {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
}

.sp-wordmark span { color: var(--g-300); }

/* ── Doc identity ── */
.sp-doc-id {
    position: relative;
    z-index: 1;
    padding-top: 18px;
}

.sp-doc-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: var(--g-300);
    opacity: 0.75;
}

.sp-doc-name {
    margin-top: 5px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    letter-spacing: -0.25px;
}

/* ══════════════════════════════════════
   PROGRESS SECTION  (source = register)
   ══════════════════════════════════════ */
.sp-progress {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    padding: 20px 0 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sp-pct-row {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    line-height: 1;
}

.sp-pct-num {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: -4px;
    color: #fff;
    font-variant-numeric: tabular-nums;
    transition: color 0.4s ease;
}

.sp-pct-num.is-done { color: var(--g-300); }

.sp-pct-sym {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 700;
    color: rgba(255,255,255,0.40);
    letter-spacing: 0;
}

.sp-pct-label {
    margin-top: 5px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.1px;
}

.sp-bar-track {
    margin-top: 16px;
    height: 3px;
    background: rgba(255,255,255,0.10);
    border-radius: 999px;
    overflow: hidden;
}

.sp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--g-400), var(--g-300));
    border-radius: 999px;
    transition: width 0.35s ease;
}

.sp-status {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.38);
    line-height: 1.55;
    min-height: 36px;
    transition: color 0.3s;
}

.sp-status.is-done {
    color: var(--g-300);
    font-weight: 600;
}

/* ── Accept button ── */
.sp-accept-btn {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    text-align: center;
    line-height: 1.4;
    cursor: not-allowed;
    border: 1.5px solid rgba(255,255,255,0.11);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.22);
    transition: background 0.25s, border-color 0.25s, color 0.25s,
                transform 0.18s, box-shadow 0.25s;
}

.sp-accept-btn:not([disabled]) {
    background: var(--g-300);
    border-color: var(--g-300);
    color: var(--g-950);
    cursor: pointer;
    animation: cta-pulse 2.4s ease-in-out infinite;
}

@keyframes cta-pulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(134,239,172,0.50), 0 4px 18px rgba(134,239,172,0.18); }
    50%       { box-shadow: 0 0 0 8px rgba(134,239,172,0),   0 4px 18px rgba(134,239,172,0.18); }
}

.sp-accept-btn:not([disabled]):hover {
    background: #a7f3d0;
    border-color: #a7f3d0;
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(134,239,172,0.38);
    animation: none;
}

.sp-accept-btn:not([disabled]):active { transform: translateY(0); }

/* ── Sidebar nav links ── */
.sp-nav {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 14px;
}

.sp-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.50);
    border: 1px solid transparent;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.sp-nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.09);
}

.sp-footer-note {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.24);
    letter-spacing: 0.2px;
}

/* ── Non-register sidebar ── */
.sp-page-switch {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.sp-switch {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.13);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.68);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.18s;
}

.sp-switch:hover { background: rgba(255,255,255,0.12); color: #fff; }

.sp-switch[aria-current="page"] {
    background: rgba(255,255,255,0.95);
    color: var(--g-900);
    border-color: transparent;
}

.sp-actions-std {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.sp-action-primary {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.94);
    color: var(--g-900);
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.15s, box-shadow 0.15s;
}

.sp-action-secondary {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.80);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.18s, transform 0.15s;
}

.sp-action-primary:hover  { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.sp-action-secondary:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }

/* ══════════════════════════════════════
   DOCUMENT PANEL
   ══════════════════════════════════════ */
.document-panel {
    min-width: 0;
    border-radius: 24px;
    background: var(--doc-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Thin page-load-style reading progress */
.doc-reading-bar {
    height: 3px;
    background: transparent;
    position: relative;
}

.doc-reading-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, var(--g-700) 0%, var(--g-400) 100%);
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

/* Read-cue banner */
.doc-read-cue {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 30px;
    background: #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
}

.drc-icon {
    width: 32px; height: 32px;
    flex-shrink: 0;
    background: var(--g-700);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.drc-icon svg { animation: bob 2s ease-in-out infinite; }

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(4px); }
}

.drc-body strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #14532d;
    margin-bottom: 1px;
}

.drc-body span {
    font-size: 12px;
    color: #166534;
    line-height: 1.5;
}

/* ── Doc header ── */
.doc-header {
    padding: 40px 40px 30px;
    border-bottom: 1px solid var(--doc-border);
    background: linear-gradient(180deg, #fff 0%, #fafcfb 100%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--g-800);
    margin-bottom: 14px;
}

.eyebrow::before {
    content: '';
    display: block;
    width: 5px; height: 5px;
    background: var(--g-500);
    border-radius: 50%;
}

.doc-header h1 {
    font-size: clamp(26px, 3.6vw, 42px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -1.2px;
    color: var(--doc-text);
}

.doc-summary {
    margin-top: 14px;
    max-width: 55ch;
    font-size: 15px;
    color: var(--doc-muted);
    line-height: 1.78;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    background: var(--g-50);
    border: 1px solid #c6f6d5;
    color: var(--g-800);
    font-size: 11px;
    font-weight: 700;
}

/* ── Doc nav (sticky) ── */
.doc-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 10px 22px;
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid var(--doc-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.doc-nav::-webkit-scrollbar { height: 0; }

.doc-nav a {
    white-space: nowrap;
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--doc-muted);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.doc-nav a:hover { background: var(--g-50); color: var(--g-800); }

/* ── Doc body ── */
.doc-body { padding: 4px 40px 50px; }

.doc-section {
    padding: 30px 0;
    border-bottom: 1px solid #f0f3f1;
}

.doc-section:last-of-type { border-bottom: none; }

.doc-section h2 {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--doc-text);
}

.doc-section p {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--doc-muted);
    line-height: 1.82;
}

.doc-section p:last-child,
.doc-section ul:last-child { margin-bottom: 0; }

.doc-section ul {
    margin: 0 0 12px;
    padding-left: 18px;
    color: var(--doc-muted);
}

.doc-section li {
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 7px;
}

.inline-note {
    padding-left: 16px;
    border-left: 3px solid rgba(22,163,74,0.24);
}

/* Doc footer */
.doc-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 28px;
    border-top: 1px solid var(--doc-border);
    margin-top: 8px;
}

.doc-footer-links { display: flex; flex-wrap: wrap; gap: 8px; }

.footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--doc-muted);
    background: #f4f6f5;
    border: 1px solid var(--doc-border);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.footer-link:hover,
.footer-link[aria-current="page"] {
    background: var(--g-50);
    color: var(--g-800);
    border-color: #bbf7d0;
}

.footer-caption {
    font-size: 12px;
    color: var(--doc-muted);
    line-height: 1.6;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 1040px) {
    .page-grid { grid-template-columns: 1fr; }
    .side-panel { position: static; }
}

@media (max-width: 620px) {
    .page-shell { padding: 12px 12px 32px; }
    .page-grid  { gap: 12px; }
    .side-panel,
    .document-panel { border-radius: 18px; }
    .doc-header { padding: 26px 22px 22px; }
    .doc-body   { padding-left: 22px; padding-right: 22px; padding-bottom: 36px; }
    .doc-nav    { padding: 8px 14px; }
    .doc-section h2 { font-size: 18px; }
    .sp-pct-num { font-size: 52px; letter-spacing: -3px; }
}
