/* ============================================================
   Taverna del Drago — Public Design System
   Cinematic dark fantasy. Used across all public-facing pages.
   ============================================================ */

:root {
    --bg-deep:    #0a0608;
    --bg-night:   #14090b;
    --bg-panel:   rgba(22, 12, 14, 0.72);
    --bg-panel-2: rgba(22, 12, 14, 0.88);
    --gold:       #d4a857;
    --gold-bright:#f4cf7a;
    --gold-dim:   rgba(212, 168, 87, 0.35);
    --ember:      #c5392f;
    --ember-glow: #ff5a3c;
    --ember-deep: #8a1d18;
    --success:    #4ade80;
    --warning:    #f0c419;
    --danger:     #ff5a3c;
    --ink:        #f3e9d7;
    --ink-dim:    rgba(243, 233, 215, 0.7);
    --ink-faint:  rgba(243, 233, 215, 0.45);
    --hairline:   rgba(212, 168, 87, 0.18);
    --shadow-deep:0 30px 80px rgba(0, 0, 0, 0.6);
    --shadow-md:  0 12px 36px rgba(0, 0, 0, 0.4);
    --r-lg: 22px;
    --r-md: 14px;
    --r-sm: 8px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--bg-deep);
    overflow-x: hidden;
    line-height: 1.65;
    min-height: 100vh;
}

a { color: var(--gold); }
a:hover { color: var(--gold-bright); }

