:root {
    --wine: #740000;
    --wine-light: #8B0000;
    --gold: #D3A625;
    --gold-light: #E9C766;
    --parchment: #FDFBF7;
    --parchment-dark: #F3EAD0;
    --ink: #241c14;
    --line: #E5D9B6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
    background: var(--parchment);
    color: var(--ink);
    font-size: 17px;
}

h1, h2, h3, h4 {
    font-family: 'Cinzel', Georgia, serif;
    margin: 0;
    letter-spacing: 0.01em;
}

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

/* ---------- Login page ---------- */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 15%, rgba(211,166,37,0.12), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(116,0,0,0.10), transparent 45%),
        var(--parchment);
}

.card {
    position: relative;
    background: #fffdf7;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 44px 40px 36px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(116, 0, 0, 0.14);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--wine), var(--gold), var(--wine));
}

.card .logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.card .logo-row img {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.card h1 {
    font-size: 21px;
    color: var(--wine);
}

.brand-sub {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    color: #9a8b60;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

p.subtitle {
    margin: 0 0 24px;
    color: #6b5d42;
    font-size: 16px;
    line-height: 1.5;
}

label {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #6b5d42;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="email"] {
    width: 100%;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--parchment);
    color: var(--ink);
    font-size: 16px;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin-bottom: 18px;
}

input[type="email"]:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(211,166,37,0.2);
}

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 10px;
    border: none;
    background: var(--wine);
    color: #fff;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background .15s, transform .15s;
}

button:hover, .btn:hover { background: var(--wine-light); transform: translateY(-1px); }

.error {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #fdf1f1;
    border: 1px solid #f3caca;
    color: #8a1f1f;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
}

/* ---------- Member area ---------- */

.site-header {
    background: #fffdf7;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header .inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-header img.logo {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.site-header h1 {
    font-size: 18px;
    color: var(--wine);
}

.site-header a.logout {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #6b5d42;
    text-decoration: none;
    border: 1px solid var(--line);
    padding: 8px 16px;
    border-radius: 8px;
    transition: background .15s;
}

.site-header a.logout:hover { background: var(--parchment-dark); }

.hero {
    position: relative;
    background: linear-gradient(135deg, var(--wine) 0%, #5a0000 100%);
    padding: 56px 24px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(211,166,37,0.18), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(211,166,37,0.12), transparent 45%);
}

.hero .inner { position: relative; max-width: 640px; margin: 0 auto; }

.hero .badge {
    display: inline-block;
    background: var(--gold);
    color: #241c14;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.hero h2 {
    color: #fff;
    font-size: 34px;
    line-height: 1.25;
    margin-bottom: 12px;
}

.hero p {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: #f1e2c6;
    font-size: 15.5px;
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto;
}

.content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 24px 90px;
}

.product-block { margin-bottom: 56px; }

.product-block .product-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    border-bottom: 2px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 28px;
}

.product-block h3 { font-size: 24px; color: var(--ink); }

.product-block .count {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.module {
    background: #fff;
    border: 1px solid #f0e6c8;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(116, 0, 0, 0.05);
    transition: transform .2s, box-shadow .2s;
}

.module:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(116, 0, 0, 0.12);
}

.module .thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.module .thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}

.module .thumb .index {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--wine);
    color: #fff;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 9px;
    border-radius: 6px;
}

.module .body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.module .meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.module .subtitle-tag {
    font-size: 11px;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.module .type-tag {
    font-size: 11px;
    font-weight: 600;
    color: #8a7c58;
    background: var(--parchment-dark);
    padding: 3px 9px;
    border-radius: 999px;
}

.module h4 { font-size: 19px; line-height: 1.3; }

.module p.desc {
    font-size: 14.5px;
    color: #5c5340;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

.module .btn {
    margin-top: 6px;
    align-self: flex-start;
    font-size: 13.5px;
    padding: 10px 18px;
}

.module.locked .thumb img {
    filter: grayscale(1) brightness(0.55);
}

.module.locked .thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(36, 28, 20, 0.12);
}

.module.locked .lock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    background: #3a3226;
    color: #fff;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 9px;
    border-radius: 6px;
}

