/* ============================================================
   SMIRNOFF MINTY JAMUN — shared styles
   Background artwork is 690 x 1500 (aspect ratio 0.46).
   Safe zones measured against that artwork:
     top branding      0%   – 23%   (logo + MINTY JAMUN title)
     center interaction 23% – 67%   (form / scratch / code card)
     bottom product     67% – 100%  (bottles, drinks, Powered by Buyerr)
   ============================================================ */

:root {
    --bg-purple: #b98fd6;
    --deep-purple: #4a1f6b;
    --card-purple: #5c2a86;
    --accent-purple: #7a3fb0;
    --ink: #2c1240;
    --paper: #ffffff;
    --error-red: #d3272c;

    --mint: #8ff0cf;
    --mint-deep: #34b487;
    --jamun: #b3226e;

    --campaign-max-width: 480px;
    --artwork-ratio: 690 / 1500;

    --content-side-padding: clamp(18px, 6vw, 34px);
    /* Height-based (not %) because padding percentages resolve against
       container WIDTH in CSS — using vh/dvh here is what actually keeps
       this aligned with the artwork's top-branding / bottom-product zones. */
    --content-top-space: clamp(150px, 23dvh, 230px);
    --content-bottom-space: clamp(210px, 33dvh, 340px);

    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

/* Any element toggled with the `hidden` attribute must actually hide,
   even if a component class also sets its own `display` value
   (e.g. .modal-overlay / #global-loader use display:flex while open). */
[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg-purple);
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

img {
    -webkit-user-drag: none;
    user-select: none;
}

button, input, select {
    font-family: inherit;
}

/* ---------------- Campaign shell ---------------- */

.campaign-shell {
    position: relative;
    width: 100%;
    max-width: var(--campaign-max-width);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    overflow-x: hidden;
}

/* Fixed to the viewport (not the shell) so it never stretches or gets
   cut off when page content is taller than one screen and scrolls. */
.campaign-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    object-fit: fill;
    object-position: center center;
    z-index: 0;
    pointer-events: none;
}

.campaign-content {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--content-top-space) var(--content-side-padding) var(--content-bottom-space);
}

/* ---------------- Ambient brand particles ----------------
   Cool "minty" bubbles drifting up behind the content — a light
   nod to the flavour (mint + jamun) without competing with the
   background artwork's own branding. */

.ambient-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.ambient-particle {
    position: absolute;
    bottom: -10%;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.9), rgba(143, 240, 207, 0.15));
    opacity: 0;
    animation-name: drift-up;
    animation-timing-function: ease-in;
    animation-iteration-count: infinite;
}

@keyframes drift-up {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    12% { opacity: 0.55; }
    85% { opacity: 0.35; }
    100% { transform: translateY(-115vh) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ambient-layer { display: none; }
}

/* ---------------- Frosted card ---------------- */

.frosted-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 30px rgba(44, 18, 64, 0.25);
    padding: clamp(14px, 4vw, 22px);
    animation: card-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .frosted-card { animation: none; }
}

/* ---------------- Registration form ---------------- */

/* Staggered entrance for each field row */
.field-anim {
    opacity: 0;
    transform: translateY(12px);
    animation: field-slide-in 0.45s cubic-bezier(0.22, 0.9, 0.36, 1) forwards;
    animation-delay: calc(0.08s + var(--field-i, 0) * 0.07s);
}

@keyframes field-slide-in {
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .field-anim { animation: none; opacity: 1; transform: none; }
}

.field-group {
    margin-bottom: 10px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--card-purple);
    margin-bottom: 5px;
    letter-spacing: 0.1px;
}

.field-icon {
    display: inline-flex;
    align-items: center;
    color: var(--accent-purple);
    opacity: 0.75;
    flex-shrink: 0;
}

.field-input,
.field-select {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
    padding: 9px 12px 9px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid #d9c6ea;
    background: var(--paper);
    color: var(--ink);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field-input:focus,
.field-select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(122, 63, 176, 0.14), 0 2px 8px rgba(122, 63, 176, 0.1);
    background: #fdf8ff;
}

.field-input:not(:placeholder-shown):not(:focus):not([aria-invalid="true"]) {
    border-color: var(--mint-deep);
    background: #f6fff9;
}

