/* Authentication, token modal, welcome flow and local-storage banner. Generated from the legacy stylesheet; keep source order. */
/* Auth Screen */
#auth-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 20px;
    text-align: center;
    position: relative; /* per canvas in background */
    overflow: hidden;
    background: #fff;
}

/* Canvas animazione fili rossi */
#auth-threads {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: #fff;
}

/* Mantieni i contenuti sopra al canvas */
#auth-waves-root {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

#auth-screen .app-logo,
#auth-screen #auth-forms {
    position: relative;
    z-index: 2;
}

#auth-screen #auth-forms {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.app-logo {
    text-align: center;
    margin-bottom: 30px;

}

.app-logo i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.app-logo h1 {
    font-size: 3.2rem !important;
    color: var(--primary-color);
    font-weight: 400;
    font-synthesis: none;
    margin-bottom: 10px;
    font-family: 'Lobster', 'Lobester', cursive;
    margin-top: -20px;
    animation: draw 100s linear forwards;


}

.app-description {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 20px;
    animation: draw 200s linear forwards;
    margin-bottom: auto;

}

.logo-image {
    font-size: 3.5rem;
    height: auto;
    margin-bottom: 5px;
    animation: draw 100s linear forwards;

}

#auth-screen .app-logo .logo-image--quizienza {
    width: 85px;
    height: 85px;
    object-fit: contain;
}

.auth-form {
    background: var(--surface-card);
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-card-soft), 0 1px 0 var(--button-gloss-strong) inset;
    transform-style: preserve-3d;
    transition: transform .2s ease, box-shadow .2s ease;
    backdrop-filter: saturate(1.1);
    margin-bottom: 0px;
}

#auth-screen .auth-form:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-strong), 0 1px 0 var(--button-gloss-max) inset;
}

.auth-form h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

#auth-screen .form-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background: linear-gradient(180deg, #ffffff, #f7f8fb);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.05), 0 1px 0 var(--button-gloss-strong);
}

#auth-screen .form-group input:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 4px rgba(128, 36, 51, 0.12), inset 0 2px 6px rgba(0,0,0,0.05);
}

.checkbox-group {
    display: grid;
    grid-template-columns: auto max-content;
    align-items: center;
    column-gap: 8px;
    justify-content: center;
}

#auth-screen .reg-terms-label {
    color: inherit;
    font-weight: inherit;
}

#auth-screen .reg-terms-label a,
#auth-screen .reg-terms-label a:visited {
    color: #8b1d2c;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

#auth-screen .reg-terms-label a:hover {
    color: #a12536;
}

/* Interruttore 3D per Ricordami */
#auth-screen .checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    margin: 0;
    position: relative;
    border-radius: 999px;
    background: linear-gradient(180deg, #eef0f4, #dadde4);
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08), 0 1px 0 var(--button-gloss-max);
    transition: all .22s ease;
}
#auth-screen .checkbox-group input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 1.5px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: transform .22s ease;
}
#auth-screen .checkbox-group input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    border-color: rgba(128,36,51,0.45);
}
#auth-screen .checkbox-group input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}
#auth-screen .checkbox-group label {
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 500;
}

#auth-screen .auth-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: 1px solid rgba(128,36,51,0.4);
    padding: 12px;
    width: 100%;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(128,36,51,0.25), inset 0 1px 0 var(--button-gloss);
}

/* Conservato nel markup e nel flusso checkout, ma nascosto nell'interfaccia. */
#auth-screen .buy-token-btn {
    display: none;
}

#auth-screen .auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(128,36,51,0.28), inset 0 1px 0 var(--button-gloss-strong);
}

#auth-screen .auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(128,36,51,0.22), inset 0 1px 0 var(--button-gloss);
}

#auth-screen #guest-trial-btn {
    width: 100%;
    min-height: 48px;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Social + Chi Siamo nella schermata di accesso */
.auth-form .auth-meta { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(0,0,0,0.06); }
.auth-form .auth-meta-phrase {
    color: var(--text-light);
    font-size: .95rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    text-align: center;
}
.auth-form .auth-meta-phrase .auth-meta-instagram {
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
}
.auth-form .auth-meta-phrase .auth-meta-instagram:hover,
.auth-form .auth-meta-phrase .auth-meta-instagram:focus,
.auth-form .auth-meta-phrase .auth-meta-instagram:visited {
    text-decoration: none;
}
.auth-form .auth-meta-actions { display:flex; align-items:center; justify-content:center; gap: 12px; }

