/* Hallmark · component-scope refinement · genre: modern-minimal · theme: Accu-Chek CI (acGreen primary, acGreen→acBlue brand gradient)
 * states: default · hover · focus · active · disabled · loading · error · success
 * motion: press 90ms · state 180ms · enter 320ms · one curve (expo ease-out), no overshoot · reduced-motion → opacity only
 * pre-emit critique: P4 H4 E5 S4 R5 V4
 */
/* ===================================================================
   Accu-Chek Reward — Phase 2 design system
   Loaded AFTER main.css / util.css so it can override without editing them.
   =================================================================== */

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/poppins/Poppins-Regular.ttf') format('truetype');
}
@font-face {
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/poppins/Poppins-Italic.ttf') format('truetype');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/poppins/Poppins-Medium.ttf') format('truetype');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/poppins/Poppins-SemiBold.ttf') format('truetype');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/poppins/Poppins-Bold.ttf') format('truetype');
}

/* Noto Sans Thai — self-hosted variable font, one file per Unicode subset.
   font-weight is declared as a range because the source file is a variable font. */
@font-face {
    font-family: 'Noto Sans Thai';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/noto-sans-thai/NotoSansThai-thai.woff2') format('woff2');
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
    font-family: 'Noto Sans Thai';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/noto-sans-thai/NotoSansThai-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Noto Sans Thai';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/noto-sans-thai/NotoSansThai-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
    --ac-font-ui: 'Poppins', 'Noto Sans Thai', sans-serif;
    /* Accu-Chek CI palette ("Collection of brand compliant colors") — names match the brand sheet.
       Use the semantic tokens further down in components; reach for these only when a component
       needs a specific brand shade. */
    --acBlue: #26BECF;       --acGreen: #8EB927;      --acWhite: #FFFFFF;     --acBlack: #2A2A2A;
    --acYellow: #FFC800;     --acOrange: #FF8819;     --acRed: #FF584E;       --acPurple: #A183D4;   --acAzure: #41A6FF;

    --acBlueText: #0B393E;   --acBlueNight: #156771;  --acBlueShade: #1A818D; --acBlueDark: #1E98A6;
    --acBlue20: #51CBD9;     --acBlueTint: #93DFE7;   --acBlue70: #BEECF1;    --acBlue85: #DEF5F8;
    --acBlue90: #E9F9FA;     --acBlue95: #F4FCFD;

    --acGreenText: #2B380C;  --acGreenNight: #556F17; --acGreenShade: #617E1A; --acGreenDark: #72941F;
    --acGreen20: #A5C752;    --acGreenTint: #C7DC93;  --acGreen70: #DDEABE;    --acGreen85: #EEF5DF;
    --acGreen90: #F4F8E9;    --acGreen95: #F9FCF4;

    --acGreyNight: #5C5C5C;  --acGreyShade: #737373;  --acGreyDark: #8F8F8F;   --acGrey: #A3A3A3;
    --acGrey20: #B5B5B5;     --acGreyTint: #D1D1D1;   --acGrey70: #E3E3E3;     --acGrey85: #F1F1F1;
    --acGrey90: #F6F6F6;     --acGreyLight: #FAFAFA;

    /* Gap-fill tones (NOT on the CI sheet) — derived with the sheet's own recipe:
       tints = 10/15/30% colour on white, darks = 60/30% colour on black (same ratios as acGreen/acBlue).
       The CI only publishes full scales for blue/green/grey; accents needed readable text + soft tints. */
    --acOrange90: #FFF3E8; --acOrange85: #FFEDDC; --acOrange70: #FFDBBA; --acOrangeNight: #99520F; --acOrangeText: #4C2908;
    --acRed90: #FFEEED;    --acRed85: #FFE6E4;    --acRed70: #FFCDCA;    --acRedShade: #AD3C35;    --acRedNight: #99352F;
    --acYellow90: #FFFAE6; --acYellow85: #FFF7D9; --acYellow70: #FFEEB2; --acYellowText: #4C3C00;
    --acPurple90: #F6F3FB; --acPurple85: #F1ECF9; --acPurpleNight: #614F7F;
    --acAzure90: #ECF6FF;  --acAzure85: #E2F2FF;  --acAzureNight: #276499;

    /* ---- Semantic tokens: acGreen is the main theme colour ----
       acGreen #8EB927 is only 2.3:1 against white, so the primary role is split:
         fill     → acGreen itself, with acGreenText on top (5.5:1) — lime buttons, dark-green labels
         text     → acGreenNight on white (5.7:1) — links, active nav label, "Reward" wordmark
         gradient → the Accu-Chek brand signature: acGreen → acBlue, the two primary brand colours,
                    exactly as on the brand's icon circles (green bottom-left, blue top-right) and the
                    rule under the logo (green left, blue right). Text on it is acBlueText — ~5.5:1 on
                    both ends (white would be ~2.2:1, fine for big icons but not for card text).
       acBlue is the secondary brand colour (redeem, info); orange/red are status accents. */
    --ac-primary: var(--acGreen);            /* fills, borders, rings, progress */
    --ac-on-primary: #fff;                   /* text/icons ON a primary fill — white by brand preference (2.3:1 on acGreen; hover darkens to acGreenDark 3.5:1) */
    --ac-primary-text: var(--acGreenNight);  /* primary-coloured text/links on white */
    --ac-primary-deep: var(--acGreenNight);  /* text on primary tints, pressed/hover text */
    --ac-primary-tint: var(--acGreen90);     /* active pill / chip / hover backgrounds */
    --ac-primary-soft: var(--acGreen85);
    --ac-gradient-brand: linear-gradient(45deg, var(--acGreen) 0%, var(--acBlue) 100%);   /* surfaces, circles */
    --ac-gradient-brand-h: linear-gradient(90deg, var(--acGreen) 0%, var(--acBlue) 100%); /* rules, bars */
    --ac-on-gradient: var(--acBlueText);     /* "printed" text on the brand gradient — 5.3:1 worst case */
    --ac-veil-rgb: 11, 57, 62;               /* acBlueText as r,g,b — tint of the meter readout window */
    --ac-accent: var(--acGreen);
    --ac-accent-rgb: 142, 185, 39;           /* acGreen as r,g,b — focus rings, stripes */

    --ac-secondary: var(--acBlueShade);      /* 4.6:1 on white */
    --ac-secondary-deep: var(--acBlueNight);
    --ac-secondary-tint: var(--acBlue90);

    --ac-ink: var(--acBlack);
    --ac-muted: var(--acGreyShade);          /* 4.7:1 on white */
    --ac-bg: var(--acGrey90);
    --ac-surface: var(--acWhite);
    --ac-line: var(--acGrey70);

    --ac-success: var(--acGreenNight);       /* points earned, "complete" */
    --ac-success-tint: var(--acGreen85);
    --ac-success-accent: var(--acGreen);
    --ac-warn: var(--acOrange);              /* borders / dots */
    --ac-warn-tint: var(--acOrange90);
    --ac-warn-text: var(--acOrangeNight);    /* 5.4:1 on its tint */
    --ac-danger: var(--acRedShade);          /* error text, danger fills — 6.0:1 with white */
    --ac-danger-tint: var(--acRed90);
    --ac-danger-accent: var(--acRed);

    --ac-radius-card: 16px;
    --ac-radius-input: 12px;
    --ac-radius-pill: 999px;
    --ac-shadow: 0 1px 3px rgba(42, 42, 42, .06), 0 8px 24px rgba(42, 42, 42, .05);
    --ac-shadow-lg: 0 4px 10px rgba(42, 42, 42, .08), 0 16px 40px rgba(42, 42, 42, .10);

    --ac-gap: 24px;
    --ac-content-max: 1080px;
    --ac-header-h: 72px;

    /* motion — one critically-damped-feel curve (no overshoot) for all UI state;
       press feedback is faster than release so the response reads as instant */
    --ac-ease-out: cubic-bezier(0.16, 1, 0.3, 1);     /* entering / settling */
    --ac-ease-in: cubic-bezier(0.7, 0, 0.84, 0);       /* leaving */
    --ac-dur-press: 90ms;
    --ac-dur-fast: 180ms;
    --ac-dur-base: 320ms;
    --ac-focus-ring: var(--ac-primary-text);   /* 5.6:1 on white — #8EB927 alone is only 2.3:1 */

    /* social brand colors */
    --ac-line-brand: #06C755;
    --ac-fb-brand: #1877F2;
}