.field-input[aria-invalid="true"],
.field-select[aria-invalid="true"] {
    border-color: var(--error-red);
    box-shadow: 0 0 0 3px rgba(211, 39, 44, 0.1);
}

.field-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%237a3fb0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

.field-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.field-error {
    min-height: 14px;
    font-size: 11px;
    color: var(--error-red);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Consent checkboxes grouped in a subtle inset block */
.consent-block {
    background: rgba(122, 63, 176, 0.04);
    border: 1px solid rgba(122, 63, 176, 0.1);
    border-radius: var(--radius-sm);
    padding: 5px 8px 3px;
    margin-bottom: 8px;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 3px;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 13px;
    height: 13px;
    min-width: 13px;
    margin-top: 2px;
    accent-color: var(--accent-purple);
    cursor: pointer;
}

.checkbox-row label {
    font-size: 8.5px;
    line-height: 1.3;
    color: var(--ink);
    opacity: 0.8;
    cursor: pointer;
    text-transform: none;
}

.consent-link {
    color: var(--accent-purple);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-primary {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 46px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--deep-purple), var(--card-purple) 55%, var(--jamun));
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.06em;
    cursor: pointer;
    margin-top: 4px;
    box-shadow: 0 8px 18px rgba(74, 31, 107, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, transparent 66%);
    transform: translateX(-120%);
    transition: none;
    pointer-events: none;
}

.btn-primary:not(:disabled):hover::before {
    animation: btn-shimmer 1.1s ease;
}

@keyframes btn-shimmer {
    to { transform: translateX(120%); }
}

.btn-primary:not(:disabled):active {
    transform: scale(0.97);
    box-shadow: 0 4px 10px rgba(74, 31, 107, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    transform: scale(0);
    animation: ripple-out 0.55s ease-out;
    pointer-events: none;
}

@keyframes ripple-out {
    to { transform: scale(2.6); opacity: 0; }
}

.btn-secondary {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 46px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--paper);
    background: rgba(255, 255, 255, 0.08);
    color: var(--paper);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn-secondary:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.2);
}

/* ---------------- Scratch screen ---------------- */

.scratch-screen .campaign-content {
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}

.scratch-heading {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.0;
    color: var(--paper);
    text-shadow:
        0 2px 0 rgba(74, 31, 107, 0.6),
        0 4px 16px rgba(44, 18, 64, 0.55),
        0 0 40px rgba(143, 240, 207, 0.25);
    margin: 0 0 6px;
    letter-spacing: 1px;
    /* drop-in first, then sway continuously */
    animation:
        heading-drop 0.6s cubic-bezier(0.22, 0.9, 0.36, 1) both,
        heading-sway 3.2s ease-in-out 0.7s infinite;
}

@keyframes heading-drop {
    from { opacity: 0; transform: translateY(-14px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

@keyframes heading-sway {
    0%   { transform: translateX(0)      rotate(0deg);    }
    20%  { transform: translateX(-5px)   rotate(-0.8deg); }
    50%  { transform: translateX(5px)    rotate(0.8deg);  }
    80%  { transform: translateX(-4px)   rotate(-0.6deg); }
    100% { transform: translateX(0)      rotate(0deg);    }
}

@media (prefers-reduced-motion: reduce) {
    .scratch-heading { animation: none; }
}

.scratch-subtext {
    font-size: 13.5px;
    color: var(--paper);
    opacity: 0.92;
    margin: 0 0 22px;
}

.scratch-card-wrap {
    position: relative;
    width: min(78vw, 300px);
    margin: 0 auto;
}

.scratch-card-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    border: none;
    box-shadow: 0 16px 40px rgba(44, 18, 64, 0.55), 0 0 0 3px rgba(255,255,255,0.18);
    overflow: hidden;
    background: var(--card-purple);
    touch-action: none;
    animation: frame-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes frame-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: none; }
}

/* Diagonal shimmer sweep across the card border to invite interaction.
   Stops once scratching has actually begun. */
.scratch-card-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.4) 48%, transparent 72%);
    transform: translateX(-130%);
    animation: shimmer-sweep 2.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}

.scratch-card-frame.is-active::after {
    animation: none;
    opacity: 0;
}

@keyframes shimmer-sweep {
    0%, 12% { transform: translateX(-130%); }
    55%, 100% { transform: translateX(130%); }
}

#scratch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: pointer;
    z-index: 2;
}