#auth-screen .auth-form .instagram-icon { font-size: 34px; color: #bdb9bb; transition: color .2s ease, transform .2s ease; }
#auth-screen .auth-form .instagram-icon:hover { color: var(--primary-color); transform: translateY(-2px); }

#auth-screen .auth-form .chi-siamo-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #6d2a36, #4b1c25);
    color: #fff; padding: 8px 12px; border-radius: 999px; text-decoration: none;
    border: 1px solid rgba(128,36,51,0.45);
    box-shadow: 0 8px 16px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.25);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    font-weight: 600; font-size: .85rem;
}
#auth-screen .auth-form .chi-siamo-btn:hover { transform: translateY(-2px); background: linear-gradient(135deg, #802433, #5c1a26); }
#auth-screen .auth-form .chi-siamo-btn:active { transform: translateY(0); }


/* Token modal: usa la palette primaria per l'accesso protetto */
.token-modal__body {
  display: grid;
  gap: 10px;
}

.token-modal__label {
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.01em;
}

.token-modal__input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(128, 36, 51, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-dark);
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 var(--button-gloss), 0 12px 24px rgba(6, 16, 37, 0.06);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.token-modal__input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(128, 36, 51, 0.12), 0 10px 24px rgba(128, 36, 51, 0.18);
  background: #fff;
}

.token-modal__hint {
  margin: 0;
  color: rgba(6, 16, 37, 0.7);
  font-size: 0.95rem;
}

.token-modal__error {
  margin: 0;
  color: var(--danger-color);
  font-weight: 700;
  display: none;
}

.token-modal__error.is-visible {
  display: block;
}

.token-modal__status {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--primary-dark);
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7f7;
  border: 1px solid rgba(128, 36, 51, 0.12);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
  margin-top: 4px;
}

.token-modal__status.is-visible {
  display: inline-flex;
}

.token-modal__status[data-type="loading"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(128, 36, 51, 0.3);
  border-top-color: var(--primary-color);
  animation: token-spin .8s linear infinite;
}

.token-modal__status[data-type="success"] {
  color: var(--success-color);
}


.token-modal__status[data-type="success"]::before {
  content: "\2713";
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(39, 174, 96, 0.14);
  color: var(--success-color);
  border: 1px solid rgba(39, 174, 96, 0.32);
  animation: none;
  transform: translateY(-1px);
}


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

body.dark-mode .token-modal__label {
  color: var(--dark-text-primary);
}

body.dark-mode .token-modal__input {
  background: rgba(16, 16, 19, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--dark-text-primary);
}

body.dark-mode .token-modal__input:focus {
  box-shadow: 0 0 0 4px rgba(128, 36, 51, 0.3), 0 12px 30px rgba(0,0,0,0.55);
}

body.dark-mode .token-modal__hint {
  color: rgba(255, 255, 255, 0.75);
}

body.dark-mode .token-modal__status {
  color: var(--dark-text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
}

body.dark-mode .token-modal__status[data-type="success"] {
  color: #5cd38d;
  background: rgba(92, 211, 141, 0.12);
  border-color: rgba(92, 211, 141, 0.3);
}

body.dark-mode .token-modal__status[data-type="success"]::before {
  background: rgba(92, 211, 141, 0.18);
  color: #5cd38d;
  border-color: rgba(92, 211, 141, 0.4);
}


/* Sfondo scuro per la schermata di autenticazione */
body.dark-mode #auth-screen {
    background: linear-gradient(180deg, #0f0f10 0%, #0b0b0c 100%);
}

/* Canvas/threads su sfondo scuro: trasparente per far vedere il gradiente */
body.dark-mode #auth-threads {
    background: transparent;
}

/* Mantieni il logo/titolo rosa anche in dark sul login */
body.dark-mode #auth-screen .app-logo h1 {
    color: var(--primary-color);
}

/* Switch Ricordami coerente con dark */
body.dark-mode #auth-screen .checkbox-group input[type="checkbox"] {
    background: linear-gradient(180deg, #2a2a2a, #1e1e1e);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.1);
}

/* Card del login piÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¹ scura, con bordo e glow morbido */
body.dark-mode #auth-screen .auth-form {
    background: linear-gradient(180deg, rgba(18,18,18,.98), rgba(10,10,10,.96));
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 24px 48px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.12) inset;
}

