/* ============================================================
   charlie-theme.css  —  Design System "Carta & Oro"
   Mr. Charlie · Coupon System

   Design tokens ora CENTRALIZZATI in _variables.css
   Questo file contiene componenti e reset del design system.
   ============================================================ */
@import url('./_variables.css');

/* ════════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--hub-parchment);
    color: var(--hub-ink);
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ════════════════════════════
   PRELOADER
   ════════════════════════════ */
#preloader {
    position: fixed; inset: 0;
    background: var(--hub-pre-bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    transition: opacity 0.65s ease, visibility 0.65s ease;
}
#preloader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.pre-emblem {
    width: 120px;
    height: 120px;
    position: relative;
    animation: pre-breathe 2.2s ease-in-out infinite;
}
.pre-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.pre-ring {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-top-color: var(--hub-pre-gold);
    animation: pre-spin 1.7s linear infinite;
}

@keyframes pre-breathe {
    0%, 100% { opacity: 0.45; transform: scale(0.96); }
    50%       { opacity: 1;   transform: scale(1); }
}
@keyframes pre-spin { to { transform: rotate(360deg); } }

.pre-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.pre-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.40em;
    text-transform: uppercase;
    color: #4A3520;
}
.pre-bar {
    width: 72px;
    height: 1px;
    background: #241A0E;
    border-radius: 1px;
    overflow: hidden;
}
.pre-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6E4E12, var(--hub-pre-gold));
    animation: pre-load 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes pre-load {
    0%   { width: 0; opacity: 0; }
    6%   {           opacity: 1; }
    100% { width: 100%; }
}

/* ════════════════════════════
   ANIMATIONS (prefisso charlie-)
   ════════════════════════════ */
@keyframes charlie-fadeDown {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes charlie-fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes charlie-badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(138, 94, 26, 0.40); }
    55%       { box-shadow: 0 0 0 7px rgba(138, 94, 26, 0); }
}
@keyframes charlie-shimmerGold {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}
@keyframes charlie-rule-shimmer {
    0%   { background-position: -100% 0; }
    60%  { background-position:  100% 0; }
    100% { background-position:  100% 0; }
}
@keyframes charlie-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes charlie-glow-pulse {
    0%,100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

.fade-in { animation: charlie-fadeIn 0.6s var(--charlie-ease-out) both; }
.fade-up { animation: charlie-fadeUp 0.68s var(--charlie-ease-out) both; }

/* ════════════════════════════════
   HEADER
   ════════════════════════════════ */
.charlie-header {
    animation: charlie-fadeDown 0.72s var(--charlie-ease-out) both;
    animation-delay: 0.05s;
    background: rgba(255, 253, 248, 0.60);
    backdrop-filter: blur(28px) saturate(1.9) brightness(1.04);
    -webkit-backdrop-filter: blur(28px) saturate(1.9) brightness(1.04);
    padding: env(safe-area-inset-top, 0px) 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255,253,248,0.80) inset,
                0 4px 20px rgba(24,17,10,0.06);
}
.charlie-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--hub-gold-line) 15%,
        var(--hub-gold) 50%,
        var(--hub-gold-line) 85%,
        transparent 100%);
    opacity: 0.75;
}
.charlie-header.scrolled {
    background: rgba(255, 253, 248, 0.82);
    box-shadow: 0 1px 0 rgba(255,253,248,0.90) inset,
                0 8px 32px rgba(24,17,10,0.10);
}

.charlie-header-inner {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 24px 18px;
}

.charlie-header-toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.charlie-header-logo {
    height: 48px;
    display: block;
    animation: logo-glow-pulse 4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    transform-origin: center;
}

@keyframes logo-glow-pulse {
    0%, 100% {
        filter: brightness(0) opacity(0.75);
    }
    50% {
        filter: brightness(0) opacity(1)
                drop-shadow(0 0 4px rgba(212, 175, 100, 0.6))
                drop-shadow(0 0 10px rgba(212, 175, 100, 0.3));
    }
}
.charlie-header-location {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.charlie-header-location-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 0.94rem;
    color: var(--hub-ink-2);
    white-space: nowrap;
}
.charlie-header-since {
    font-size: 0.72rem;  /* Era 0.66rem - migliorata leggibilità */
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hub-gold);
}

