/* ============================================================================
   Eternal Pics — "Enchanted Garden" design system
   Whimsical, elven, botanical. Misty sage-white, eucalyptus + wisteria +
   petal pastels, delicate antique-gold filigree, forest-ink text.
   Cormorant Garamond (display) / Mulish (body).
   Shared across landing, owner panel, admin. The guest capture page layers its
   own scoped styles on top so it can adopt each event's colors.
   ========================================================================== */

:root {
    /* palette — light & pastel */
    --bg:         #f5f7f0;   /* misty sage-white */
    --bg-2:       #eef1e8;   /* faint wash for bands */
    --surface:    #ffffff;
    --surface-2:  #fbfbf5;   /* warm white */
    --line:       #e4e7db;   /* hairline */
    --line-soft:  #edefe6;

    --sage:       #8ba680;   /* primary — eucalyptus */
    --sage-deep:  #5f7a58;   /* deeper sage for text/hover on light */
    --lavender:   #b3a2cf;   /* wisteria (fae whimsy) */
    --blush:      #e6bcbe;   /* petal */
    --gold:       #c6a566;   /* antique gold filigree (sparing) */
    --gold-soft:  #d8bf8c;

    --ink:        #2d332a;   /* forest charcoal (primary text) */
    --muted:      #6d7565;   /* sage gray */
    --faint:      #96a08b;   /* tertiary / labels */
    --ok:         #6f9a6a;
    --danger:     #c67f74;

    /* type */
    --display: "Cormorant Garamond", Cormorant, Georgia, "Times New Roman", serif;
    --body: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* shape */
    --radius: 10px;
    --radius-lg: 18px;
    --shadow: 0 26px 60px -30px rgba(74, 92, 66, 0.45);
    --shadow-soft: 0 16px 36px -26px rgba(74, 92, 66, 0.35);

    --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background:
        radial-gradient(1100px 560px at 82% -10%, rgba(179, 162, 207, 0.16), transparent 60%),
        radial-gradient(900px 520px at -5% 8%, rgba(139, 166, 128, 0.16), transparent 55%),
        radial-gradient(800px 600px at 50% 108%, rgba(230, 188, 190, 0.14), transparent 60%),
        var(--bg);
    color: var(--ink);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.65;
    font-weight: 400;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--sage-deep); text-decoration: none; }
a:hover { color: var(--ink); }

/* ---- Type ---------------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.08; margin: 0; color: var(--ink); }
h1 { font-size: clamp(38px, 6.4vw, 76px); letter-spacing: -0.5px; font-weight: 500; }
h2 { font-size: clamp(28px, 3.6vw, 44px); letter-spacing: -0.2px; }
h3 { font-size: 23px; }
p  { margin: 0 0 1rem; }

.display-italic { font-style: italic; }
.text-sage { color: var(--sage-deep); }
.text-lav { color: var(--lavender); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* delicate botanical label */
.edge {
    font-family: var(--body);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--sage-deep);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.edge::before {
    content: "";
    width: 18px; height: 18px; flex-shrink: 0;
    background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f7a58' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M12 20V8'/%3E%3Cpath d='M12 12c0-3 2-5 5-5 0 3-2 5-5 5Z'/%3E%3Cpath d='M12 15c0-2.5-2-4-4.5-4 0 2.5 2 4 4.5 4Z'/%3E%3C/svg%3E");
}
.edge.no-tick::before { display: none; }

/* ---- Brand --------------------------------------------------------------- */
.brand {
    font-family: var(--display);
    font-weight: 600;
    font-size: 25px;
    letter-spacing: 0;
    color: var(--ink);
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}
.brand em { font-style: italic; color: var(--sage-deep); }