/* ---------- Base ---------- */
/* Override legacy main.css text aliases; keep icon fonts and coupon monospace intact. */
.ac2, .ac2 #cookieConsent, .ac2 p, .ac2 a, .ac2 input, .ac2 select, .ac2 textarea, .ac2 button,
.ac2 .txt1, .ac2 .txt2, .ac2 .totalPoint, .ac2 .login100-form-title,
.ac2 .label-input100, .ac2 .input100, .ac2 .login100-form-btn,
.ac2 .alert-validate::before {
    font-family: var(--ac-font-ui);
}
.ac2 .totalPoint, .ac2 .login100-form-title { font-weight: 700; }
.ac2 .input100, .ac2 .login100-form-btn { font-weight: 500; }

.ac2 {
    color: var(--ac-ink);
    background: var(--ac-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ac2 * { box-sizing: border-box; }

.ac2 a { color: var(--ac-primary-text); text-decoration: none; }
.ac2 a:hover { text-decoration: underline; }

.ac2-container {
    /* explicit width (not just max-width) — .ac2 (body) is a flex column
       (see foot.php's sticky-footer fix), and without a definite width a
       flex-item block can end up sized to its content's current natural
       width instead of stretching to fill, causing the whole column
       (filter pills included) to visibly jiggle narrower/wider as child
       content (e.g. a filtered table) changes width. */
    width: 100%;
    max-width: var(--ac-content-max);
    margin: 0 auto;
    padding: 0 var(--ac-gap);
    box-sizing: border-box;
}

.ac2-card {
    background: var(--ac-surface);
    border-radius: var(--ac-radius-card);
    box-shadow: var(--ac-shadow);
    border: 1px solid var(--ac-line);
}

.ac2-pill {
    border-radius: var(--ac-radius-pill);
    display: inline-flex;
    align-items: center;
}

.ac2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--ac-radius-pill);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: filter var(--ac-dur-fast) var(--ac-ease-out), background-color var(--ac-dur-fast) var(--ac-ease-out), transform var(--ac-dur-fast) var(--ac-ease-out);
    min-height: 44px;
    line-height: 1.2;
}
.ac2-btn:hover { text-decoration: none; filter: brightness(0.97); }
.ac2-btn:active { filter: brightness(0.92); }
/* `.ac2 a` / `.ac2 a:hover` above set link color + hover-underline for plain text links.
   A button-styled <a> (any .ac2-btn*) must never inherit that — the `a.` prefix here
   matches its specificity so these always win, regardless of rule order. */