.scratch-reveal-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #f3e8ff 55%, #e4d0fa 100%);
    pointer-events: none;
    z-index: 1;
}

.reveal-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.reveal-brand-line {
    font-size: clamp(9px, 2.6vw, 11px);
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--accent-purple);
    opacity: 0.8;
    margin: 0;
}

.reveal-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(15px, 5vw, 20px);
    color: var(--deep-purple);
    margin: 0;
    line-height: 1.15;
}

.reveal-winner-badge {
    background: linear-gradient(135deg, var(--deep-purple), var(--accent-purple));
    color: #fff;
    font-weight: 800;
    font-size: clamp(10px, 2.8vw, 12px);
    padding: 4px 14px;
    border-radius: 999px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    box-shadow: 0 3px 10px rgba(74, 31, 107, 0.35);
}

.reveal-body {
    font-size: clamp(11px, 3.2vw, 13px);
    line-height: 1.5;
    color: var(--ink);
    margin: 0;
}

.reveal-body strong {
    color: var(--deep-purple);
    font-weight: 700;
}

.reveal-mint-tag {
    font-size: clamp(9px, 2.5vw, 11px);
    font-weight: 600;
    color: var(--mint-deep);
    letter-spacing: 0.5px;
    margin: 0;
}

.scratch-hint {
    margin: 14px auto 0;
    width: max-content;
    background: rgba(255, 255, 255, 0.9);
    color: var(--deep-purple);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(44, 18, 64, 0.3);
    animation: hint-pulse 1.7s ease-in-out infinite;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scratch-hint.is-hidden {
    opacity: 0;
    transform: translateY(6px);
}

@keyframes hint-pulse {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50% { transform: scale(1.05); opacity: 1; }
}

.sparkle-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    animation: sparkle-fly 0.85s ease-out forwards;
}

@keyframes sparkle-fly {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .scratch-card-frame,
    .scratch-card-frame::after,
    .scratch-hint {
        animation: none;
    }
}

.scratch-processing {
    margin-top: 18px;
    font-size: 13px;
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ---------------- Congratulations ---------------- */

.congrats-frame {
    animation: frame-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both, glow-pulse 2.4s ease-in-out 0.6s infinite;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 16px 34px rgba(44, 18, 64, 0.45), 0 0 0 rgba(143, 240, 207, 0); }
    50% { box-shadow: 0 16px 34px rgba(44, 18, 64, 0.45), 0 0 26px rgba(143, 240, 207, 0.55); }
}

.congrats-card {
    text-align: center;
}

.congrats-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(20px, 6vw, 26px);
    color: var(--deep-purple);
    margin: 0 0 10px;
    animation: text-pop 0.5s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.congrats-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    margin: 0;
    animation: text-pop 0.5s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes text-pop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.congrats-blob {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 46% 54% 60% 40% / 50% 45% 55% 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #f2e6ff);
    box-shadow: 0 6px 18px rgba(74, 31, 107, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pop-in 0.5s ease;
}

@keyframes pop-in {
    0% { transform: scale(0.4); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .congrats-blob,
    .congrats-frame,
    .congrats-title,
    .congrats-body { animation: none; }
    * { scroll-behavior: auto !important; }
}

/* ---------------- Sampler code screen ---------------- */

.sampler-card {
    background: linear-gradient(160deg, var(--deep-purple), var(--card-purple));
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 34px rgba(44, 18, 64, 0.5);
    padding: clamp(18px, 5.5vw, 26px);
    text-align: center;
    color: #fff;
    animation: card-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both, glow-pulse 2.6s ease-in-out 0.7s infinite;
}

.sampler-greeting {
    font-size: clamp(13px, 3.8vw, 15px);
    font-weight: 600;
    letter-spacing: 0.3px;
    margin: 0 0 8px;
    opacity: 0.92;
    animation: greeting-in 0.5s ease both 0.2s;
}

@keyframes greeting-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 0.92; transform: none; }
}

.sampler-divider {
    width: 40px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    margin: 0 auto 12px;
}

.sampler-instruction {
    font-size: clamp(14px, 4.2vw, 16px);
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 12px;
    opacity: 0.97;
}

.sampler-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    opacity: 0.6;
    margin: 0 0 6px;
}

.sampler-code {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(18px, 6vw, 26px);
    letter-spacing: clamp(3px, 1.4vw, 7px);
    word-break: break-word;
    overflow-wrap: anywhere;
    margin: 0 0 14px;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 10px 12px;
}