/* ---- Layout -------------------------------------------------------------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: 520px; }
.section { padding: clamp(56px, 9vw, 120px) 0; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.mt-lg { margin-top: 40px; }
.stack > * + * { margin-top: 16px; }

/* ---- Pressed-flower frame (signature) ------------------------------------ */
/* a soft card with delicate vine corner sprigs */
.matte {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.matte .tick-bl, .matte .tick-br { display: none; }
.matte::before, .matte::after {
    content: "";
    position: absolute; width: 26px; height: 26px;
    background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6a566' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M3 21c6 0 12-4 16-10'/%3E%3Cpath d='M9 15c-1-2 0-4 2-5'/%3E%3Cpath d='M14 11c-2 0-3-1-3-3'/%3E%3C/svg%3E");
    opacity: 0.8;
}
.matte::before { top: 8px; left: 8px; }
.matte::after  { top: 8px; right: 8px; transform: scaleX(-1); }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 16px var(--gutter);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.topbar nav a:hover { color: var(--ink); }

/* ---- Language switch ------------------------------------------------------ */
.lang-switch { display: flex; gap: 7px; }
.lang-btn {
    width: 34px; height: 24px; padding: 0;
    border: 1px solid var(--line); border-radius: 5px;
    background: var(--surface); cursor: pointer; overflow: hidden;
    display: grid; place-items: center; opacity: .5;
    transition: opacity .12s, border-color .12s, box-shadow .12s;
}
.lang-btn.active { opacity: 1; border-color: var(--sage); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sage) 22%, transparent); }
.lang-btn svg { display: block; width: 100%; height: 100%; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    cursor: pointer; border: none;
    font-family: var(--body); font-size: 15px; font-weight: 600; letter-spacing: 0.2px;
    padding: 13px 24px; border-radius: 999px;
    background: var(--sage); color: #fff;
    box-shadow: 0 10px 22px -12px rgba(95, 122, 88, 0.8);
    transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
    min-height: 46px;
}
.btn:hover { filter: brightness(1.03); color: #fff; box-shadow: 0 14px 26px -12px rgba(95, 122, 88, 0.9); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 3px; }
.btn.block { width: 100%; }
.btn.small { padding: 9px 17px; font-size: 13.5px; min-height: 38px; }
.btn.secondary {
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); box-shadow: none;
}
.btn.secondary:hover { border-color: var(--sage); color: var(--sage-deep); background: var(--surface-2); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); box-shadow: none; }

/* ---- Cards --------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-soft);
}
.card + .card { margin-top: 18px; }
.card h2 { margin-bottom: 6px; }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- Badges -------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--body); font-size: 11.5px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--line); color: var(--muted); background: var(--surface-2);
}
.badge.active { color: var(--sage-deep); border-color: color-mix(in srgb, var(--sage) 45%, transparent); background: color-mix(in srgb, var(--sage) 12%, var(--surface)); }
.badge.paused { color: var(--muted); }
.badge::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.badge.plain::before { display:none; }

/* ---- Forms --------------------------------------------------------------- */
label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 7px; font-weight: 600; }
label.tight { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%; padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    font-family: inherit; font-size: 16px;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(139, 166, 128, 0.2);
}
input[type=color] { padding: 5px; height: 46px; cursor: pointer; }

/* file inputs: native ones have a wide intrinsic size and overflow on phones */
input[type=file] {
    display: block; width: 100%; max-width: 100%; box-sizing: border-box;
    padding: 9px 10px; font-family: inherit; font-size: 13px; color: var(--muted);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden;
}
input[type=file]::file-selector-button {
    font-family: inherit; font-size: 13px; font-weight: 600;
    margin-right: 10px; padding: 7px 13px; cursor: pointer;
    color: var(--ink); background: var(--surface-2);
    border: 1px solid var(--line); border-radius: 999px;
}
input[type=file]::file-selector-button:hover { border-color: var(--sage); color: var(--sage-deep); }
textarea { min-height: 90px; resize: vertical; }
.help { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 150px; }

/* choice chips (frames) */
.checks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.checks label {
    display: inline-flex; align-items: center; gap: 9px; margin: 0;
    padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px;
    color: var(--ink); font-size: 14.5px; font-weight: 500; cursor: pointer; background: var(--surface);
    transition: border-color .12s ease, background .12s ease;
}
.checks label:hover { border-color: var(--sage); background: var(--surface-2); }
.checks input { width: auto; accent-color: var(--sage); }

/* ---- Alerts -------------------------------------------------------------- */
.alert { padding: 13px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14.5px; border: 1px solid; }
.alert.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: #8f4034; }
.alert.ok { background: color-mix(in srgb, var(--sage) 14%, var(--surface)); border-color: color-mix(in srgb, var(--sage) 40%, transparent); color: var(--sage-deep); }
.alert.info { background: color-mix(in srgb, var(--lavender) 16%, var(--surface)); border-color: color-mix(in srgb, var(--lavender) 40%, transparent); color: #6a5b86; }

/* ---- QR ------------------------------------------------------------------ */
.qr { text-align: center; }
.qr .frame { display: inline-block; background: #fff; padding: 16px; border-radius: 14px; box-shadow: var(--shadow-soft); border: 1px solid var(--line); }
.qr .frame img { display: block; width: 220px; height: 220px; }
.qr .link { word-break: break-all; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.qr .link-tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage-deep); background: color-mix(in srgb, var(--sage) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sage) 35%, transparent); border-radius: 999px; padding: 4px 12px; }
.qr .link-box { display: flex; gap: 8px; align-items: stretch; }
.qr .link-box input { flex: 1; min-width: 0; font-size: 12.5px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-align: left; }
.qr .link-box .btn { flex-shrink: 0; }
.btn.wa-btn { background: #25d366; color: #fff; box-shadow: 0 10px 22px -12px rgba(37, 211, 102, 0.7); gap: 8px; }
.btn.wa-btn:hover { background: #20bd5a; color: #fff; filter: none; }
.btn.wa-btn svg { flex-shrink: 0; }

/* ---- Gallery ------------------------------------------------------------- */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-soft); }
.gallery img { width: 100%; height: 200px; object-fit: cover; display: block; background: var(--bg-2); }
.gallery figcaption { padding: 10px 13px; font-size: 12.5px; color: var(--muted); }
.gallery figcaption .cap { color: var(--ink); font-family: var(--display); font-style: italic; font-size: 15px; }

