/* Design language follows avaland.com.my: deep teal, lime accent, uppercase light display type.
   Jost stands in for the site's Typekit "dunbar-tall"; General Sans is the site's body face. */
@font-face { font-family: "Jost"; src: url("assets/fonts/jost-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("assets/fonts/general-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("assets/fonts/general-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("assets/fonts/general-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
    --teal-900: #081f22;
    --teal-800: #00292f;
    --teal-700: #1d4c57;
    --teal-500: #5e7d81;
    --teal-300: #a2c7cc;
    --teal-200: #b3cacd;
    --lime: #9be51b;
    --lime-hover: #8bd10f;
    --sand: #dbc3bb;

    --bg: #f2f5f5;
    --surface: #ffffff;
    --surface-2: #f2f6f6;
    --border: #d9e3e4;
    --text: #00292f;
    --muted: #5e7d81;
    --accent: #00292f;
    --accent-soft: #e4eef0;
    --focus: #1d4c57;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --success: #2f6b00;
    --success-soft: #eaf8d3;
    --warn: #7a4f00;
    --warn-soft: #fbf0d9;
    --radius: 4px;
    --display: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
    --body: "General Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a1a1c;
        --surface: #10262a;
        --surface-2: #153034;
        --border: #24434a;
        --text: #e5eff0;
        --muted: #9ab5b8;
        --accent: #a2c7cc;
        --accent-soft: #173a40;
        --focus: #9be51b;
        --danger: #f2877d;
        --danger-soft: #3a1d1b;
        --success: #b4ef55;
        --success-soft: #213b10;
        --warn: #f0c060;
        --warn-soft: #3a2f14;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0a1a1c;
    --surface: #10262a;
    --surface-2: #153034;
    --border: #24434a;
    --text: #e5eff0;
    --muted: #9ab5b8;
    --accent: #a2c7cc;
    --accent-soft: #173a40;
    --focus: #9be51b;
    --danger: #f2877d;
    --danger-soft: #3a1d1b;
    --success: #b4ef55;
    --success-soft: #213b10;
    --warn: #f0c060;
    --warn-soft: #3a2f14;
    color-scheme: dark;
}

* { box-sizing: border-box; }
::selection { background: var(--lime); color: #000; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--body);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---- Masthead (always dark teal, like the avaland.com.my footer) ---- */
.masthead {
    background: linear-gradient(160deg, var(--teal-800) 0%, var(--teal-900) 70%);
    color: #fff;
    padding: 28px 16px 84px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
/* Aurora: two layers of angled lime/teal light bands, blurred. The top layer slides across the
   one beneath with a "difference" blend, which makes the curtains ripple and shift. Masked to fade
   out toward the bottom-left so text stays readable; still for people who ask for reduced motion. */
.aurora {
    --night: repeating-linear-gradient(100deg, #081f22 0%, #081f22 7%, transparent 10%, transparent 12%, #081f22 16%);
    --lights: repeating-linear-gradient(100deg, #9be51b 10%, #2fb59b 15%, #5fd0c2 20%, #b4ef55 25%, #17807a 30%);
    position: absolute;
    inset: -10px;
    z-index: -1;
    pointer-events: none;
    background-image: var(--night), var(--lights);
    background-size: 300%, 200%;
    background-position: 50% 50%, 50% 50%;
    filter: blur(12px);
    opacity: .5;
    -webkit-mask-image: radial-gradient(ellipse 130% 95% at 85% 0%, #000 12%, transparent 72%);
    mask-image: radial-gradient(ellipse 130% 95% at 85% 0%, #000 12%, transparent 72%);
}
.aurora::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--night), var(--lights);
    background-size: 200%, 100%;
    background-attachment: fixed;
    mix-blend-mode: difference;
    animation: aurora 60s linear infinite;
}
@keyframes aurora {
    from { background-position: 50% 50%, 50% 50%; }
    to   { background-position: 350% 50%, 350% 50%; }
}
.qr-page .aurora { opacity: .55; }
@media (prefers-reduced-motion: reduce) {
    .aurora::after { animation: none; }
}
.masthead-inner { max-width: 520px; margin: 0 auto; }
.masthead.wide .masthead-inner { max-width: 1100px; }
.masthead-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.masthead-bar .spacer { flex: 1; }
.logo { display: block; height: 30px; width: auto; }
.eyebrow {
    font-family: var(--display);
    font-size: 13px; font-weight: 500;
    letter-spacing: .24em; text-transform: uppercase;
    color: var(--lime);
    margin: 0 0 10px;
}
.masthead h1 {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(34px, 9vw, 52px);
    line-height: 1.02;
    letter-spacing: .02em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
.masthead .sub { color: var(--teal-200); margin: 0; font-size: 15px; }
.masthead .link-btn {
    font-family: var(--display); font-size: 12px; font-weight: 500;
    letter-spacing: .16em; text-transform: uppercase;
    color: #fff; text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .3);
    background: transparent;
    border-radius: 999px;
    padding: 8px 14px; min-height: 0;
    cursor: pointer;
}
.masthead .link-btn:hover { border-color: var(--lime); color: var(--lime); }

.wrap { max-width: 520px; margin: -56px auto 0; padding: 0 16px 48px; position: relative; }
.wrap.wide { max-width: 1100px; }

h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 20px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 16px;
}
.sub { color: var(--muted); margin: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 41, 47, .08);
    padding: 24px;
    margin-bottom: 18px;
}

label {
    display: block;
    font-size: 12px; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}
.field { margin-bottom: 18px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hint.error { color: var(--danger); }

input, select, textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    min-height: 46px;
}
input::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
input[aria-invalid="true"] { border-color: var(--danger); }

button, .btn {
    font-family: var(--display);
    font-size: 14px; font-weight: 500;
    letter-spacing: .14em; text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 10px 20px;
    min-height: 46px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none;
}
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--lime); color: var(--teal-800); width: 100%; }
.btn-primary:hover:not(:disabled) { background: var(--lime-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); }
.btn-small { min-height: 32px; padding: 4px 12px; font-size: 11px; }
.btn-primary .arrow { transition: transform .25s; }
.btn-primary:hover:not(:disabled) .arrow { transform: translateX(4px); }

.notice { border-radius: var(--radius); padding: 12px 14px; font-size: 15px; margin-bottom: 18px; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.info { background: var(--surface-2); color: var(--muted); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice a { color: inherit; font-weight: 600; }

.success { text-align: center; padding: 36px 24px; }
.success .tick {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--lime); color: var(--teal-800);
    display: grid; place-items: center; margin: 0 auto 18px;
}
.success h2 { font-size: 24px; }
.success dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; text-align: left; max-width: 340px; margin: 20px auto 24px; font-size: 15px; border-top: 1px solid var(--border); padding-top: 18px; }
.success dt { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding-top: 2px; }
.success dd { margin: 0; font-weight: 500; }

/* ---- Checked in + feedback ---- */
.done-head { display: flex; gap: 16px; align-items: center; }
.done-head h2 { margin: 0 0 2px; font-size: 22px; }
.done-head .tick {
    flex: none; width: 52px; height: 52px; border-radius: 50%;
    background: var(--lime); color: var(--teal-800);
    display: grid; place-items: center;
}
.done-details { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); font-size: 15px; }
.done-details dt { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding-top: 2px; }
.done-details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

h3 {
    font-family: var(--display);
    font-weight: 400; font-size: 18px;
    letter-spacing: .08em; text-transform: uppercase;
    margin: 0 0 6px;
}
.feedback, .feedback-thanks { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.feedback h3 + .intro { margin: 0 0 20px; font-size: 15px; }
.feedback-thanks { text-align: center; }
.checked-in > .notice { margin: 24px 0 0; }

fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 500; font-size: 15px; margin-bottom: 10px; padding: 0; }
.optional { font-weight: 400; letter-spacing: 0; text-transform: none; opacity: .8; margin-left: 4px; }
.feedback label { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; color: var(--text); }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }

.stars { display: flex; gap: 6px; }
.feedback .stars label { margin: 0; position: relative; flex: 0 1 52px; cursor: pointer; }
.stars input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.stars svg {
    display: block; width: 100%; height: auto;
    fill: transparent; stroke: var(--teal-300); stroke-width: 1.3; stroke-linejoin: round;
    transition: fill .15s, stroke .15s, transform .15s;
}
.stars label:hover svg { transform: scale(1.08); }
.stars label.on svg { fill: var(--lime); stroke: #7cbd1e; }
.stars input:focus-visible + svg { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.stars.celebrate label.on svg { animation: star-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes star-pop { 0% { transform: scale(1); } 45% { transform: scale(1.22) rotate(-6deg); } 100% { transform: scale(1); } }
.star-word { min-height: 20px; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.star-word.top { color: var(--success); }
@media (prefers-reduced-motion: reduce) {
    .stars.celebrate label.on svg { animation: none; }
}

/* Turnstile widget: invisible unless Cloudflare asks the person to tick a box. */
.bot-check { display: flex; justify-content: center; margin-bottom: 12px; }

.done-switch { text-align: center; margin: 22px 0 0; font-size: 14px; }
.done-switch a { color: var(--muted); }

.hidden { display: none !important; }
footer { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-top: 28px; }
footer a { color: var(--muted); }

/* ---- Admin ---- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 12px; align-items: end; }
.grid-4 .field { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar .field { margin: 0; }
.toolbar .spacer { flex: 1; }
@media (max-width: 760px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-4 button { grid-column: 1 / -1; } }
@media (max-width: 420px) { .grid-4 { grid-template-columns: 1fr; } }

.table-scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr.selected td { background: var(--accent-soft); }
td input, td select { min-height: 34px; padding: 5px 8px; font-size: 14px; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td .actions { display: flex; gap: 6px; justify-content: flex-end; }

.pill { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.open { background: var(--success-soft); color: var(--success); }
.pill.closed { background: var(--surface-2); color: var(--muted); }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.stat { border-left: 2px solid var(--lime); padding: 2px 14px 2px 10px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; color: var(--text); font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.muted { color: var(--muted); }
.feedback-cell { min-width: 240px; max-width: 360px; font-size: 13px; line-height: 1.45; }
.feedback-cell .ratings { font-weight: 600; margin-bottom: 2px; white-space: nowrap; }

.card > h2 + .intro { margin: -8px 0 20px; font-size: 15px; }
.masthead .sub span:empty { display: none; }

/* ---- Welcome / QR display ---- */
.qr-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--teal-900); }
.logo-lg { height: 40px; }
.date-chip { font-family: var(--display); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--teal-200); }
.clock { text-align: right; }
.clock-time {
    font-family: var(--display); font-weight: 300;
    font-size: clamp(30px, 3.4vw, 54px); line-height: 1;
    letter-spacing: .02em; color: #fff;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}
.clock-time small { font-size: .4em; font-weight: 400; letter-spacing: .16em; margin-left: 8px; color: var(--lime); }
.event-subtitle { font-family: var(--display); font-weight: 400; font-size: clamp(18px, 2.4vw, 26px); letter-spacing: .12em; text-transform: uppercase; color: var(--teal-200); margin: 0; }
.qr-cta { font-size: clamp(18px, 2vw, 22px); color: #fff; margin: 36px 0 0; padding-left: 14px; border-left: 3px solid var(--lime); }
.qr-label { font-family: var(--display); font-size: 14px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--teal-800); margin: 0 0 12px; }
.qr-card { margin: 0; }
.qr-page .masthead { flex: 1; padding-bottom: 40px; display: flex; flex-direction: column; }
.qr-page .masthead-inner { max-width: 1240px; width: 100%; flex: 1; display: flex; flex-direction: column; }
.qr-layout { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 64px; align-items: center; }
.qr-layout h1 { font-size: clamp(38px, 5.4vw, 84px); margin-bottom: 16px; }
.qr-meta { display: grid; gap: 4px; margin-top: 22px; color: var(--teal-200); font-size: 17px; }
.qr-meta b { color: #fff; font-weight: 500; }
.qr-steps { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; color: #fff; }
.qr-steps li { display: flex; gap: 12px; align-items: baseline; }
.qr-steps span { font-family: var(--display); color: var(--lime); font-size: 14px; letter-spacing: .1em; }
.qr-card { background: #fff; padding: 22px; border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); text-align: center; }
.qr-card svg { display: block; width: min(360px, 70vw); height: auto; }
.qr-url { margin-top: 12px; font-size: 13px; color: #1d4c57; word-break: break-all; max-width: min(360px, 70vw); }
.qr-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
@media (max-width: 760px) {
    .qr-layout { grid-template-columns: 1fr; gap: 28px; text-align: center; }
    .qr-card { justify-self: center; }
    .qr-steps { justify-items: center; }
    .qr-actions { justify-content: center; }
}
@media print {
    .qr-actions, .masthead-bar .link-btn { display: none !important; }
    .qr-page .masthead { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