/* Input scuri come nello screen */
body.dark-mode #auth-screen .form-group input {
    background: #141216;
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08), transparent 45%),
                      radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.04), transparent 40%),
                      linear-gradient(180deg, #19191b, #0f0f11);
    color: #f6f6f8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.08), 0 20px 30px rgba(0, 0, 0, 0.6);
}
body.dark-mode #auth-screen .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.65);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
body.dark-mode #auth-screen .form-group input:focus {
    background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.14), transparent 45%),
                      radial-gradient(circle at 75% 10%, rgba(255, 255, 255, 0.08), transparent 40%),
                      linear-gradient(180deg, #1d1c1f, #141216);
    border-color: rgba(199, 123, 133, 0.8);
    box-shadow: 0 0 0 2px rgba(199, 123, 133, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 20px 40px rgba(0, 0, 0, 0.65);
}

/* Label e testo secondario chiari */
body.dark-mode #auth-screen label,
body.dark-mode #auth-screen .auth-switch,
body.dark-mode #auth-screen .auth-form .auth-meta-phrase {
    color: #d2d2d6;
}

body.dark-mode #auth-screen .reg-terms-label a,
body.dark-mode #auth-screen .reg-terms-label a:visited {
    color: #8b1d2c;
}

body.dark-mode #auth-screen .reg-terms-label a:hover {
    color: #a12536;
}

/* Bottone Accedi con glow come screenshot */
body.dark-mode #auth-screen .auth-btn {
    background: linear-gradient(135deg, #a93a46, #7a202c);
    box-shadow: 0 16px 30px rgba(128,36,51,.45), inset 0 1px 0 rgba(255,255,255,.25);
}
body.dark-mode #auth-screen .auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(128,36,51,.50), inset 0 1px 0 rgba(255,255,255,.35);
}

/* Link e pulsante Chi Siamo coerenti */
body.dark-mode #auth-screen .auth-switch a { color: var(--dark-primary); }
body.dark-mode #auth-screen .auth-form .chi-siamo-btn {
    background: linear-gradient(135deg, #6d2a36, #4b1c25);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 10px 22px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.18);
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.welcome-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    padding: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

.welcome-logo.is-launching {
    opacity: 0.35;
    transform: scale(0.9);
    filter: drop-shadow(0 0 12px rgba(128,36,51,0.35));
}

.welcome-owl-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 12050;
    pointer-events: none;
    background:
        radial-gradient(85% 85% at 50% 50%, rgba(255,255,255,0.4), rgba(255,255,255,0) 70%),
        rgba(0,0,0,0.25);
}

.welcome-owl-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 60% at 50% 30%, rgba(128,36,51,0.08), transparent 65%);
    pointer-events: none;
}

.welcome-owl-stage {
    position: relative;
    width: min(520px, 92vw);
    height: min(520px, 86vh);
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-owl-big {
    --owl-offset-x: 0px;
    --owl-offset-y: 0px;
    --owl-start-scale: 0.9;
    --owl-pop-scale: 1.36;
    --owl-flight-return-scale: 1.24;
    --owl-hold-scale: 1.18;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    max-width: 90vw;
    height: auto;
    transform: translate(calc(-50% + var(--owl-offset-x)), calc(-50% + var(--owl-offset-y))) scale(var(--owl-start-scale));
    filter: drop-shadow(0 28px 48px rgba(0,0,0,0.18));
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.welcome-owl-big.is-flight {
    animation: welcomeOwlFullscreen 2.2s ease-in-out forwards;
}

.welcome-owl-big.is-holding {
    animation: welcomeOwlHold 2.8s ease forwards;
}

.welcome-owl-big.is-fading {
    animation: welcomeOwlReturn 0.62s ease forwards;
}

.welcome-owl-big::after {
    content: '';
    position: absolute;
    width: 42px;
    height: 18px;
    background: linear-gradient(180deg, rgba(128,36,51,0.95), rgba(92,26,38,0.95));
    border-radius: 50%;
    top: 46%;
    left: 68%;
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0.18) rotate(-6deg);
    transform-origin: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.welcome-owl-big.is-flight::after {
    animation: welcomeOwlBigWink 1.5s ease-in-out 0.18s forwards;
}

@keyframes welcomeOwlFullscreen {
    0% {
        opacity: 0;
        transform: translate(calc(-50% + var(--owl-offset-x)), calc(-50% + var(--owl-offset-y))) scale(var(--owl-start-scale)) rotate(0deg);
    }
    14% {
        opacity: 1;
        transform: translate(calc(-50% + var(--owl-offset-x)), calc(-50% + var(--owl-offset-y))) scale(var(--owl-pop-scale)) rotate(-5deg);
    }
    36% {
        transform: translate(-50%, -50%) scale(3.4) rotate(3deg);
    }
    56% {
        transform: translate(-50%, -50%) scale(3.8) rotate(-1deg);
    }
    78% {
        transform: translate(-50%, -50%) scale(var(--owl-flight-return-scale)) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(var(--owl-flight-return-scale)) rotate(0deg);
    }
}

@keyframes welcomeOwlHold {
    0% {
        opacity: 1;
        transform: translate(-50%, -56%) scale(var(--owl-hold-scale));
    }
    24% {
        transform: translate(-50%, -57%) scale(calc(var(--owl-hold-scale) * 1.04));
    }
    68% {
        transform: translate(-50%, -55%) scale(var(--owl-hold-scale));
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -55%) scale(calc(var(--owl-hold-scale) * 0.98));
    }
}

@keyframes welcomeOwlReturn {
    0% {
        opacity: 1;
        transform: translate(-50%, -55%) scale(calc(var(--owl-hold-scale) * 0.98));
    }
    36% {
        opacity: 0.94;
        transform: translate(-50%, -54%) scale(calc(var(--owl-hold-scale) * 0.84));
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -55%) scale(calc(var(--owl-hold-scale) * 0.7));
    }
}