a.ac2-btn, a.ac2-btn:hover { text-decoration: none; }

.ac2-btn-primary {
    background: var(--ac-primary);
    color: var(--ac-on-primary);
}
.ac2-btn-primary:hover,
a.ac2-btn-primary,
a.ac2-btn-primary:hover { color: var(--ac-on-primary); }

.ac2-btn-outline {
    background: var(--ac-surface);
    color: var(--ac-ink);
    border-color: var(--ac-line);
}
.ac2-btn-outline:hover,
a.ac2-btn-outline,
a.ac2-btn-outline:hover { color: var(--ac-ink); }

.ac2-btn-ghost {
    background: transparent;
    color: var(--ac-primary-text);
    padding: 8px 12px;
}

.ac2-btn-danger {
    background: var(--ac-danger);
    color: #fff;
}
a.ac2-btn-danger, a.ac2-btn-danger:hover { color: #fff; }

.ac2-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Read-only account info (e.g. username) — deliberately NOT styled like an
   input (no white fill, no border, no text cursor) so it reads as a fact
   being displayed, not a field the user could try to edit. */
.ac2-static-value {
    min-height: 44px; display: flex; align-items: center;
    padding: 10px 14px; border-radius: var(--ac-radius-input);
    background: var(--ac-bg); color: var(--ac-ink); font-size: 15px;
}

.ac2-field { margin-bottom: 18px; }
.ac2-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}
.ac2-field .ac2-req { color: var(--ac-danger); margin-left: 2px; }
.ac2-field input[type="text"],
.ac2-field input[type="tel"],
.ac2-field input[type="email"],
.ac2-field input[type="password"],
.ac2-field input[type="date"],
.ac2-field select,
.ac2-field textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--ac-line);
    border-radius: var(--ac-radius-input);
    padding: 10px 14px;
    font-size: 15px;
    background: var(--ac-surface);
    color: var(--ac-ink);
}
.ac2-field input:focus,
.ac2-field select:focus,
.ac2-field textarea:focus {
    outline: none;
    border-color: var(--ac-primary);
    box-shadow: 0 0 0 3px rgba(var(--ac-accent-rgb), .15);
}
.ac2-field .ac2-hint { font-size: 12px; color: var(--ac-muted); margin-top: 4px; }
.ac2-field .ac2-error { font-size: 12px; color: var(--ac-danger); margin-top: 4px; display: none; }
.ac2-field.has-error input,
.ac2-field.has-error select { border-color: var(--ac-danger); }
.ac2-field.has-error .ac2-error { display: block; }

/* ---------------------------------------------------------------------
   Custom checkbox — hides the native box, keeps the real <input> in the
   DOM (for form submission, :checked state and screen readers) and
   draws a theme-matched box + checkmark on top of it.
--------------------------------------------------------------------- */
.ac2-checkbox { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.ac2-checkbox input[type="checkbox"] {
    position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: pointer;
}
.ac2-checkbox-box {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--ac-line);
    background: var(--ac-surface); position: relative; margin-top: 1px;
    transition: background-color var(--ac-dur-fast) var(--ac-ease-out), border-color var(--ac-dur-fast) var(--ac-ease-out);
}
.ac2-checkbox-box::after {
    content: ''; position: absolute; left: 5px; top: 1px; width: 6px; height: 10px;
    border: solid var(--ac-on-primary); border-width: 0 2px 2px 0;
    /* rotate is what turns the L into a ✓ — keep it in every transform state */
    opacity: 0; transform: rotate(45deg) scale(.6); transition: opacity var(--ac-dur-fast) var(--ac-ease-out), transform var(--ac-dur-fast) var(--ac-ease-out);
}
.ac2-checkbox input[type="checkbox"]:checked + .ac2-checkbox-box {
    background: var(--ac-primary); border-color: var(--ac-primary);
}
.ac2-checkbox input[type="checkbox"]:checked + .ac2-checkbox-box::after { opacity: 1; transform: rotate(45deg) scale(1); }
.ac2-checkbox input[type="checkbox"]:focus-visible + .ac2-checkbox-box {
    box-shadow: 0 0 0 3px rgba(var(--ac-accent-rgb), .25);
}
.ac2-checkbox-label { font-size: 14px; }

