/* ============================================================
   base.css — Shared styles for the entire site
   Includes: design tokens, reset, header, layout, buttons,
             modal, footer. Loaded on every page.
   ============================================================ */

/* ================================================
   [DESIGN TOKENS] CSS custom properties
   All colours, spacing, and shadow values live here.
   Update here to retheme the whole site.
   ================================================ */
:root {
    --cream:      #FDF6EC;
    --cream-dark: #F2E8D5;
    --cocoa:      #3D1C02;
    --cocoa-mid:  #7A4419;
    --caramel:    #C47C2B;
    --caramel-lt: #E8A84E;
    --foam:       #FEFAF4;
    --text:       #2A1200;
    --text-muted: #8A6040;
    --border:     #DDC9A8;
    --snapscan:   #E8312A;
    --snapscan-dk:#B5241E;
    --donate:     #1a6e3c;
    --donate-dk:  #145530;
    --radius:     12px;
    --shadow:     0 4px 24px rgba(61,28,2,0.10);
}

/* ================================================
   [RESET]
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    /* Subtle warm noise texture */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23FDF6EC'/%3E%3Crect x='0' y='0' width='1' height='1' fill='%23E8D5B5' opacity='0.3'/%3E%3C/svg%3E");
}

/* ================================================
   [HEADER]
   ================================================ */
header {
    background: var(--cocoa);
    color: var(--cream);
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 120%, rgba(196,124,43,0.25) 0%, transparent 70%);
}
header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.02em;
    position: relative;
}
header p {
    font-weight: 300;
    color: var(--caramel-lt);
    margin-top: 0.4rem;
    font-size: 1rem;
    position: relative;
}
.qr-badge {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.4rem 1rem;
    border: 1px solid rgba(232,168,78,0.4);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--caramel-lt);
    text-decoration: none;
    position: relative;
    transition: background 0.2s;
}
.qr-badge:hover { background: rgba(232,168,78,0.1); }

/* ================================================
   [LAYOUT]
   ================================================ */
main { max-width: 860px; margin: 0 auto; padding: 2rem 1rem 4rem; }

.section-label {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--cocoa);
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--caramel);
    display: inline-block;
}

/* ================================================
   [MODAL] Shared by SnapScan order + donate flows
   ================================================ */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 18, 0, 0.65);
    backdrop-filter: blur(3px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.open { display: flex; }

.modal-card {
    background: var(--foam);
    border-radius: 18px;
    padding: 2rem 1.8rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(42,18,0,0.3);
    animation: modal-in 0.25s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: scale(0.94) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 28px; height: 28px;
    border: none;
    background: var(--cream-dark);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}
.modal-close:hover { background: var(--border); }

.modal-title    { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin-bottom: 0.3rem; }
.modal-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.modal-items    { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.8rem; line-height: 1.7; }

.modal-amount {
    display: inline-block;
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    padding: 0.3rem 1.4rem;
    border-radius: 999px;
    margin-bottom: 1.2rem;
}
.modal-amount.snapscan-amount { background: var(--snapscan); }
.modal-amount.donate-amount   { background: var(--donate); }

.modal-qr-wrap {
    width: 220px; height: 220px;
    margin: 0 auto 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border);
}
/* Do NOT set width/height on SnapScan SVGs — distorts them */
.modal-qr-wrap img { max-width: 210px; max-height: 210px; }

.modal-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    min-height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.poll-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}
.poll-dot.snapscan { background: var(--snapscan); }
.poll-dot.donate   { background: var(--donate); }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Confirmed state */
.modal-confirmed { display: none; flex-direction: column; align-items: center; gap: 0.8rem; padding: 1rem 0; }
.modal-confirmed.show { display: flex; }
.confirmed-icon  { font-size: 3.5rem; }
.confirmed-title { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: #1a7a3c; }
.confirmed-ref   { font-size: 0.8rem; background: var(--cream-dark); padding: 0.35rem 0.9rem; border-radius: 6px; color: var(--text-muted); }
.btn-done {
    margin-top: 0.5rem;
    padding: 0.7rem 2rem;
    background: #1a7a3c;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    cursor: pointer;
}
.btn-done:hover { background: #145e2e; }

/* ================================================
   [FOOTER]
   ================================================ */
footer { text-align: center; padding: 1.5rem; font-size: 0.8rem; color: var(--text-muted); }
