/* =========================================================================
   BlackCream — shared styles (public site + redeem + voucher)
   Design: clean, rounded, cream ground, ink text, playful pastel accents.
   ========================================================================= */

:root {
    --cream:      #FBF6EC;
    --cream-deep: #F3E9D6;
    --ink:        #1A1A1A;
    --ink-soft:   #4A4038;
    --muted:      #999999;
    --line:       #E6DCC8;
    --pink:       #F4A9C0;
    --pink-deep:  #E67DA0;
    --blue:       #9FD3E8;
    --blue-deep:  #5FB6D4;
    --brown:      #6B4A3A;
    --green:      #7BC47F;
    --danger:     #E5554E;
    --white:      #FFFFFF;

    --radius:     18px;
    --radius-sm:  12px;
    --shadow:     0 10px 30px rgba(38, 28, 20, .10);
    --shadow-sm:  0 4px 14px rgba(38, 28, 20, .08);
    --maxw:       1080px;
    --font:       'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--pink-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
p { margin: 0 0 1rem; }

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Site header / footer ------------------------------------------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    max-width: var(--maxw);
    margin: 0 auto;
}
.site-header .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-header .brand img {
    height: 62px; width: auto;
    max-width: 40vw;
    object-fit: contain;
    display: block;
}
.site-header nav { display: flex; gap: 8px; flex-shrink: 0; }
.lbl-short { display: none; }

.site-footer {
    margin-top: 60px;
    padding: 30px 20px 50px;
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
}
.site-footer a { color: var(--muted); text-decoration: underline; }

/* ---- Buttons ------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border: 0;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--ink);
    color: var(--white);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn--pink  { background: var(--pink-deep); }
.btn--blue  { background: var(--blue-deep); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.btn--lg { padding: 16px 34px; font-size: 1.1rem; }
.btn--block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---- Cards / panels --------------------------------------------- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}

/* ---- Flash messages -------------------------------------------- */
.flash { max-width: var(--maxw); margin: 12px auto 0; padding: 0 20px; }
.flash__item {
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    margin-bottom: 10px;
    font-size: .95rem;
    font-weight: 500;
}
.flash__item--notice { background: #E9F6EA; color: #2F6D34; }
.flash__item--error  { background: #FBE6E5; color: #A5322C; }
.flash__item--info   { background: #E7F3F8; color: #2C6274; }

/* ---- Hero (home) --------------------------------------------- */
.hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 40px;
    align-items: center;
    padding: 30px 0 20px;
}
.hero__mascot { text-align: center; }
.hero__mascot img {
    display: inline-block;
    width: auto;
    max-width: 78%;
    max-height: 340px;
    filter: drop-shadow(0 16px 24px rgba(38, 28, 20, .15));
}
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

.eyebrow {
    display: inline-block;
    font-size: .78rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--brown);
    background: var(--cream-deep);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}

/* ---- Steps / how it works --------------------------------- */
/* Breathing room between the main blocks on the home page */
.home-sect { margin-top: 32px; }

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.step { text-align: center; padding: 22px; }
.step .num {
    width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    margin: 0 auto 12px;
    font-weight: 700; color: var(--white); background: var(--pink-deep);
}
.step:nth-child(2) .num { background: var(--blue-deep); }
.step:nth-child(3) .num { background: var(--brown); }

/* ---- Reward grid ---------------------------------------- */
.rewards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 22px;
}
.reward {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .12s ease, box-shadow .12s ease;
}
.reward--afford { border-color: var(--green); box-shadow: 0 0 0 2px rgba(123,196,127,.25); }
.reward--locked { opacity: .72; }
.reward__img {
    aspect-ratio: 4 / 3;
    background: var(--cream-deep) center/cover no-repeat;
    display: grid; place-items: center;
    color: var(--muted); font-size: 2rem;
}
.reward__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.reward__name { font-weight: 700; }
.reward__desc { font-size: .86rem; color: var(--muted); flex: 1; white-space: pre-line; }
.reward__desc b, .reward__desc strong { font-weight: 700; color: inherit; }
.reward__desc u { text-decoration: underline; }
.reward__cost {
    font-weight: 700; color: var(--brown);
    display: flex; align-items: center; gap: 6px;
}
.reward__foot { padding: 0 16px 16px; }
.pill {
    font-size: .72rem; font-weight: 700; letter-spacing: .06em;
    padding: 3px 10px; border-radius: 999px; text-transform: uppercase;
}
.pill--ok   { background: #E9F6EA; color: #2F6D34; }
.pill--lock { background: var(--cream-deep); color: var(--brown); }
.pill--out  { background: #FBE6E5; color: #A5322C; }

/* ---- Store locator ------------------------------------------------ */
.locator {
    display: grid;
    grid-template-columns: 20% 80%;
    gap: 20px;
    align-items: start;
    margin-top: 22px;
}
.locator__list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.loc {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--white);
    overflow: hidden;
}
.loc.is-open { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(244, 169, 192, .25); }

.loc__head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 13px 14px;
    border: 0;
    background: transparent;
    font-family: var(--font);
    font-size: .92rem;
    font-weight: 700;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.loc__head:hover { background: var(--cream); }
.loc.is-open .loc__head { background: var(--cream-deep); }
.loc__chevron { color: var(--muted); transition: transform .15s ease; flex-shrink: 0; }
.loc.is-open .loc__chevron { transform: rotate(180deg); }

.loc__body { display: none; padding: 4px 14px 16px; }
.loc.is-open .loc__body { display: block; }
.loc__addr { margin: 0 0 8px; font-size: .86rem; color: var(--ink-soft); }
.loc__meta { margin: 2px 0; font-size: .82rem; color: var(--muted); }
.loc__link { display: inline-block; margin-top: 10px; font-size: .85rem; font-weight: 600; }

.locator__map {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--cream-deep);
    min-width: 0;
}
.locator__map iframe { display: block; width: 100%; height: 440px; border: 0; }