/* ---------------------------------------------------------------------
   Custom select — js/custom-form.js enhances a native <select> into this
   markup. The native <select> stays in the DOM (display:none) as the
   single source of truth for .value / change events, so every existing
   call site keeps working unmodified.
--------------------------------------------------------------------- */
.ac2-xselect { position: relative; }
.ac2-xselect select { display: none !important; }
.ac2-xselect-trigger {
    width: 100%; min-height: 44px; border: 1px solid var(--ac-line); border-radius: var(--ac-radius-input);
    padding: 10px 14px; font-size: 15px; background: var(--ac-surface); color: var(--ac-ink);
    display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left;
}
.ac2-xselect-trigger.is-placeholder { color: var(--ac-muted); }
.ac2-xselect-trigger .ac2-xselect-caret {
    width: 10px; height: 10px; border: solid var(--ac-muted); border-width: 0 2px 2px 0;
    transform: rotate(45deg); flex-shrink: 0; transition: transform var(--ac-dur-fast) var(--ac-ease-out); margin-top: -3px;
}
.ac2-xselect.is-open .ac2-xselect-trigger { border-color: var(--ac-primary); box-shadow: 0 0 0 3px rgba(var(--ac-accent-rgb), .15); }
.ac2-xselect.is-open .ac2-xselect-caret { transform: rotate(-135deg); margin-top: 3px; }
.ac2-xselect-panel {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
    background: var(--ac-surface); border: 1px solid var(--ac-line); border-radius: var(--ac-radius-input);
    box-shadow: var(--ac-shadow-lg); max-height: 240px; overflow-y: auto; padding: 6px;
}
.ac2-xselect.is-open .ac2-xselect-panel { display: block; }
.ac2-xselect-option {
    padding: 9px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--ac-ink);
}
.ac2-xselect-option:hover, .ac2-xselect-option.is-active { background: var(--ac-primary-tint); color: var(--ac-primary-deep); }
.ac2-xselect-option.is-selected { font-weight: 600; }
.ac2-xselect-search {
    width: 100%; box-sizing: border-box; border: 1px solid var(--ac-line); border-radius: 8px;
    padding: 8px 10px; font-size: 14px; margin-bottom: 6px; color: var(--ac-ink);
}
.ac2-xselect-search:focus { outline: none; border-color: var(--ac-primary); }
.ac2-xselect-options { max-height: 200px; overflow-y: auto; }
/* the search box must stay put — only the option list beneath it scrolls */
.ac2-xselect-searchable .ac2-xselect-panel { max-height: none; overflow: visible; }

/* ---------------------------------------------------------------------
   Custom date picker — js/custom-form.js enhances a native
   <input type="date"> into this markup, same source-of-truth pattern.
--------------------------------------------------------------------- */
.ac2-xdate { position: relative; }
.ac2-xdate input[type="date"] { display: none !important; }
.ac2-xdate-trigger {
    width: 100%; min-height: 44px; border: 1px solid var(--ac-line); border-radius: var(--ac-radius-input);
    padding: 10px 14px; font-size: 15px; background: var(--ac-surface); color: var(--ac-ink);
    display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left;
}
.ac2-xdate-trigger.is-placeholder { color: var(--ac-muted); }
.ac2-xdate-trigger .ac2-xdate-icon { flex-shrink: 0; color: var(--ac-muted); font-size: 15px; }
.ac2-xdate.is-open .ac2-xdate-trigger { border-color: var(--ac-primary); box-shadow: 0 0 0 3px rgba(var(--ac-accent-rgb), .15); }
.ac2-xdate-panel {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; width: 280px;
    background: var(--ac-surface); border: 1px solid var(--ac-line); border-radius: var(--ac-radius-card);
    box-shadow: var(--ac-shadow-lg); padding: 12px;
}
.ac2-xdate.is-open .ac2-xdate-panel { display: block; }
.ac2-xdate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ac2-xdate-head-label { font-weight: 700; font-size: 14px; }
.ac2-xdate-head-label.is-clickable { cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.ac2-xdate-head-label.is-clickable:hover { background: var(--ac-bg); }
.ac2-xdate-nav {
    width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent;
    cursor: pointer; color: var(--ac-ink); font-size: 14px;
}
.ac2-xdate-nav:hover { background: var(--ac-bg); }
.ac2-xdate-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ac2-xdate-dow { font-size: 11px; color: var(--ac-muted); text-align: center; padding: 4px 0; font-weight: 600; }
.ac2-xdate-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px;
    font-size: 13px; cursor: pointer; border: none; background: transparent; color: var(--ac-ink);
}
.ac2-xdate-day:hover { background: var(--ac-primary-tint); }
.ac2-xdate-day.is-muted { color: var(--ac-line); }
.ac2-xdate-day.is-selected { background: var(--ac-primary); color: var(--ac-on-primary); font-weight: 700; }
.ac2-xdate-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1px var(--ac-primary); }

/* month/year drill-down grids (birth-date-friendly navigation) */
.ac2-xdate-grid-months, .ac2-xdate-grid-years { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ac2-xdate-cell {
    padding: 12px 4px; border-radius: 8px; font-size: 13px; cursor: pointer;
    border: none; background: transparent; color: var(--ac-ink); text-align: center;
}
.ac2-xdate-cell:hover { background: var(--ac-primary-tint); }
.ac2-xdate-cell.is-selected { background: var(--ac-primary); color: var(--ac-on-primary); font-weight: 700; }
.ac2-xdate-cell.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1px var(--ac-primary); }

.ac2-xdate-foot { display: flex; justify-content: space-between; margin-top: 10px; }
.ac2-xdate-foot button { background: none; border: none; color: var(--ac-primary-text); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px; }

/* chips */
.ac2-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--ac-radius-pill);
    font-size: 12px;
    font-weight: 600;
}
/* Data-driven sections: a section built from API data starts hidden with
   .ac2-no-data and is revealed only once the API returns something to show.
   No placeholder art, zero-filled tiles or empty headings. */
.ac2-no-data { display: none !important; }

/* announcement card — cover image, title, short description. Shared by the
   homepage preview and the full feed (views/announcements.php). */
.ac2-section-head { display: flex; align-items: baseline; justify-content: space-between; }
.ac2-section-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.ac2-announcement-card {
    background: var(--ac-surface); border: 1px solid var(--ac-line); border-radius: var(--ac-radius-card);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform var(--ac-dur-fast) var(--ac-ease-out), box-shadow var(--ac-dur-fast) var(--ac-ease-out);
}
/* `a.` matters — see a.ac2-action-card for why a class-only hover override
   loses to .ac2 a:hover's own element-selector specificity otherwise.
   One signal on hover: the card lifts (translate + the shadow that implies it). */