.charlie-header-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.charlie-header-rule-line {
    flex: 1;
    height: 1px;
    background: var(--hub-gold-line);
}
.charlie-header-rule-diamond {
    width: 4px; height: 4px;
    border: 1px solid var(--hub-gold-vl);
    transform: rotate(45deg);
    flex-shrink: 0;
}
.charlie-header-eyebrow {
    font-size: 0.72rem;  /* Era 0.66rem - migliorata leggibilità */
    font-weight: 700;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    color: var(--hub-gold);
    text-align: center;
}

/* ════════════════════════════
   MAIN CONTAINER
   ════════════════════════════ */
.charlie-main {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ════════════════════════════
   CARD
   ════════════════════════════ */
.card-parchment {
    background: var(--hub-white);
    border: 1px solid var(--hub-border-rule);
    border-radius: 16px;  /* Era 4px - più morbido */
    box-shadow: 0 2px 16px rgba(24,17,10,0.06);
}
.card-header {
    padding: 28px 28px 20px;
    border-bottom: 1px solid var(--hub-border);
}
.card-body {
    padding: 28px;
}
.card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.60rem;
    font-weight: 700;
    color: var(--hub-ink);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 6px;
}
.card-subtitle {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.02rem;
    color: var(--hub-ink-3);
    line-height: 1.5;
}
.card-eyebrow {
    font-size: 0.72rem;  /* Era 0.62rem - migliorata leggibilità */
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--hub-gold);
    margin-bottom: 10px;
}

/* ════════════════════════════
   FORM ELEMENTS
   ════════════════════════════ */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label {
    font-size: 0.80rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--hub-ink-2);
    margin-bottom: 2px;
}
.form-label .required {
    color: var(--hub-gold);
    margin-left: 3px;
    font-weight: 700;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--hub-border-rule);
    border-radius: 10px;
    background: var(--hub-parchment);
    color: var(--hub-ink);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.22s, box-shadow 0.22s, background 0.22s, transform 0.15s;
    -webkit-appearance: none;
    appearance: none;
    min-height: 50px;
    box-shadow: inset 0 1px 2px rgba(24, 17, 10, 0.04);
}
.form-input::placeholder { color: var(--hub-ink-4); }
.form-input:hover {
    border-color: var(--hub-gold-line);
    background: rgba(255, 253, 248, 0.6);
}
.form-input:focus {
    outline: none;
    border-color: var(--hub-gold);
    background: var(--hub-white);
    box-shadow: 0 0 0 3px rgba(138, 94, 26, 0.15), inset 0 1px 2px rgba(24, 17, 10, 0.02);
    transform: translateY(-1px);
}

.form-hint {
    font-size: 0.78rem;  /* Era 0.75rem */
    color: var(--hub-ink-3);  /* Era ink-4 - migliorato contrasto */
    line-height: 1.45;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 1px;
    border: 1.5px solid var(--hub-border-rule);
    border-radius: 5px;
    background: var(--hub-parchment);
    accent-color: var(--hub-gold);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.form-check input[type="checkbox"]:hover {
    border-color: var(--hub-gold-vl);
    transform: scale(1.05);
}
.form-check input[type="checkbox"]:checked {
    background: var(--hub-gold);
    border-color: var(--hub-gold);
}
.form-check-label {
    font-size: 0.88rem;
    color: var(--hub-ink-2);
    line-height: 1.55;
}
.form-check-label a {
    color: var(--hub-gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Divider */
.form-divider {
    height: 1px;
    background: var(--hub-gold-line);
    margin: 4px 0;
}

/* ════════════════════════════
   BUTTONS
   ════════════════════════════ */
.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(180deg, var(--hub-gold-l) 0%, var(--hub-gold) 100%);
    color: var(--hub-white);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.80rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s var(--charlie-ease-out), box-shadow 0.2s var(--charlie-ease-out);
    will-change: transform;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 54px;
    box-shadow: 0 2px 8px rgba(138, 94, 26, 0.25), 0 1px 2px rgba(138, 94, 26, 0.15);
}
.btn-gold:hover {
    background: linear-gradient(180deg, var(--hub-gold) 0%, #7A5015 100%);
    box-shadow: 0 4px 12px rgba(138, 94, 26, 0.35), 0 2px 4px rgba(138, 94, 26, 0.20);
    transform: translateY(-1px);
}
.btn-gold:active { transform: translateY(0) scale(0.985); box-shadow: 0 1px 4px rgba(138, 94, 26, 0.20); }
.btn-gold:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    color: var(--hub-ink-3);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    border: 1px solid var(--hub-border-rule);
    border-radius: 10px;  /* Era 3px - più morbido */
    cursor: pointer;
    text-decoration: none;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
    touch-action: manipulation;
    min-height: 44px;
}
.btn-ghost:hover {
    color: var(--hub-ink);
    border-color: var(--hub-gold-line);
    background: rgba(138,94,26,0.04);
}

/* ════════════════════════════
   BADGE
   ════════════════════════════ */
.badge-gold {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.70rem;  /* Era 0.62rem - migliorata leggibilità */
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--charlie-white);
    background: var(--charlie-gold);
    padding: 5px 11px;
    border-radius: 6px;  /* Era 2px - leggermente più morbido */
    animation: charlie-badgePulse 2.4s ease-in-out infinite;
}
.badge-success {
    background: var(--charlie-success);
    color: var(--charlie-white);
    animation: none;
}
.badge-neutral {
    background: var(--charlie-ink);
    color: var(--charlie-white);
    animation: none;
}

/* ════════════════════════════
   SECTION DIVIDER
   ════════════════════════════ */
.section-rule {
    height: 1px;
    background: var(--hub-border-rule);
    margin: 28px 0;
}
.section-rule-gold {
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--hub-gold-line) 15%,
        var(--hub-gold) 50%,
        var(--hub-gold-line) 85%,
        transparent 100%);
    margin: 0;
}

