/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cream:      #EDE7DC;
    --cream-dark: #E4DDD0;
    --white:      #FFFFFF;
    --forest:     #1C4038;
    --forest-light: #2A5C4E;
    --teal:       #2D7A68;
    --teal-light: #3D9C86;
    --charcoal:   #1A2028;
    --muted:      #6B7685;
    --num-color:  #C8C2B8;
    --border:     #E0D9CF;
    --red:        #C0392B;
    --shadow-sm:  0 2px 8px rgba(26,32,40,.06);
    --shadow-md:  0 4px 20px rgba(26,32,40,.10);
    --radius:     12px;
    --radius-sm:  8px;

    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background-color: var(--cream);
    color: var(--charcoal);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}

.header-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--teal);
}

.header-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--charcoal);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    transition: color .15s;
}
.nav-link:hover,
.nav-link.active { color: var(--charcoal); }

.nav-logout {
    color: var(--muted);
    font-size: 13px;
}
.nav-logout:hover { color: var(--red); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding: 32px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-serif);
    font-size: 14px;
    color: var(--charcoal);
}

.footer-copy {
    font-size: 12px;
    color: var(--muted);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover   { opacity: .88; }
.btn:active  { transform: scale(.98); }

.btn-primary {
    background: var(--forest);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--forest);
    border: 2px solid var(--forest);
}

.btn-teal {
    background: var(--teal);
    color: var(--white);
}

.btn-full { width: 100%; justify-content: center; }

/* ── Tags / badges ────────────────────────────────────────────────────────── */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.tag-pdf        { background: #E8F4EF; color: #1C6B4A; }
.tag-assessment { background: #EAF0F8; color: #1A4A7A; }
.tag-link       { background: #F3EEF8; color: #5A2D82; }
.tag-image      { background: #FEF6EC; color: #92400E; }
.tag-mixed      { background: #F3F3F3; color: #444; }
.tag-environment { background: #F0F4E8; color: #3A5A1A; }
.tag-nutrition   { background: #FEF9EC; color: #7A4F00; }
.tag-checklist   { background: #E8F4EF; color: #1C6B4A; }

/* ── Auth split layout (login + register) ─────────────────────────────────── */
.auth-split-page {
    display: flex;
    min-height: 100vh;
}

/* Book panel — left (fixed width, sticky) */
.auth-book-panel {
    flex: 0 0 420px;               /* fixed 420px, never shrinks */
    background-color: #1C4038;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.auth-book-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 28px;
    width: 100%;
    max-width: 280px;
}

.auth-book-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #7EC8B4;
}

/* 3-D book effect */
.auth-book-img {
    display: block;
    width: 200px;
    height: auto;
    border-radius: 3px 8px 8px 3px;
    box-shadow:
        -10px 8px 0 rgba(0,0,0,.45),
        -4px  4px 0 rgba(0,0,0,.25),
        0    30px 70px rgba(0,0,0,.55),
        6px   0  16px rgba(0,0,0,.18);
    transform: perspective(1000px) rotateY(-14deg);
    transition: transform .4s ease, box-shadow .4s ease;
}
.auth-book-img:hover {
    transform: perspective(1000px) rotateY(-5deg) translateY(-8px);
    box-shadow:
        -10px 8px 0 rgba(0,0,0,.45),
        -4px  4px 0 rgba(0,0,0,.25),
        0    46px 90px rgba(0,0,0,.60),
        6px   0  16px rgba(0,0,0,.18);
}

/* Placeholder shown when image fails to load */
.auth-book-img-wrap {
    position: relative;
    width: 200px;
}
.auth-book-placeholder {
    width: 200px;
    height: 290px;
    background: rgba(255,255,255,.08);
    border-radius: 3px 8px 8px 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: rgba(255,255,255,.35);
    font-size: 13px;
    font-style: italic;
    box-shadow: -8px 6px 0 rgba(0,0,0,.35), 0 24px 60px rgba(0,0,0,.45);
    transform: perspective(1000px) rotateY(-14deg);
}

.auth-book-meta {
    color: #ffffff;
}

.auth-book-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-style: italic;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 4px;
}

.auth-book-author {
    font-size: 13px;
    color: rgba(255,255,255,.58);
    font-weight: 500;
    letter-spacing: .01em;
}

/* Form panel — right (takes remaining space) */
.auth-form-panel {
    flex: 1;
    min-width: 0;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    overflow-y: auto;
}

.auth-form-inner {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
    .auth-split-page   { flex-direction: column; }
    .auth-book-panel   {
        flex: none;
        width: 100%;
        height: auto;
        position: static;
        padding: 40px 24px 32px;
    }
    .auth-book-img     { width: 150px; transform: perspective(800px) rotateY(-8deg); }
    .auth-book-img:hover { transform: perspective(800px) rotateY(-3deg) translateY(-5px); }
    .auth-book-placeholder { width: 150px; height: 220px; transform: perspective(800px) rotateY(-8deg); }
    .auth-form-panel   { padding: 32px 24px 48px; }
    .auth-form-inner   { max-width: 100%; }
}

/* ── Auth pages (set-password, forgot, reset — no book panel) ─────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 6px;
}

.auth-logo-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
    color: var(--charcoal);
}

.auth-logo-title em {
    font-style: italic;
    color: var(--teal);
}

/* Honor System notice (register page) */
.honor-notice {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #EAF4F0;
    border: 1px solid #B2D8CC;
    border-radius: var(--radius);
    padding: 18px 20px;
    width: 100%;
    max-width: 480px;
    margin-bottom: 20px;
}

.honor-notice-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.honor-notice-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--forest);
    margin-bottom: 4px;
    letter-spacing: .02em;
}

.honor-notice-body {
    font-size: 13px;
    color: #2A5A48;
    line-height: 1.6;
}

.honor-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: var(--charcoal);
    line-height: 1.5;
    cursor: pointer;
}

.honor-check-label input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--teal);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
}

.auth-card-heading {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.auth-card-sub {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 28px;
    line-height: 1.55;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 6px;
}

.form-label-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--teal);
    text-decoration: none;
}
.form-label-link:hover { text-decoration: underline; }

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--charcoal);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    -webkit-appearance: none;
}