a.ac2-announcement-card:hover { text-decoration: none; box-shadow: var(--ac-shadow); transform: translateY(-2px); }
a.ac2-announcement-card:active { transform: scale(.985); box-shadow: none; transition-duration: var(--ac-dur-press); }
.ac2-announcement-thumb { height: 120px; background-size: cover; background-position: center; background-color: var(--ac-line); }
.ac2-announcement-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.ac2-announcement-title { font-size: 14px; font-weight: 700; color: var(--ac-ink); margin: 0; }
.ac2-announcement-meta {
    font-size: 12px; color: var(--ac-muted); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.ac2-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--ac-radius-pill);
    background: var(--ac-primary-tint);
    color: var(--ac-primary-deep);
    font-size: 13px;
    font-weight: 500;
}
.ac2-filter-chip .remove { cursor: pointer; font-weight: 700; }

/* scrollbar-safe responsive containers */
.ac2-scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* SweetAlert success-icon checkmark: the bundled library's own default geometry
   leaves the two strokes' joint ~11.5px apart (measured, not a guess) — nudging
   the short "tip" stroke to close that gap. Pre-existing library quirk, unrelated
   to Phase 2 styles; fixed here since phase2.css loads on every page that uses it.
   The resting-state rule alone isn't enough: the library's own @keyframes drives
   the stroke through its OWN uncorrected path during the 0.75s draw-in, so the
   two strokes visibly cross before "popping" to the corrected resting position.
   Redeclaring the keyframes (last declaration with the same name wins) with every
   frame shifted by the same delta keeps the original flourish but re-targets it
   at the corrected joint, so there's no crossing and no pop at the end. */
.swal-icon--success__line--tip { top: 45.78px; left: 9.04px; }
@keyframes animateSuccessTip {
    0%, 54% { width: 0px; left: -3.96px; top: 19.78px; }
    70% { width: 50px; left: -12.96px; top: 37.78px; }
    84% { width: 17px; left: 16.04px; top: 48.78px; }
    100% { width: 25px; left: 9.04px; top: 45.78px; }
}

/* The long stroke meets the tip at a joint — both must shift by the same
   amount or the two strokes visibly separate. Long uses right-based
   positioning (distance from the icon's right edge), so shifting it right
   means DEcreasing `right`, the mirror of increasing tip's `left` above. */
.swal-icon--success__line--long { top: 38px; right: 5px; }
@keyframes animateSuccessLong {
    0%, 65% { width: 0px; right: 43px; top: 54px; }
    84% { width: 55px; right: -3px; top: 35px; }
    100% { width: 47px; right: 5px; top: 38px; }
}

/* SweetAlert's default .swal-title padding (13px 16px) leaves the modal
   feeling cramped at the bottom on the very common no-button, timer-only
   dialogs used across the site (save success, login success, etc.) — there's
   no .swal-footer in that case to add its own breathing room below the text.
   The library itself ships `.swal-title:not(:first-child){padding-bottom:0}`
   (title isn't first-child — the icon comes before it), which has higher
   specificity than a plain `.swal-title` override and silently wins,
   zeroing the padding back out — so this must target that exact selector too. */
.swal-title,
.swal-title:not(:first-child) {
    padding-bottom: 26px;
}

/* SweetAlert → Accu-Chek theme. Selectors mirror the library's own (it injects its CSS at the
   top of <head>, so equal specificity + later source order wins). */
.swal-button { background-color: var(--ac-primary); color: var(--ac-on-primary); border-radius: var(--ac-radius-pill); padding: 10px 24px; }
.swal-button:not([disabled]):hover { background-color: var(--acGreenDark); }
.swal-button:active { background-color: var(--acGreenDark); }
.swal-button:focus { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ac-focus-ring); }
.swal-button--cancel { background-color: var(--acGrey85); color: var(--ac-ink); }
.swal-button--cancel:not([disabled]):hover { background-color: var(--acGrey70); }
.swal-button--cancel:active { background-color: var(--acGreyTint); }
.swal-button--danger { background-color: var(--ac-danger); color: #fff; }
.swal-button--danger:not([disabled]):hover { background-color: var(--acRedNight); }
.swal-icon--success__line { background-color: var(--ac-primary); }
.swal-icon--success__ring { border-color: rgba(var(--ac-accent-rgb), .25); }
.swal-icon--warning { border-color: var(--acOrange); }
.swal-icon--warning__body, .swal-icon--warning__dot { background-color: var(--acOrange); }
.swal-icon--error { border-color: var(--acRed); }
.swal-icon--error__line { background-color: var(--acRed); }

@media (max-width: 767px) {
    .ac2-container { padding: 0 16px; }
    :root { --ac-gap: 16px; }
}

/* ==========================================================================
   Legacy page shell — upload.php / redeem.php / friends.php / profile.php
   These pages still use the old Colorlib "login100" markup and main.css
   button classes (purple #db41fb, grey #aab3ab, green #38b349). Re-skinned
   here with theme tokens; page JS keeps its element ids and API calls.
   ========================================================================== */
.ac2 .limiter { flex-shrink: 0; width: 100%; }
.ac2 .container-login100 { padding: 24px 16px 48px; }
.ac2 .wrap-login100 {
    width: 560px; max-width: 100%;
    background: var(--ac-surface); border: 1px solid var(--ac-line);
    border-radius: var(--ac-radius-card); box-shadow: var(--ac-shadow);
    padding-top: 32px; color: var(--ac-ink);
}
/* the old logo + purple/blue rule duplicates the top nav brand */
.ac2 .container-title-dashboard { display: none; }
.ac2 .wrap-login100 p { color: var(--ac-ink); }
.ac2 .wrap-login100 a { color: var(--ac-primary-text); cursor: pointer; }

.ac2-legacy-title { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 0 0 16px; text-align: left; width: 100%; letter-spacing: -0.01em; }
.ac2-legacy-subtitle { font-size: 15px; font-weight: 700; margin: 24px 0 12px; width: 100%; }
.ac2-legacy-balance {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
    border-radius: var(--ac-radius-card); padding: 12px 12px 12px 20px; margin-bottom: 20px;
}
.ac2-legacy-balance > span { font-size: 13px; font-weight: 700; }
.ac2-legacy-balance .ac2-readout strong { font-size: 24px; line-height: 1.1; }
.ac2-legacy-actions { display: flex; justify-content: center; margin-top: 16px; }
.ac2-link-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; font-weight: 600; margin-top: 16px; }