/* ════════════════════════════
   FOOTER
   ════════════════════════════ */
.charlie-footer {
    width: 100%;
    background: var(--hub-white);
    padding: 0 0 calc(40px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
}
.charlie-footer-inner {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
}
.charlie-footer-top-rule {
    height: 1px;
    border-radius: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(196,147,74,0.35) 15%,
        rgba(255,224,138,0.75) 45%,
        rgba(255,240,170,0.90) 50%,
        rgba(255,224,138,0.75) 55%,
        rgba(196,147,74,0.35) 85%,
        transparent 100%
    );
    background-size: 200% 100%;
    background-position: -100% 0;
    animation: charlie-rule-shimmer 3.5s ease-in-out infinite;
    margin-bottom: 20px;
}
.charlie-footer-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.charlie-footer-logo {
    height: 44px;
    filter: brightness(0);
    opacity: 0.20;
}
.charlie-footer-tagline {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 0.86rem;
    color: var(--hub-ink-3);
}
.charlie-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid var(--hub-border-rule);
}
.charlie-footer-col { padding: 14px 0; }
.charlie-footer-col:first-child {
    padding-right: 16px;
    border-right: 1px solid var(--hub-border-rule);
}
.charlie-footer-col:last-child { padding-left: 16px; }
.charlie-footer-col-label {
    font-size: 0.72rem;  /* Era 0.65rem - migliorata leggibilità */
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hub-gold);
    margin-bottom: 8px;
}
.charlie-footer-link {
    display: block;
    font-size: 0.82rem;
    color: var(--hub-ink-3);
    text-decoration: none;
    padding: 3px 0;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.charlie-footer-link:hover { color: var(--hub-ink); }
.charlie-footer-addr {
    font-size: 0.82rem;
    font-style: normal;
    color: var(--hub-ink-3);
    line-height: 1.5;
}
.charlie-footer-social {
    border-top: 1px solid var(--hub-border-rule);
    padding: 10px 0 2px;
    display: flex;
    gap: 0;
    align-items: center;
    flex-wrap: wrap;
}
.charlie-footer-soc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    text-decoration: none;
    opacity: 0.70;
    transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.charlie-footer-soc:hover  { opacity: 1; transform: scale(1.12); }
.charlie-footer-soc:active { opacity: 1; transform: scale(0.90); }
.charlie-footer-soc i {
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--hub-gold-vl) 0%, var(--hub-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}
.charlie-footer-colophon {
    border-top: 1px solid var(--hub-border-rule);
    margin-top: 10px;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.charlie-footer-copy {
    font-size: 0.75rem;  /* Era 0.72rem */
    color: var(--hub-ink-3);  /* Era ink-4 - migliorato contrasto */
    letter-spacing: 0.02em;
    line-height: 1.45;
}
.charlie-footer-dev {
    font-size: 0.75rem;  /* Era 0.72rem */
    color: var(--hub-ink-3);  /* Era ink-4 - migliorato contrasto */
    letter-spacing: 0.04em;
}
.charlie-footer-dev strong { color: var(--hub-gold-l); font-weight: 600; }

/* ════════════════════════════
   TOAST
   ════════════════════════════ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 8000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
}

/* ════════════════════════════
   HERO CAROUSEL
   ════════════════════════════ */
.hero-wrap {
    width: 100%;
    background: var(--hub-ink);
    overflow: hidden;
    aspect-ratio: 16/9;
    position: relative;
}
@media (min-width: 640px) {
    .hero-wrap { aspect-ratio: 21/9; }
}

/* ═══ HERO OVERLAY EFFECTS ═══ */

/* Gradient Overlay */
.hero-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(138, 94, 26, 0.15) 0%,
        transparent 50%,
        rgba(24, 17, 10, 0.3) 100%
    );
    z-index: 10;
    pointer-events: none;
}