/* === SCENA SFONDO === */
.scene {
    position: fixed; inset: 0; z-index: -2;
    background:
      radial-gradient(ellipse at 20% 10%, rgba(197, 57, 47, 0.18), transparent 50%),
      radial-gradient(ellipse at 80% 90%, rgba(212, 168, 87, 0.12), transparent 55%),
      linear-gradient(180deg, #0a0608 0%, #14090b 50%, #0a0608 100%);
}
.scene::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
      radial-gradient(1px 1px at 12% 22%, rgba(255,220,170,0.6) 50%, transparent 100%),
      radial-gradient(1px 1px at 73% 8%, rgba(255,220,170,0.4) 50%, transparent 100%),
      radial-gradient(1.5px 1.5px at 41% 67%, rgba(255,220,170,0.5) 50%, transparent 100%),
      radial-gradient(1px 1px at 89% 41%, rgba(255,220,170,0.5) 50%, transparent 100%),
      radial-gradient(1px 1px at 25% 88%, rgba(255,220,170,0.5) 50%, transparent 100%);
    background-size: 1200px 800px;
    opacity: 0.7;
    animation: drift 60s linear infinite;
}
@keyframes drift {
    from { background-position: 0 0; }
    to   { background-position: 1200px -800px; }
}
canvas#embers {
    position: fixed; inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* === HEADER / NAV === */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(10, 6, 8, 0.55);
    border-bottom: 1px solid var(--hairline);
    transition: padding 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.scrolled {
    padding: 0.6rem 2rem;
    background: rgba(10, 6, 8, 0.85);
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: var(--ink);
}
.brand-mark {
    height: 58px;
    width: 58px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(197, 57, 47, 0.55));
    transition: height 0.4s var(--ease), width 0.4s var(--ease), filter 0.4s var(--ease), transform 0.4s var(--ease);
}
.nav.scrolled .brand-mark {
    height: 44px;
    width: 44px;
}
.brand:hover .brand-mark {
    transform: scale(1.06) rotate(-4deg);
    filter: drop-shadow(0 0 16px rgba(197, 57, 47, 0.8));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong {
    font-family: 'MedievalSharp', 'Cinzel Decorative', serif;
    font-weight: 400;
    font-size: 1.55rem;
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #fff5d6 0%, var(--gold-bright) 45%, var(--gold) 80%, #8a6428 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 18px rgba(244, 207, 122, 0.3);
    transition: font-size 0.4s var(--ease);
}
.nav.scrolled .brand-text strong {
    font-size: 1.3rem;
}
.brand-text span {
    font-size: 0.7rem;
    color: var(--ink-faint);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 2px;
    font-family: 'Cinzel', serif;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-links a {
    color: var(--ink-dim);
    text-decoration: none;
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    border-radius: 999px;
    transition: color 0.3s var(--ease), background 0.3s var(--ease);
    position: relative;
}
.nav-links a:hover { color: var(--gold-bright); }
.nav-links a.active { color: var(--gold-bright); background: rgba(212, 168, 87, 0.06); }
.nav-links a.cta {
    background: linear-gradient(135deg, var(--ember), var(--ember-deep));
    color: var(--ink);
    padding: 0.6rem 1.3rem;
    margin-left: 0.5rem;
    box-shadow: 0 0 20px rgba(197, 57, 47, 0.35);
}
.nav-links a.cta:hover {
    color: #fff;
    box-shadow: 0 0 32px rgba(255, 90, 60, 0.55);
    transform: translateY(-1px);
}
.nav-toggle {
    display: none;
    background: none; border: none;
    color: var(--ink); font-size: 1.4rem;
    cursor: pointer;
}

/* === MAIN PAGE === */
main.page {
    padding-top: 110px;          /* space for fixed nav */
    min-height: calc(100vh - 80px);
}
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.container-narrow { max-width: 880px; }
.container-wide   { max-width: 1400px; }

/* === TIPOGRAFIA & SECTION HEADERS === */
.eyebrow,
.section-eyebrow {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}
.section-eyebrow::before,
.section-eyebrow::after,
.eyebrow.has-rules::before,
.eyebrow.has-rules::after {
    content: '';
    width: 50px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
h1.page-title,
.page-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 700;
    text-align: center;
    margin: 0 0 1rem;
    line-height: 1.1;
    background: linear-gradient(180deg, #fbe9c2 0%, var(--gold-bright) 45%, var(--gold) 70%, #8a6428 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 60px rgba(212, 168, 87, 0.25);
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
}
.section-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 700;
    text-align: center;
    margin: 0 0 4rem;
    color: var(--ink);
    line-height: 1.15;
}
.section-title em,
.page-title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.page-subtitle {
    text-align: center;
    color: var(--ink-dim);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    max-width: 720px;
    margin: 0 auto 3rem;
    font-weight: 300;
}

/* === BOTTONI === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
    position: relative;
    overflow: hidden;
    line-height: 1;
    font-weight: 500;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--ember) 0%, var(--ember-deep) 100%);
    color: #fff;
    box-shadow: 0 8px 30px rgba(197, 57, 47, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(255, 90, 60, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    color: #fff;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s var(--ease);
}
.btn-primary:hover:not(:disabled)::after { left: 100%; }
.btn-ghost {
    background: transparent;
    color: var(--gold-bright);
    border-color: var(--gold-dim);
}
.btn-ghost:hover:not(:disabled) {
    background: rgba(212, 168, 87, 0.08);
    border-color: var(--gold);
    transform: translateY(-2px);
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, #8a6428 100%);
    color: #1a0c08;
    box-shadow: 0 8px 30px rgba(212, 168, 87, 0.4);
}
.btn-gold:hover:not(:disabled) { transform: translateY(-2px); color: #1a0c08; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-sm { padding: 0.6rem 1.2rem; font-size: 0.78rem; letter-spacing: 0.14em; }

/* === PANEL / CARD === */
.panel {
    padding: 2rem 2rem;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
}
.card {
    padding: 2rem 1.5rem;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.card:hover { border-color: var(--gold-dim); }

/* === ALERTS === */
.alert {
    padding: 1rem 1.2rem;
    border-radius: var(--r-md);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-error {
    background: rgba(255, 90, 60, 0.08);
    color: #ffb89c;
    border-color: rgba(255, 90, 60, 0.4);
}
.alert-success {
    background: rgba(74, 222, 128, 0.08);
    color: #b8f3cd;
    border-color: rgba(74, 222, 128, 0.4);
}
.alert-info {
    background: rgba(212, 168, 87, 0.08);
    color: var(--gold-bright);
    border-color: var(--gold-dim);
}
.alert-warning {
    background: rgba(240, 196, 25, 0.08);
    color: #ffe79c;
    border-color: rgba(240, 196, 25, 0.4);
}

/* === FORMS === */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.1rem;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.1rem;
}
.form-row .form-group { margin-bottom: 0; }
label {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
label .required { color: var(--ember-glow); margin-left: 2px; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
    padding: 0.85rem 1rem;
    background: rgba(10, 6, 8, 0.65);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
    outline: none;
    width: 100%;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    background: rgba(10, 6, 8, 0.88);
    box-shadow: 0 0 0 3px rgba(212, 168, 87, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
textarea { min-height: 100px; resize: vertical; font-family: inherit; }
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23d4a857' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.form-help {
    font-size: 0.82rem;
    color: var(--ink-faint);
    margin-top: 0.4rem;
}
.form-error {
    font-size: 0.85rem;
    color: var(--ember-glow);
    margin-top: 0.4rem;
}
.checkbox-group, .radio-group {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
}
.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    accent-color: var(--gold);
    width: 18px; height: 18px;
    margin-top: 3px;
    flex-shrink: 0;
}
.checkbox-group label, .radio-group label {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    letter-spacing: normal;
    text-transform: none;
    color: var(--ink-dim);
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.5;
}

/* === LINKS in body text === */
.text-link {
    color: var(--gold-bright);
    text-decoration: none;
    border-bottom: 1px dotted var(--gold-dim);
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.text-link:hover { color: var(--ember-glow); border-color: var(--ember-glow); }

/* === FOOTER === */
footer.foot {
    padding: 3rem 1.5rem 2rem;
    text-align: center;
    color: var(--ink-faint);
    font-size: 0.85rem;
    border-top: 1px solid var(--hairline);
    background: rgba(10, 6, 8, 0.6);
    margin-top: 4rem;
}
footer.foot a { color: var(--gold); text-decoration: none; }
footer.foot a:hover { color: var(--gold-bright); }
.foot-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

/* === REVEAL ANIMATIONS === */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.22s; }
.reveal.delay-3 { transition-delay: 0.34s; }
.reveal.delay-4 { transition-delay: 0.46s; }

/* === PULSE DOT === */
.pulse-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--ember-glow); border-radius: 50%;
    box-shadow: 0 0 12px var(--ember-glow);
    animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.4); }
}