/* per-photo moderation */
.gallery figure a { position: relative; display: block; }
.gallery figure.is-hidden img { opacity: .42; filter: grayscale(.6); }
.gallery .hidden-tag {
    position: absolute; top: 8px; left: 8px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: #fff; background: rgba(45, 51, 42, .78); padding: 3px 9px; border-radius: 999px;
}
.mod-actions { display: flex; gap: 6px; margin-top: 8px; }
.mod-actions form { flex: 1; margin: 0; }
.mod-actions button {
    width: 100%; cursor: pointer; font-family: var(--body); font-size: 11.5px; font-weight: 600;
    padding: 6px 8px; border-radius: 999px;
    color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
}
.mod-actions button:hover { border-color: var(--sage); color: var(--sage-deep); }
.mod-actions button.danger:hover { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }

/* ---- Timeline + filter (gallery) ----------------------------------------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }
.chip {
    cursor: pointer; font-family: var(--body); font-size: 13px; font-weight: 600;
    padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface); color: var(--muted); transition: border-color .12s, color .12s, background .12s;
}
.chip:hover { border-color: var(--sage); color: var(--sage-deep); }
.chip.active { background: var(--sage); color: #fff; border-color: var(--sage); }
.chip.active .muted { color: rgba(255,255,255,0.8); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-group { margin-bottom: 34px; position: relative; }
.tl-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.tl-head h3 { font-size: 24px; }
.tl-head .count { font-size: 13px; color: var(--muted); }
.tl-dot { position: absolute; left: -22px; width: 9px; height: 9px; border-radius: 50%; background: var(--sage); margin-top: 11px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--sage) 18%, transparent); }

/* ---- Utility ------------------------------------------------------------- */
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.divider { border: none; border-top: 1px solid var(--line-soft); margin: 26px 0; }
.hairline { border: none; border-top: 1px solid var(--line-soft); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---- Dashboard ----------------------------------------------------------- */
.dash-h { margin-top: 40px; }
.meta { font-size: 13.5px; color: var(--muted); margin: 8px 0 14px; }

/* stat grid (last-event numbers) */
.statgrid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-top: 18px;
}
.stat {
    display: flex; flex-direction: column; gap: 4px;
    padding: 16px 18px;
    background: var(--surface-2); border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}
.stat-num {
    font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1;
    color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat-lbl {
    font-size: 12px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--faint);
}

/* usage rows + meters */
.usage-row { margin-bottom: 20px; }
.usage-row:last-child { margin-bottom: 0; }
.usage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14.5px; color: var(--muted); }
.usage-head strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--sage); transition: width .4s ease; }
.meter.gold > span { background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }
.meter.soon > span { background: repeating-linear-gradient(45deg, var(--line), var(--line) 5px, var(--line-soft) 5px, var(--line-soft) 10px); }

/* tier badge */
.badge.tier { letter-spacing: .1em; }
.badge.tier-personal { color: #6a5b86; border-color: color-mix(in srgb, var(--lavender) 50%, transparent); background: color-mix(in srgb, var(--lavender) 14%, var(--surface)); }
.badge.tier-business { color: #8a6d2f; border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }

/* referral / share card */
.share-card .share-progress { margin: 4px 0 20px; }

/* ---- App footer + promo -------------------------------------------------- */
.app-footer { border-top: 1px solid var(--line-soft); margin-top: 56px; padding: 26px 0; }
.app-footer .inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.app-footer .brand { font-size: 17px; }
.app-footer .promo { font-size: 13.5px; color: var(--muted); }
.app-footer .promo a { color: var(--sage-deep); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