/* ---- buttons (main.css classes) ---- */
.ac2 .backButton, .ac2 .copyButton, .ac2 .goto, .ac2 .getStartButton, .ac2 .upload-btn-wrapper .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid var(--ac-line); border-radius: var(--ac-radius-pill);
    background: var(--ac-surface); color: var(--ac-ink);
    font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.ac2 .backButton { width: auto; min-width: 140px; min-height: 44px; padding: 10px 24px; font-size: 15px; }
.ac2 .copyButton { width: auto; min-width: 0; min-height: 32px; padding: 4px 14px; font-size: 13px; }
.ac2 .backButton:hover, .ac2 .copyButton:hover { background: var(--ac-primary-tint); border-color: var(--ac-primary); }
/* the one confirming action per screen is the lime fill */
.ac2 .backButton.is-primary, .ac2 .goto, .ac2 .getStartButton, .ac2 .upload-btn-wrapper .btn {
    background: var(--ac-primary); color: var(--ac-on-primary); border-color: var(--ac-primary);
}
.ac2 .backButton.is-primary { min-width: 200px; }
.ac2 .goto { width: auto; min-width: 200px; min-height: 44px; padding: 10px 24px; font-size: 15px; }
.ac2 .backButton.is-primary:hover, .ac2 .goto:hover, .ac2 .getStartButton:hover,
.ac2 .upload-btn-wrapper:hover .btn { background: var(--acGreenDark); border-color: var(--acGreenDark); }
.ac2 .getStartButton { font-size: 18px; font-weight: 700; width: auto; min-width: 200px; min-height: 48px; padding: 10px 28px; margin: 0; }