/* Scanlines Effect */
.hero-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    z-index: 11;
    pointer-events: none;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Glitch Container */
.hero-glitch {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Glitch Animation on Images */
.hero-glitch img {
    animation: hero-subtle-shift 20s ease-in-out infinite;
}

@keyframes hero-subtle-shift {
    0%, 100% { filter: brightness(1) saturate(1); }
    25% { filter: brightness(1.02) saturate(1.05); }
    50% { filter: brightness(0.98) saturate(0.95); }
    75% { filter: brightness(1.03) saturate(1.02); }
}

/* Glitch Hover Effect */
.hero-wrap:hover .hero-glitch img {
    animation: hero-glitch-intense 0.3s steps(2) infinite;
}

@keyframes hero-glitch-intense {
    0% { 
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    20% { 
        transform: translate(-2px, 1px);
        filter: hue-rotate(-5deg);
    }
    40% { 
        transform: translate(2px, -1px);
        filter: hue-rotate(5deg);
    }
    60% { 
        transform: translate(-1px, 2px);
        filter: hue-rotate(-3deg);
    }
    80% { 
        transform: translate(1px, -2px);
        filter: hue-rotate(3deg);
    }
    100% { 
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
}

/* RGB Split Effect Overlay */
.hero-rgb-split {
    position: absolute;
    inset: 0;
    z-index: 12;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-wrap:hover .hero-rgb-split {
    opacity: 0.15;
    animation: rgb-shift 0.5s steps(3) infinite;
}

@keyframes rgb-shift {
    0% { 
        box-shadow: 
            inset -3px 0 0 rgba(255, 0, 0, 0.5),
            inset 3px 0 0 rgba(0, 255, 255, 0.5);
    }
    33% { 
        box-shadow: 
            inset 2px 0 0 rgba(255, 0, 0, 0.5),
            inset -2px 0 0 rgba(0, 255, 255, 0.5);
    }
    66% { 
        box-shadow: 
            inset -1px 0 0 rgba(255, 0, 0, 0.5),
            inset 1px 0 0 rgba(0, 255, 255, 0.5);
    }
    100% { 
        box-shadow: 
            inset 3px 0 0 rgba(255, 0, 0, 0.5),
            inset -3px 0 0 rgba(0, 255, 255, 0.5);
    }
}

/* Vignette Effect */
.hero-vignette {
    position: absolute;
    inset: 0;
    z-index: 13;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 50%,
        rgba(24, 17, 10, 0.4) 100%
    );
}

/* Shimmer/Shine Effect */
.hero-shimmer {
    position: absolute;
    inset: 0;
    z-index: 14;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 253, 248, 0.08) 45%,
        rgba(255, 253, 248, 0.15) 50%,
        rgba(255, 253, 248, 0.08) 55%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Noise Texture Overlay */
.hero-noise {
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    animation: noise-shift 0.5s steps(5) infinite;
}

@keyframes noise-shift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1%, 1%); }
    50% { transform: translate(1%, -1%); }
    75% { transform: translate(-1%, -1%); }
    100% { transform: translate(1%, 1%); }
}

/* Pulsing Gold Border */
.hero-wrap {
    border-bottom: 2px solid transparent;
    background-clip: padding-box;
}

.hero-wrap.with-border {
    border-image: linear-gradient(
        90deg,
        transparent 0%,
        var(--hub-gold) 20%,
        var(--hub-gold-light) 50%,
        var(--hub-gold) 80%,
        transparent 100%
    ) 1;
    animation: border-pulse 3s ease-in-out infinite;
}

@keyframes border-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ════════════════════════════
   MAGIC LINK SECTION
   ════════════════════════════ */