.form-input::placeholder { color: #B0AEAD; }

.form-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45,122,104,.12);
}

.form-hint {
    margin-top: 5px;
    font-size: 12px;
    color: var(--muted);
}

.form-hint code {
    font-family: monospace;
    background: var(--cream);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

.form-submit { margin-top: 24px; }

.auth-divider {
    margin: 24px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.auth-note {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
}

.auth-note a { color: var(--teal); font-weight: 500; }
.auth-note a:hover { text-decoration: underline; }

/* Alerts */
.alert {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}
.alert-error {
    background: #FEF2F2;
    color: var(--red);
    border: 1px solid #FECACA;
}
.alert-error a { color: var(--red); font-weight: 600; }
.alert-success {
    background: #EAF4F0;
    color: #1C5C44;
    border: 1px solid #B2D8CC;
}

/* ── Bonuses library ──────────────────────────────────────────────────────── */
.bonuses-page { padding: 56px 0 80px; }

.page-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 10px;
}

.page-heading {
    font-family: var(--font-serif);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 400;
    color: var(--charcoal);
    line-height: 1.2;
    margin-bottom: 12px;
}

.page-heading em {
    font-style: italic;
    color: var(--teal);
}

.page-sub {
    font-size: 16px;
    color: var(--muted);
    max-width: 580px;
    line-height: 1.6;
    margin-bottom: 56px;
}

.bonuses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ── Bonus card ───────────────────────────────────────────────────────────── */
.bonus-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    text-decoration: none;
    color: inherit;
}

.bonus-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Thumbnail (optional) */
.bonus-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--cream-dark);
    flex-shrink: 0;
}

.bonus-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.bonus-card:hover .bonus-card-thumb img { transform: scale(1.03); }

/* Body — always present */
.bonus-card-body {
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bonus-card-number {
    font-family: var(--font-serif);
    font-size: 52px;
    font-weight: 400;
    color: var(--num-color);
    line-height: 1;
    margin-bottom: 12px;
    letter-spacing: -.02em;
}

.bonus-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.bonus-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1.35;
    margin-bottom: 8px;
}

.bonus-card-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 16px;
    /* Clamp to 3 lines so cards stay uniform height */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bonus-card-chapter {
    font-size: 11px;
    color: var(--num-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 12px;
}

.bonus-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: auto;
}

.bonus-card-cta {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
}

.bonus-card-cta.available  { color: var(--teal); }
.bonus-card-cta.coming-soon { color: var(--num-color); font-style: italic; }

.bonus-card-arrow {
    display: flex;
    align-items: center;
    color: var(--teal);
}

.bonus-card-arrow svg { transition: transform .2s; }
.bonus-card:hover .bonus-card-arrow svg { transform: translateX(4px); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 0;
}