/* Redeemed status badge */
.sampler-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(52, 180, 135, 0.18);
    border: 1px solid rgba(143, 240, 207, 0.45);
    color: var(--mint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 13px;
    border-radius: 999px;
    margin-bottom: 14px;
    animation: badge-in 0.5s cubic-bezier(0.22, 0.9, 0.36, 1) both 0.3s;
}

@keyframes badge-in {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: none; }
}

/* Detail rows block (participant / city / date / time) */
.sampler-detail-block {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 4px 0 14px;
    text-align: left;
}

.sampler-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sampler-detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sampler-detail-row:first-child {
    padding-top: 0;
}

.sampler-detail-icon {
    display: inline-flex;
    align-items: center;
    color: var(--mint);
    opacity: 0.7;
    flex-shrink: 0;
}

.sampler-detail-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.55;
    min-width: 68px;
    flex-shrink: 0;
}

.sampler-detail-value {
    font-size: 12.5px;
    font-weight: 500;
    opacity: 0.92;
    flex: 1;
    text-align: right;
}

.sampler-clock {
    font-variant-numeric: tabular-nums;
    font-family: var(--font-display);
    letter-spacing: 0.3px;
}

/* Valid today pill */
.sampler-valid-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--mint);
    border: 1px solid rgba(143, 240, 207, 0.35);
    border-radius: 999px;
    padding: 3px 12px;
    margin: 0 0 10px;
    opacity: 0.85;
    animation: pill-glow 2.8s ease-in-out 1s infinite;
}

@keyframes pill-glow {
    0%, 100% { opacity: 0.75; box-shadow: none; }
    50%       { opacity: 1;    box-shadow: 0 0 10px rgba(143,240,207,0.3); }
}

.sampler-note {
    font-size: 11px;
    opacity: 0.65;
    margin: 0;
}

.campaign-notice {
    background: rgba(255, 255, 255, 0.13);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    color: var(--paper);
    font-size: clamp(14px, 4.5vw, 17px);
    font-weight: 500;
    line-height: 1.55;
    text-align: center;
    padding: clamp(20px, 6vw, 30px) clamp(16px, 5vw, 24px);
    margin: 24px auto 0;
    max-width: 340px;
    animation: card-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sampler-code .code-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px) scale(0.7);
    animation: letter-pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes letter-pop {
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sampler-card { animation: none; }
    .sampler-code .code-letter { animation: none; opacity: 1; transform: none; }
    .sampler-greeting { animation: none; opacity: 0.92; }
    .sampler-valid-pill { animation: none; }
}

/* ---------------- Full-screen info pages (blocked/closed/error) ---------------- */

.info-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-purple), var(--deep-purple));
}

.info-card {
    max-width: 420px;
    color: #fff;
}

.info-eyebrow {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 13px;
    text-transform: uppercase;
    opacity: 0.85;
    margin: 0 0 6px;
}

.info-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(20px, 6vw, 26px);
    margin: 0 0 14px;
}

.info-message {
    font-size: 14.5px;
    line-height: 1.6;
    opacity: 0.95;
}

/* ---------------- Loader ---------------- */

#global-loader {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(44, 18, 64, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------------- Offline banner ---------------- */

#offline-banner {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 40;
    background: var(--error-red);
    color: #fff;
    font-size: 12.5px;
    text-align: center;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top));
}

/* ---------------- Error modal ---------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(20, 8, 32, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--deep-purple);
    margin: 0 0 8px;
}

.modal-message {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink);
    margin: 0 0 18px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions button {
    flex: 1;
    min-height: 44px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}

.btn-modal-primary {
    border: none;
    background: var(--deep-purple);
    color: #fff;
}

.btn-modal-secondary {
    border: 1.5px solid var(--card-purple);
    background: #fff;
    color: var(--card-purple);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------------- Small phones ---------------- */

@media (max-width: 359px) {
    :root {
        --content-side-padding: 14px;
    }
    .form-title { font-size: 14px; }
}

/* ---------------- Short-height phones: allow scroll, don't shrink controls ---------------- */

@media (max-height: 620px) {
    :root {
        --content-top-space: clamp(120px, 20dvh, 190px);
        --content-bottom-space: clamp(140px, 20dvh, 220px);
    }
}