@keyframes welcomeOwlBigWink {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scaleY(0.18) rotate(-6deg);
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -50%) scaleY(1.1) rotate(-5deg);
    }
    52% {
        opacity: 1;
        transform: translate(-50%, -50%) scaleY(0.26) rotate(-3deg);
    }
    78% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scaleY(0.62) rotate(-4deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scaleY(0.08) rotate(-2deg);
    }
}

.welcome-eyebrow {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.4px;
    color: #ffe6ed;
    opacity: 0.9;
}

.welcome-section {
    display: grid;
    gap: 4px;
}

.welcome-section ul {
    margin: 4px 0 0;
    padding-left: 16px;
    line-height: 1.4;
}

.welcome-section ul li {
    margin-bottom: 4px;
}

.welcome-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.welcome-mobile-nav {
    display: none;
}

.welcome-footer-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-weight: 600;
}

@media (max-width: 768px) {
    .welcome-mobile-nav {
        display: grid;
        grid-template-columns: 42px 1fr 42px;
        align-items: center;
        gap: 10px;
    }

    .welcome-mobile-nav-btn {
        width: 42px;
        height: 42px;
        border-radius: 11px;
        border: 1px solid rgba(128, 36, 51, 0.22);
        background: #fff;
        color: var(--primary-dark);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.95rem;
    }

    .welcome-mobile-nav-btn:disabled {
        opacity: 0.45;
    }

    .welcome-mobile-dots {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .welcome-mobile-dot {
        width: 24px;
        height: 24px;
        border-radius: 8px;
        border: 1px solid rgba(128, 36, 51, 0.22);
        background: #fff;
        color: rgba(128, 36, 51, 0.75);
        font-size: 0.75rem;
        font-weight: 700;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .welcome-mobile-dot.is-active {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: #fff;
        transform: scale(1.05);
    }
}

.flashcard-reset-modal.modal-overlay {
    z-index: 11000; /* sopra overlay streak */
}

.flashcard-delete-pop {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    z-index: 12000;
    padding: 12px;
}

.flashcard-delete-pop .glossary-clear-pop {
    position: relative;
    top: auto;
    right: auto;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
}

body.dark-mode .flashcard-delete-pop {
    background: rgba(0, 0, 0, 0.5);
}

.modal-container {
    position: relative;
    background: radial-gradient(140% 180% at 16% -10%, #ffffff, #fafafa);
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,.06);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 22px 56px rgba(0,0,0,.28), 0 8px 22px rgba(0,0,0,.12);
    animation: modalSlideIn 0.28s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.large-modal {
    max-width: 700px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--medium-gray);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.modal-header__titles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.close-modal-btn {
    background: rgba(255,255,255,.12);
    border: none;
    font-size: 1.05rem;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease, background .2s ease, opacity .2s ease;
}

.close-modal-btn:hover {
    background: rgba(255,255,255,.22);
    transform: translateY(-1px);
}

.modal-body {
    padding: 1.25rem;
    flex: 1 1 auto;
    overflow: auto;
    scrollbar-gutter: stable both-edges;
    -webkit-overflow-scrolling: touch;
}

.modal-body::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-track { background: #f0f2f5; }
.modal-body::-webkit-scrollbar-thumb { background: #b0b6bf; border-radius: 8px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--medium-gray);
    background: linear-gradient(180deg, #ffffff, #fafafa);
}


.cookie-banner {
    position: fixed;
    inset: auto 24px 24px;
    width: min(460px, calc(100% - 48px));
    border-radius: 28px;
    padding: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 255, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 25px 60px rgba(14, 16, 37, 0.25), 0 10px 22px rgba(27, 20, 54, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(18px);
    z-index: 10000;
    color: var(--dark-gray);
    overflow: hidden;
}

.cookie-banner::before {
    content: '';
    position: absolute;
    inset: -30% 15% auto;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0.7;
    pointer-events: none;
}

.cookie-banner__content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cookie-banner__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.cookie-banner__copy {
    flex: 1;
}

.cookie-banner__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    color: var(--primary-dark);
    margin: 0 0 6px;
}

.cookie-banner__text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

.cookie-banner__controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(128, 36, 51, 0.15);
    padding: 14px;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.cookie-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(128, 36, 51, 0.05);
    border: 1px solid rgba(128, 36, 51, 0.18);
    color: var(--primary-dark);
    box-shadow: 0 8px 20px rgba(128, 36, 51, 0.12);
}

.cookie-switch input {
    accent-color: var(--primary-color);
    transform: scale(1.05);
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

#cookie-save {
    margin-right: auto;
}

.cookie-btn {
    border-radius: 999px;
    border: 1px solid rgba(128, 36, 51, 0.2);
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    background: linear-gradient(145deg, #ffffff, #f5f6fa);
    color: var(--primary-dark);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cookie-btn.primary {
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 15px 30px rgba(128, 36, 51, 0.35);
}

.cookie-btn.ghost {
    background: transparent;
    border-color: rgba(128, 36, 51, 0.4);
    color: var(--primary-dark);
}

.cookie-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
}

.cookie-btn:focus-visible {
    outline: 2px solid rgba(128, 36, 51, 0.35);
    outline-offset: 2px;
}

.cookie-link {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(128, 36, 51, 0.2);
    border-radius: 999px;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    align-self: flex-start;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 25px rgba(128, 36, 51, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cookie-link:hover {
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.cookie-link.is-open .fa-chevron-down {
    transform: rotate(180deg);
}

.cookie-link .fa-chevron-down {
    transition: transform 0.3s ease;
}

@media (max-width: 560px) {
    .cookie-banner {
        inset: auto 14px 14px;
        width: calc(100% - 28px);
        border-radius: 22px;
        padding: 20px;
    }

    .cookie-banner__body {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-actions {
        flex-direction: column;
    }

    #cookie-save {
        margin-right: 0;
        width: 100%;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
    }
}

@media (min-width: 1024px) {
    .cookie-banner {
        inset: auto 0 0;
        width: 100%;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        padding: 24px 40px;
    }

    .cookie-banner__content {
        flex-direction: row;
        align-items: center;
        gap: 32px;
        max-width: 1280px;
        margin: 0 auto;
    }

    .cookie-banner__body {
        flex: 1.4;
    }

    .cookie-banner__controls {
        flex: 1;
    }

    .cookie-actions {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
}

.linklike-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: none;
    color: #8b1d2c;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s ease;
}

.linklike-btn:hover {
    color: var(--primary-color);
}

.linklike-btn:focus-visible {
    outline: 2px solid rgba(139, 29, 44, 0.3);
    border-radius: 4px;
    outline-offset: 2px;
}

.cookie-legal {
    max-width: 900px;
    margin: 10px auto 0;
    line-height: 1.6;
    color: #555;
}

.cookie-legal p {
    margin: 0;
}

.cookie-legal p + p {
    margin-top: 8px;
}

/* ==================
   DARK MODE - COOKIE & DISCLAIMER
   ================== */

body.dark-mode .cookie-banner {
    background: linear-gradient(145deg, rgba(20, 20, 28, 0.96), rgba(32, 32, 40, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 12px 26px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--dark-text-primary);
}

body.dark-mode .cookie-banner::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0.35;
}

body.dark-mode .cookie-banner__eyebrow {
    color: var(--dark-primary);
}

body.dark-mode .cookie-banner__text {
    color: var(--dark-text-primary);
}

body.dark-mode .cookie-settings {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