.empty-state-title {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.empty-state-sub {
    font-size: 15px;
    color: var(--muted);
}

/* ── Bonus detail page ────────────────────────────────────────────────────── */
.bonus-detail-page { padding: 48px 0 80px; }

/* Full-width hero thumbnail */
.bonus-detail-hero {
    width: 100%;
    max-height: 420px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
    background: var(--cream-dark);
}

.bonus-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* WordPress editor content styles */
.wp-content {
    font-size: 16px;
    line-height: 1.75;
    color: var(--muted);
    margin-bottom: 36px;
}

.wp-content p        { margin-bottom: 1em; }
.wp-content h2       { font-family: var(--font-serif); font-size: 22px; color: var(--charcoal); margin: 1.5em 0 .5em; }
.wp-content h3       { font-family: var(--font-serif); font-size: 18px; color: var(--charcoal); margin: 1.4em 0 .4em; }
.wp-content ul,
.wp-content ol       { padding-left: 1.5em; margin-bottom: 1em; }
.wp-content li       { margin-bottom: .4em; }
.wp-content strong   { color: var(--charcoal); font-weight: 600; }
.wp-content a        { color: var(--teal); text-decoration: underline; }
.wp-content a:hover  { color: var(--forest); }
.wp-content blockquote {
    border-left: 3px solid var(--teal);
    padding: 12px 20px;
    margin: 1.5em 0;
    background: var(--cream);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}
.wp-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 1em 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 40px;
}

.breadcrumb a { color: var(--teal); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--num-color); }

.bonus-detail-layout {
    max-width: 760px;
}

.bonus-detail-inner { /* full width of layout */ }

.bonus-detail-number {
    font-family: var(--font-serif);
    font-size: 72px;
    font-weight: 400;
    color: var(--num-color);
    line-height: 1;
    margin-bottom: 4px;
}

.bonus-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.bonus-detail-title {
    font-family: var(--font-serif);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 600;
    color: var(--charcoal);
    line-height: 1.25;
    margin-bottom: 12px;
}

.bonus-detail-chapter {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 20px;
}

.bonus-detail-desc {
    font-size: 17px;
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 36px;
}

.bonus-detail-cta {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bonus-detail-cta-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.bonus-detail-cta-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.cta-coming-soon {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: var(--cream);
    color: var(--muted);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-style: italic;
}

/* Responsive: stack thumbnail below content on mobile */
@media (max-width: 860px) {
    .bonus-detail-layout.has-thumbnail {
        grid-template-columns: 1fr;
    }
    .bonus-detail-thumb {
        position: static;
        order: -1; /* show above content on mobile */
    }
}

/* ── 404 ──────────────────────────────────────────────────────────────────── */
.not-found-page {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}

.not-found-num {
    font-family: var(--font-serif);
    font-size: 100px;
    font-weight: 400;
    color: var(--num-color);
    line-height: 1;
    margin-bottom: 16px;
}

.not-found-title {
    font-family: var(--font-serif);
    font-size: 26px;
    color: var(--charcoal);
    margin-bottom: 12px;
}

.not-found-sub {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 32px;
}

/* ── PDF Viewer ───────────────────────────────────────────────────────────── */

.pdf-viewer {
    margin: 32px 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #333;
    background: #2a2a2a;
    box-shadow: var(--shadow-md);
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--forest);
    user-select: none;
}

.pdf-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #e8e2d9;
    padding: 5px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    white-space: nowrap;
}
.pdf-btn:hover:not(:disabled) { background: rgba(255,255,255,0.22); }
.pdf-btn:disabled { opacity: 0.38; cursor: not-allowed; }

.pdf-page-info {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-family: var(--font-sans);
    color: #c8c2b4;
}

.pdf-canvas-wrap {
    position: relative;
    min-height: 420px;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #3c3c3c;
    padding: 0;
}

#pdf-canvas {
    display: block;
    margin: 20px auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.pdf-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 14px;
    font-family: var(--font-sans);
    gap: 14px;
}

.pdf-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: #7EC8B4;
    border-radius: 50%;
    animation: pdf-spin 0.75s linear infinite;
}

@keyframes pdf-spin { to { transform: rotate(360deg); } }

.pdf-note {
    padding: 9px 16px;
    font-size: 12px;
    color: #888;
    text-align: center;
    background: #1e1e1e;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-family: var(--font-sans);
    letter-spacing: 0.01em;
}

.pdf-error {
    color: #e07878;
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .bonuses-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .bonuses-grid { grid-template-columns: 1fr; }

    .login-card { padding: 32px 24px; }

    .header-title { font-size: 16px; }

    .bonus-card-number { font-size: 44px; }
}