@media (max-width: 820px) {
    .locator { grid-template-columns: 1fr; }
    .locator__map iframe { height: 320px; }
}

/* ---- Score banner ------------------------------------ */
.score-banner {
    text-align: center;
    background: var(--ink);
    color: var(--white);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 26px;
}
.score-banner .n { font-size: 2.6rem; font-weight: 800; color: var(--pink); }

/* ---- Forms --------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.input, .textarea, .select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    background: var(--white);
    color: var(--ink);
}
.input:focus, .textarea:focus, .select:focus {
    outline: none; border-color: var(--blue-deep);
    box-shadow: 0 0 0 3px rgba(95,182,212,.2);
}
.textarea { min-height: 90px; resize: vertical; }
.field--error .input, .field--error .textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: .82rem; margin-top: 4px; }

/* ---- Mini rich-text field (bold / italic / underline only) ---- */
.richtext {
    position: relative;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--white);
    overflow: hidden;
}
.richtext:focus-within {
    border-color: var(--blue-deep);
    box-shadow: 0 0 0 3px rgba(95, 182, 212, .2);
}
.field--error .richtext { border-color: var(--danger); }
.richtext__area {
    min-height: 90px;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px 48px 12px 14px;      /* room for the button strip on the right */
    font-family: var(--font);
    font-size: 1rem;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
    outline: none;
}
.richtext__area b, .richtext__area strong { font-weight: 700; }
.richtext__area i, .richtext__area em { font-style: italic; }
.richtext__area u { text-decoration: underline; }
.richtext__bar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: 34px;
    border-left: 1px solid var(--line);
    background: var(--white);
}
.richtext__btn {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background .12s, color .12s;
}
.richtext__btn + .richtext__btn { border-top: 1px solid var(--line); }
.richtext__btn:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
.richtext__btn.is-active {
    background: rgba(95, 182, 212, .16);
    color: var(--blue-deep);
}
.richtext__btn b, .richtext__btn i, .richtext__btn u { pointer-events: none; }