/* === LOADER === */
.spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 2px solid var(--gold-dim);
    border-top-color: var(--gold-bright);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg-night); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-dim), var(--ember-deep));
    border-radius: 6px;
    border: 2px solid var(--bg-night);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--gold), var(--ember)); }

/* === RESPONSIVE === */
.nav-links a, .brand-text strong, .brand-text span { white-space: nowrap; }

/* Menu a tendina sotto i 1100px: con 6 voci la riga non ci sta più */
@media (max-width: 1100px) {
    .nav-links {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch;
        padding: 1rem;
        background: rgba(10, 6, 8, 0.97);
        border-bottom: 1px solid var(--hairline);
        gap: 0.2rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.9rem 1rem; }
    .nav-links a.cta { margin-left: 0; text-align: center; }
    .nav-toggle { display: block; }
}

@media (max-width: 880px) {
    .nav { padding: 0.8rem 1rem; }
    main.page { padding-top: 90px; }
    .container { padding: 0 1rem; }
    .panel { padding: 1.5rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
    }
}

/* === UTILS === */
.text-center { text-align: center; }
.text-gold   { color: var(--gold-bright); }
.text-ember  { color: var(--ember-glow); }
.text-dim    { color: var(--ink-dim); }
.text-faint  { color: var(--ink-faint); }
.mt-0 { margin-top: 0; }       .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }  .mb-1 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 1rem; }    .mb-2 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1.5rem; }  .mb-3 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }  .mb-4 { margin-bottom: 2.5rem; }
.mt-6 { margin-top: 4rem; }    .mb-6 { margin-bottom: 4rem; }
.hidden { display: none !important; }
.no-select { user-select: none; -webkit-user-select: none; }