.module.locked h4,
.module.locked p.desc {
    opacity: 0.75;
}

.module.locked .btn {
    background: var(--gold);
    color: var(--ink);
}

.module.locked .btn:hover {
    background: var(--gold-light);
}

/* ---------- Order bump modal (CSS-only, no JS) ---------- */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 12, 8, 0.72);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay:target { display: flex; }

.modal-box {
    position: relative;
    background: #fffdf7;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 34px 28px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.modal-box::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(90deg, var(--wine), var(--gold), var(--wine));
}

.modal-box img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 6px auto 14px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2));
}

.modal-box h4 {
    font-size: 20px;
    color: var(--wine);
    margin-bottom: 12px;
}

.modal-box p {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #5c5340;
    line-height: 1.55;
    margin: 0 0 22px;
}

.modal-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin: -6px 0 22px;
}

.modal-price .from {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 15px;
    color: #a89a76;
    text-decoration: line-through;
}

.modal-price .to {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--wine);
}

.modal-box .btn {
    width: 100%;
    margin-bottom: 12px;
}

.upsell-box {
    padding: 0;
    overflow: hidden;
}

.upsell-box::before {
    display: none;
}

.upsell-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.upsell-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.upsell-header {
    background: linear-gradient(135deg, var(--wine) 0%, #4a0000 100%);
    padding: 28px 28px 22px;
    text-align: center;
}

.upsell-header .gift-badge {
    margin-bottom: 12px;
}

.upsell-header h4 {
    color: #fff;
    font-size: 19px;
    line-height: 1.35;
    margin: 0;
}

.upsell-header h4 .upsell-highlight {
    display: block;
    color: var(--gold-light);
    margin-top: 2px;
}

.upsell-body {
    padding: 24px 28px 28px;
    text-align: center;
}

.upsell-price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: -6px 0 14px;
}

.upsell-price-row .modal-price {
    margin: 0;
}

.upsell-discount-tag {
    background: rgba(211, 166, 37, 0.18);
    color: #a5791a;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 6px;
}

.upsell-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--parchment-dark);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13.5px;
    color: #6b5d42;
}

.upsell-timer strong {
    color: #b8492f;
    font-variant-numeric: tabular-nums;
}

.modal-box .upsell-cover {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;
    border-radius: 12px;
    margin: 0 auto 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.modal-box .gift-badge {
    display: inline-block;
    background: var(--gold);
    color: #241c14;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.modal-box .gift-example {
    background: var(--parchment-dark);
    border-left: 3px solid var(--gold);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0 0 16px;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-style: italic;
    font-size: 14px;
    color: var(--ink);
    text-align: left;
}

.modal-box .btn-secondary {
    background: transparent;
    border: 1.5px solid var(--wine);
    color: var(--wine);
}

.modal-box .btn-secondary:hover {
    background: var(--wine);
    color: #fff;
}

.modal-close-link {
    display: block;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    color: #9a8b60;
    text-decoration: none;
}

.modal-close-link:hover { color: #6b5d42; }

.gift-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: linear-gradient(90deg, var(--wine), #5a0000);
    color: #fff;
    text-decoration: none;
    padding: 16px 22px;
    border-radius: 14px;
    margin-bottom: 40px;
    box-shadow: 0 6px 20px rgba(116, 0, 0, 0.18);
    transition: transform .15s, box-shadow .15s;
}

.gift-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(116, 0, 0, 0.25);
}

.gift-banner-badge {
    background: var(--gold);
    color: #241c14;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 5px 12px;
    border-radius: 999px;
    flex-shrink: 0;
}

.gift-banner-text {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
}

.empty {
    text-align: center;
    color: #9a8b60;
    padding: 60px 20px;
    font-size: 15px;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 16px;
}

@media (max-width: 640px) {
    .hero h2 { font-size: 27px; }
    .content { padding: 36px 16px 60px; }
    .modules-grid { grid-template-columns: 1fr; }
}