.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 18px; height: 18px; }

/* ---- Voucher page ------------------------------ */
.voucher {
    max-width: 460px;
    margin: 30px auto;
    text-align: center;
}
.voucher .card { padding: 32px 28px; }
.voucher__qr {
    width: 260px; height: 260px;
    margin: 18px auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
}
.voucher__code {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: .12em;
    background: var(--cream-deep);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    display: inline-block;
    margin: 6px 0 4px;
}
.voucher__status {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.status--issued   { background: #E9F6EA; color: #2F6D34; }
.status--redeemed { background: var(--cream-deep); color: var(--brown); }
.status--expired  { background: #FBE6E5; color: #A5322C; }
.status--void     { background: #FBE6E5; color: #A5322C; }

.dl-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---- Misc ------------------------------------ */
.center { text-align: center; }
.muted  { color: var(--muted); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; }
.stack > * + * { margin-top: 14px; }

/* ---- Responsive --------------------------- */
@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero p.lead { margin-inline: auto; }
    .hero .cta-row { justify-content: center; }
    .hero__mascot { order: -1; }
    .steps { grid-template-columns: 1fr; }
}

/* ---- CocoaCool: text wordmarks (fallback when no logo image) ------ */
.brand-word {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -.01em;
    color: var(--ink);
}
.is-platform .hero { padding-top: 20px; }

/* ---- Storefront header on small screens: compact labels, capped logo */
@media (max-width: 560px) {
    .site-header { padding: 12px 16px; gap: 10px; }
    .site-header .brand img { height: 42px; max-width: 40vw; }
    .site-header .brand-word { font-size: 1.05rem; }
    .site-header nav { gap: 6px; }
    .site-header nav .btn { padding: 8px 12px; }
    .lbl-full { display: none; }
    .lbl-short { display: inline; }
}

/* ---- Password field with show/hide toggle ----------------------- */
.pw-field { position: relative; }
.pw-field .input { padding-right: 46px; }
.pw-toggle {
    position: absolute;
    top: 0; right: 0;
    height: 100%;
    width: 42px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle svg { width: 20px; height: 20px; display: block; }
.pw-toggle .pw-toggle__off { display: none; }
.pw-toggle.is-shown .pw-toggle__on { display: none; }
.pw-toggle.is-shown .pw-toggle__off { display: block; }

/* ---- Storefront paused (subscription lapsed) -------------------- */
.paused {
    max-width: 460px;
    margin: 12vh auto 0;
    padding: 40px 28px;
    text-align: center;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.paused__emoji { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.paused h1 { font-size: 1.5rem; margin: 0 0 6px; }
.paused p { color: var(--ink-soft); margin: 0; }

/* ---- Profile links hub  ({store}/links) ------------------------- */
body.is-links .site-header { display: none; }
body.is-links .site-footer { margin-top: 40px; }
body.is-links main.wrap { padding-top: 8px; }

.links-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px 20px 8px;
    text-align: center;
}
.links-page__head { margin-bottom: 26px; }
.links-page__avatar {
    width: 92px; height: 92px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 14px;
    box-shadow: var(--shadow-sm);
    background: var(--white);
}
.links-page__avatar--text {
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; font-weight: 800;
    color: var(--white); background: var(--pink-deep);
}
.links-page__name { font-size: 1.5rem; margin: 0; }
.links-page__bio {
    margin: 8px auto 0;
    max-width: 34ch;
    color: var(--ink-soft);
    font-size: .95rem;
}
.links-page__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.links-page__btn {
    display: block;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: inset 0 0 0 2px var(--line);
    color: var(--ink);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    word-break: break-word;
}
.links-page__btn:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 2px var(--ink);
    text-decoration: none;
}
.links-page__btn:active { transform: translateY(0); }
.links-page__btn--play {
    background: var(--pink-deep);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}
.links-page__btn--play:hover { box-shadow: var(--shadow); }