.magic-link-section {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--hub-gold-line);
}
.magic-link-eyebrow {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--hub-gold);
    margin-bottom: 6px;
}
.magic-link-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.10rem;
    font-weight: 700;
    color: var(--hub-ink);
    margin-bottom: 4px;
}
.magic-link-desc {
    font-size: 0.84rem;
    color: var(--hub-ink-3);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* ════════════════════════════
   EVENT SELECTOR CARDS
   ════════════════════════════ */
.event-selector {
    margin-bottom: 24px;
    padding-bottom: 8px;
}
.event-selector .grid {
    gap: 16px;
}

/* Card base styling */
.event-selector .rounded-2xl {
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(24, 17, 10, 0.08);
    transition: transform 0.22s var(--charlie-ease-out), box-shadow 0.22s var(--charlie-ease-out);
    will-change: transform;
}
.event-selector .rounded-2xl:hover {
    box-shadow: 0 6px 20px rgba(24, 17, 10, 0.12);
    transform: translateY(-2px) scale(1.01);
}

/* Override Tailwind colors per coerenza tema */
.event-selector [class*="ring-purple"] {
    --tw-ring-color: var(--charlie-gold) !important;
}
.event-selector [class*="border-purple"] {
    border-color: var(--charlie-gold) !important;
}
.event-selector [class*="hover:border-purple"] {
    border-color: var(--charlie-gold-vl) !important;
}
.event-selector [class*="bg-purple"] {
    background-color: var(--charlie-gold) !important;
}
.event-selector [class*="from-purple"],
.event-selector [class*="to-blue"] {
    --tw-gradient-from: var(--charlie-gold-vl) !important;
    --tw-gradient-to: var(--charlie-gold) !important;
}

/* Card content styling */
.event-selector .p-4.bg-white {
    background: var(--charlie-white) !important;
    border-top: 1px solid var(--charlie-border);
    padding: 16px 18px;
    border-radius: 0 0 14px 14px;
}
.event-selector .p-4.bg-white h3 {
    color: var(--charlie-ink);
    font-size: 1.02rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.event-selector .p-4.bg-white p {
    color: var(--charlie-ink-3);
    font-size: 0.82rem;
}
.event-selector .p-4.bg-white svg {
    color: var(--charlie-gold-vl);
}

/* Badge APERTO verde */
.event-selector .bg-emerald-500 {
    background: var(--charlie-success) !important;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    padding: 5px 10px;
    border-radius: 6px;
}

/* Seleziona label */
.event-selector > div:first-of-type label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--charlie-ink-2);
}
.event-selector > div:first-of-type p {
    font-size: 0.82rem;
    color: var(--charlie-ink-3);
}

/* Empty state */
.event-selector .bg-gray-100 {
    background: var(--charlie-parchment) !important;
    border: 1px dashed var(--charlie-border-rule);
    border-radius: 12px;
}

/* ════════════════════════════
   SUCCESS / RESPONSE STATES
   ════════════════════════════ */
.response-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.response-icon--success {
    background: rgba(138, 94, 26, 0.10);
    border: 1px solid var(--hub-gold-line);
}
.response-icon--error {
    background: rgba(180, 40, 30, 0.08);
    border: 1px solid rgba(180, 40, 30, 0.18);
}

/* ════════════════════════════
   RESPONSIVE (Mobile-First)
   ════════════════════════════ */

/* BASE: Mobile (< 481px) */
.form-row { grid-template-columns: 1fr; }
.charlie-main { padding: 24px 16px 60px; }
.card-body { padding: 20px; }
.card-header { padding: 20px 20px 16px; }
.charlie-header-inner { padding: 16px 16px 14px; }
.charlie-footer-grid { grid-template-columns: 1fr; }
.charlie-footer-col:first-child {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--hub-border-rule);
}
.charlie-footer-col:last-child { padding-left: 0; }

/* sm: Tablet e superiori */
@media (min-width: 481px) {
    .form-row { grid-template-columns: 1fr 1fr; }
    .charlie-main { padding: 32px 24px 60px; }
    .card-body { padding: 28px; }
    .card-header { padding: 28px 28px 20px; }
    .charlie-header-inner { padding: 20px 24px 18px; }
    .charlie-footer-grid { grid-template-columns: 1fr 1fr; }
    .charlie-footer-col:first-child {
        padding-right: 16px;
        border-right: 1px solid var(--hub-border-rule);
        border-bottom: none;
    }
    .charlie-footer-col:last-child { padding-left: 16px; }
}