/* ---- earn (upload.php) ---- */
.ac2-earn-intro {
    display: flex; align-items: center; gap: 12px; width: 100%;
    background: var(--ac-bg); border-radius: var(--ac-radius-card); padding: 16px 12px; margin-bottom: 24px;
}
.ac2-earn-icon { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; }
.ac2-steps { margin: 0; padding: 0; list-style: none; counter-reset: ac2-step; display: grid; gap: 8px; min-width: 0; }
.ac2-steps li { counter-increment: ac2-step; display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.45; color: var(--ac-ink); }
.ac2-steps li::before {
    content: counter(ac2-step); flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; transform: translateY(-1px);
    background: var(--ac-primary); color: var(--ac-on-primary); font-size: 12px; font-weight: 700;
}
.ac2 .upload-btn-wrapper { border-radius: var(--ac-radius-pill); }
.ac2 .upload-btn-wrapper .btn { min-height: 52px; padding: 12px 32px; font-size: 17px; font-weight: 700; }
.ac2 .upload-btn-wrapper input[type=file] { cursor: pointer; width: 100%; height: 100%; }
.ac2-scan-result { width: 100%; margin: 0 0 20px; display: grid; gap: 1px; background: var(--ac-line); border: 1px solid var(--ac-line); border-radius: var(--ac-radius-card); overflow: hidden; }
.ac2-scan-result > div { background: var(--ac-surface); padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.ac2-scan-result dt { font-size: 13px; font-weight: 600; color: var(--ac-muted); }
.ac2-scan-result dd { margin: 0; font-size: 16px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.ac2-scan-result .ac2-scan-points { font-size: 28px; color: var(--ac-primary-text); font-variant-numeric: tabular-nums; }

/* loading spinner + text (was #fcf pink / #0b97c4 blue) */
.ac2 .lds-roller div:after { background: var(--ac-primary); }
.ac2 #textLoading { color: var(--ac-primary-text); font-weight: 600; }

/* ---- redeem.php — reward cards (radio semantics; .selectRedeem added by page JS) ---- */
.ac2-reward-list { display: grid; gap: 10px; width: 100%; }
.ac2 .r-image {
    display: flex; align-items: center; gap: 16px; margin: 0; padding: 12px 16px 12px 12px; cursor: pointer;
    border: 1px solid var(--ac-line); border-radius: var(--ac-radius-card); background: var(--ac-surface);
    -webkit-tap-highlight-color: transparent;
}
.ac2 .r-image:hover { border-color: var(--acGreen70); }
.ac2 .r-image img { width: 76px; height: 76px; object-fit: contain; border-radius: 12px; background: var(--ac-bg); flex-shrink: 0; }
.ac2-reward-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ac2-reward-name { font-size: 14px; font-weight: 600; color: var(--ac-ink); overflow-wrap: anywhere; }
.ac2 .r-image .p-image { margin: 0 !important; font-size: 20px; font-weight: 700; color: var(--ac-primary-text); font-variant-numeric: tabular-nums; }
.ac2 .r-image .p-image span { font-size: 13px; font-weight: 600; }
.ac2-reward-short { font-size: 12px; font-weight: 600; color: var(--ac-warn-text); }
.ac2 .r-image.is-short img { opacity: .6; }
.ac2-reward-radio {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid var(--ac-line); background: var(--ac-surface); position: relative;
}
.ac2-reward-radio::after {
    content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--ac-primary);
    transform: scale(0); opacity: 0;
}
.ac2 .r-image.selectRedeem {
    border-color: var(--ac-primary); background: var(--ac-primary-tint);
    box-shadow: 0 0 0 1px var(--ac-primary);
}
.ac2 .r-image.selectRedeem .ac2-reward-radio { border-color: var(--ac-primary); }
.ac2 .r-image.selectRedeem .ac2-reward-radio::after { transform: scale(1); opacity: 1; }

/* legal notice (ad licence + terms + warnings must stay visible) */
.ac2-legal {
    margin-top: 28px; padding: 16px 18px; border-radius: var(--ac-radius-card);
    background: var(--ac-bg); width: 100%;
}
.ac2-legal h3 { font-size: 13px; font-weight: 700; margin: 0 0 8px; color: var(--ac-ink); }
.ac2 .ac2-legal p { font-size: 12px; line-height: 1.6; color: var(--ac-muted); margin: 0 0 4px; }
.ac2-legal br { display: block; content: ''; margin-top: 8px; }

/* redeem success */
.ac2-success-img { width: 100%; border-radius: 12px; margin-bottom: 20px; }
.ac2 .ac2-success-label { font-size: 14px; font-weight: 600; color: var(--ac-muted); margin: 0 0 10px; }
.ac2-code-box {
    display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
    border: 1.5px dashed var(--acGreen70); background: var(--ac-primary-tint);
    border-radius: 14px; padding: 10px 10px 10px 18px;
}
.ac2-code-box > span {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 24px; font-weight: 700;
    letter-spacing: .08em; color: var(--ac-primary-deep); overflow-wrap: anywhere; min-width: 0;
}
.ac2 #couponCode { font-size: 30px; }
.ac2 .ac2-success-hint { font-size: 13px; color: var(--ac-muted); margin: 14px 0 0; text-align: center; }

/* ---- friends.php ---- */
.ac2-ref-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.ac2-ref-stat { border: 1px solid var(--ac-line); border-radius: var(--ac-radius-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.ac2-ref-stat strong { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--ac-primary-text); font-variant-numeric: tabular-nums; }
.ac2-ref-stat span { font-size: 12px; font-weight: 600; color: var(--ac-muted); }
.ac2-ref-share { text-align: center; margin-top: 20px; padding: 20px 16px; border-radius: var(--ac-radius-card); background: var(--ac-bg); width: 100%; }
.ac2 .ac2-ref-share-label { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.ac2 .ac2-ref-share-hint { font-size: 13px; color: var(--ac-muted); margin: 12px 0 0; }
.ac2 .ac2-ref-share-hint:empty { display: none; }
.ac2 #transactionTable { margin: 0; }
.ac2 .table-bordered, .ac2 .table-bordered td, .ac2 .table-bordered th { border-color: var(--ac-line); }
.ac2 #transactionTable .btn {
    background: var(--ac-bg); color: var(--ac-ink); border: 1px solid var(--ac-line);
    border-radius: 10px; font-weight: 600;
}
.ac2 #transactionTable .btn:hover { background: var(--ac-primary-tint); border-color: var(--ac-primary); }

@media (max-width: 576px) {
    .ac2 .wrap-login100 { padding-top: 24px; }
    .ac2-earn-intro { flex-direction: column; align-items: flex-start; }
    .ac2 .r-image img { width: 64px; height: 64px; }
    .ac2 #couponCode { font-size: 24px; }
}

/* ==========================================================================
   Interaction & motion layer (applies app-wide)
   - Response on press, not release: :active scales down in 90ms.
   - Release eases back on a no-overshoot curve; nothing bounces on UI state.
   - Only transform/opacity/colour animate — never layout.
   - Focus ring shows instantly (never animated) at >= 3:1.
   ========================================================================== */
.ac2-btn, .ac2 .backButton, .ac2 .copyButton, .ac2 .goto, .ac2 .getStartButton,
.ac2 .upload-btn-wrapper .btn, .ac2 .r-image, .ac2-lang-toggle button, .ac2-avatar-btn,
.swal-button, .ac2-reward-radio, .ac2-reward-radio::after {
    transition-property: background-color, border-color, color, box-shadow, filter, transform, opacity;
    transition-duration: var(--ac-dur-fast);
    transition-timing-function: var(--ac-ease-out);
}
.ac2-btn:active, .ac2 .backButton:active, .ac2 .copyButton:active, .ac2 .goto:active,
.ac2 .getStartButton:active, .ac2 .upload-btn-wrapper:active .btn, .ac2-lang-toggle button:active,
.ac2-avatar-btn:active, .swal-button:not([disabled]):active {
    transform: scale(.97); transition-duration: var(--ac-dur-press);
}
.ac2 .r-image:active { transform: scale(.985); transition-duration: var(--ac-dur-press); }

.ac2 a:focus-visible, .ac2 button:focus-visible, .ac2 [role="radio"]:focus-visible,
.ac2 [tabindex]:focus-visible, .ac2 .upload-btn-wrapper:focus-within {
    outline: 2px solid var(--ac-focus-ring); outline-offset: 3px; transition: none;
}
.ac2 .upload-btn-wrapper input[type=file]:focus-visible { outline: none; }

/* state swaps (scan → confirm, redeem → success) arrive, they don't pop */
@keyframes ac2-enter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.ac2-enter { animation: ac2-enter var(--ac-dur-base) var(--ac-ease-out) both; }

@media (prefers-reduced-motion: reduce) {
    .ac2 *, .ac2 *::before, .ac2 *::after { transition-duration: 120ms !important; }
    .ac2-btn:active, .ac2 .backButton:active, .ac2 .copyButton:active, .ac2 .goto:active,
    .ac2 .getStartButton:active, .ac2 .upload-btn-wrapper:active .btn, .ac2-lang-toggle button:active,
    .ac2-avatar-btn:active, .ac2 .r-image:active, a.ac2-action-card:active { transform: none; }
    .ac2-enter { animation: ac2-fade 150ms linear both; }
    a.ac2-action-card:hover { transform: none; }
}
@keyframes ac2-fade { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   Refinement layer — Hallmark audit fixes
   ========================================================================== */

/* numbers that sit in columns or update in place never jitter */
.ac2-points-pill, .ac2-balance-value, .ac2-history-points, .ac2-history-balance strong,
.ac2-legacy-balance strong, .ac2-ref-stat strong { font-variant-numeric: tabular-nums; }

/* copy buttons confirm in place (silent success) instead of opening a modal */
.ac2 .is-copied, .ac2 .is-copied:hover {
    background: var(--ac-primary); border-color: var(--ac-primary); color: var(--ac-on-primary);
}
.ac2 .is-copied::before { content: '\2713'; margin-right: 6px; font-weight: 700; }

/* spinners only appear if the wait is real (>150ms) — no flash on fast responses */
.ac2 .lds-roller, .ac2 #textLoading { animation: ac2-fade var(--ac-dur-fast) linear 150ms both; }

/* SweetAlert: replace the library's overshoot "pop" with a calm scale-in */
.swal-overlay { transition: opacity var(--ac-dur-base) var(--ac-ease-out); background-color: rgba(42, 42, 42, .45); }
.swal-overlay--show-modal .swal-modal { animation: ac2-modal-in var(--ac-dur-base) var(--ac-ease-out) both; will-change: transform; }
.swal-modal { border-radius: 20px; box-shadow: var(--ac-shadow-lg); }
@keyframes ac2-modal-in {
    from { opacity: 0; transform: scale(.96) translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .swal-overlay--show-modal .swal-modal { animation: ac2-fade 150ms linear both; }
    .ac2 .lds-roller div { animation-duration: 2.4s; }
}

/* ==========================================================================
   Meter readout — the brand's own "glass"
   Brand-gradient cards read like an Accu-Chek meter: the card body is the
   device (label printed on it in dark teal, 5.3:1), and the reading sits in a
   recessed, backlit display window (white on deep teal glass, >= 5.0:1
   anywhere on the gradient). Recessed, not floating: the inner shadow sits at
   the top and a light lip at the bottom, like a screen set into a housing.
   ========================================================================== */
.ac2-brand-surface {
    background: var(--ac-gradient-brand); color: var(--ac-on-gradient);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .45),          /* moulded top edge */
        inset 0 -1px 0 rgba(11, 57, 62, .12),
        0 14px 28px -16px rgba(38, 190, 207, .75),        /* brand-tinted lift, light UI only */
        0 3px 8px -4px rgba(11, 57, 62, .25);
}
.ac2-readout {
    position: relative; display: inline-flex; align-items: baseline; gap: 8px;
    color: #fff; border-radius: 12px; padding: 8px 16px 9px;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px),  /* LCD rows */
        linear-gradient(180deg, rgba(var(--ac-veil-rgb), .66) 0%, rgba(var(--ac-veil-rgb), .54) 100%);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, .28),              /* recessed */
        inset 0 0 0 1px rgba(255, 255, 255, .10),
        0 1px 0 rgba(255, 255, 255, .42);                /* lip catching light below the window */
    text-shadow: 0 0 12px rgba(255, 255, 255, .22);     /* faint backlight bloom on the digits */
    font-variant-numeric: tabular-nums;
    max-width: 100%;
}
.ac2-readout strong, .ac2-readout .ac2-readout-value { font-weight: 700; letter-spacing: -0.02em; }
.ac2-readout .ac2-readout-unit { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-shadow: none; }

/* the reading "settles" once when the display powers on (dashboard only) */
.ac2-readout.is-settling .ac2-readout-value { animation: ac2-readout-on 700ms var(--ac-ease-out) both; }
@keyframes ac2-readout-on {
    from { opacity: .35; filter: blur(1.5px); }
    to   { opacity: 1; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ac2-readout.is-settling .ac2-readout-value { animation: none; }
}
