/* =================================================================
   INSTAGARDA TRIP DESIGNER v2
   Light, on-brand: foto lago + Playfair/Poppins + palette lago.
   Coerente con il resto del sito (main.css).
   ================================================================= */

:root {
    --td-blue:        #e24a1e;   /* lago primary */
    --td-blue-deep:   #b23c15;
    --td-teal:        #f0a020;   /* categoria "vedere" */
    --td-green:       #f0a020;   /* categoria "attività" */
    --td-orange:      #FF8C42;
    --td-yellow:      #FFD166;
    --td-ink:         #1C1C1E;
    --td-muted:       #6B7280;
    --td-faint:       #9CA3AF;
    --td-bg:          #F2F2F7;
    --td-surface:     #FFFFFF;
    --td-border:      #E5E5EA;
    --td-ring:        rgba(226,74,30,0.16);
    --td-font:        'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --td-serif:       'Playfair Display', Georgia, 'Times New Roman', serif;
    --td-shadow:      0 1px 2px rgba(16,24,40,0.04), 0 8px 28px rgba(16,24,40,0.06);
    --td-shadow-lg:   0 24px 60px rgba(16,24,40,0.12);
}

*, *::before, *::after { box-sizing: border-box; }

.td-body {
    margin: 0;
    font-family: var(--td-font);
    background: var(--td-bg);
    color: var(--td-ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.td-body #gardaChat { display: none; } /* niente FAB chat sulla landing */

/* ── Header (sopra l'hero, testo bianco) ────────────────────── */
.td-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    padding: 20px clamp(16px, 5vw, 40px);
}
.td-header__back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 8px rgba(0,0,0,0.35);
    opacity: 0.92;
    transition: opacity 0.2s;
}
.td-header__back:hover { opacity: 1; }
.td-header__back svg { opacity: 0.95; }

/* ── Hero foto ──────────────────────────────────────────────── */
.td-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    min-height: min(60vh, 460px);
    padding: 96px clamp(18px, 5vw, 40px) 88px;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden;
}
.td-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.td-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.35) 60%, rgba(0,0,0,0.65) 100%);
}
.td-hero__kicker,
.td-hero__title,
.td-hero__sub { position: relative; z-index: 2; }
.td-hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.td-hero__kicker::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--td-teal);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.35);
}
.td-hero__title {
    margin: 0 0 14px;
    font-family: var(--td-serif);
    font-size: clamp(2.1rem, 6.5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 24px rgba(0,0,0,0.35);
}
.td-hero__sub {
    margin: 0 auto;
    max-width: 560px;
    font-size: clamp(0.98rem, 2.4vw, 1.12rem);
    line-height: 1.6;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 1px 12px rgba(0,0,0,0.3);
}

/* ── App shell: form sale sopra l'hero ──────────────────────── */
.td-app {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 clamp(14px, 4vw, 28px) 72px;
}
.td-wizard {
    position: relative;
    margin-top: -48px;
    padding: clamp(24px, 5vw, 40px) clamp(20px, 5vw, 40px) clamp(28px, 5vw, 40px);
    background: var(--td-surface);
    border: 1px solid var(--td-border);
    border-radius: 26px;
    box-shadow: var(--td-shadow-lg);
}

/* ── Domande wizard ─────────────────────────────────────────── */
.td-q { margin-bottom: 30px; }
.td-q:last-of-type { margin-bottom: 26px; }
.td-q__label {
    margin: 0 0 14px;
    font-family: var(--td-serif);
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--td-ink);
}
.td-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}
.td-opt {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--td-border);
    background: var(--td-surface);
    color: #374151;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.16s, background 0.16s, color 0.16s, box-shadow 0.16s, transform 0.08s;
}
.td-opt:hover {
    border-color: var(--td-blue);
    background: #F5FAFF;
    color: var(--td-blue-deep);
}
.td-opt:active { transform: translateY(1px); }
.td-opt--selected,
.td-opt--selected:hover {
    background: var(--td-blue);
    border-color: var(--td-blue);
    color: #fff;
    box-shadow: 0 6px 18px rgba(226,74,30,0.28);
}
.td-opts--months { gap: 8px; }
.td-opt--month {
    font-size: 0.84rem;
    padding: 8px 13px;
    border-radius: 10px;
}
.td-opts--shake { animation: td-shake 0.4s; }
@keyframes td-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.td-dog {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--td-muted);
    cursor: pointer;
}
.td-dog input {
    accent-color: var(--td-blue);
    width: 17px; height: 17px;
    cursor: pointer;
}

/* ── CTA ────────────────────────────────────────────────────── */
.td-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
    padding: 17px 24px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(120deg, var(--td-blue) 0%, var(--td-teal) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.06rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    cursor: pointer;
    transition: transform 0.16s, box-shadow 0.16s, filter 0.16s;
    box-shadow: 0 10px 30px rgba(226,74,30,0.32);
}
.td-cta::after {
    content: "";
    width: 18px; height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.18s;
}
.td-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(226,74,30,0.42);
}
.td-cta:hover::after { transform: translateX(4px); }

/* ── Result ─────────────────────────────────────────────────── */
.td-result {
    position: relative;
    margin-top: -48px;
    padding: clamp(20px, 5vw, 34px) clamp(18px, 5vw, 36px) clamp(24px, 5vw, 34px);
    background: var(--td-surface);
    border: 1px solid var(--td-border);
    border-radius: 26px;
    box-shadow: var(--td-shadow-lg);
}
.td-result__toolbar {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 8px;
}
.td-toolbtn {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--td-border);
    background: var(--td-surface);
    color: #374151;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s;
}
.td-toolbtn:hover { border-color: var(--td-blue); color: var(--td-blue-deep); background: #F5FAFF; }

.td-loader {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 2px;
    color: var(--td-muted);
    font-size: 0.96rem;
    font-weight: 500;
}
.td-loader__orb { width: 30px !important; height: 30px !important; }

.td-usermsg {
    margin: 22px 0 6px;
    padding: 12px 18px;
    border-radius: 16px 16px 4px 16px;
    background: linear-gradient(120deg, var(--td-blue), var(--td-teal));
    color: #fff;
    font-size: 0.92rem;
    font-weight: 500;
    max-width: 85%;
    margin-left: auto;
    box-shadow: 0 6px 18px rgba(226,74,30,0.22);
}

.td-intro {
    font-size: 1.02rem;
    line-height: 1.65;
    color: #374151;
    margin: 8px 0 6px;
}
.td-intro strong { color: var(--td-ink); font-weight: 600; }

.td-error {
    padding: 20px;
    border-radius: 14px;
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    margin: 16px 0;
}
.td-error p { margin: 0 0 12px; }

/* ── Giorni + steps ─────────────────────────────────────────── */
.td-day { margin-top: 28px; }
.td-day__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 14px;
    background: linear-gradient(120deg, #EAF4FF, #E6FbFF);
    border: 1px solid #CDE6FF;
}
.td-day__num {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    background: var(--td-blue);
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.td-day__title {
    margin: 0;
    font-family: var(--td-serif);
    font-size: 1.14rem;
    font-weight: 700;
    color: var(--td-blue-deep);
}

.td-steps {
    padding: 16px 0 4px 8px;
    border-left: 2px solid #E1E8F0;
    margin: 12px 0 0 16px;
}
.td-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
}
.td-step__time {
    flex-shrink: 0;
    width: 48px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--td-blue);
    padding-top: 2px;
}
.td-step__dot { flex-shrink: 0; font-size: 1.1rem; line-height: 1.3; }
.td-step__body {
    font-size: 0.94rem;
    line-height: 1.5;
    color: #374151;
}
.td-step__body strong { display: block; color: var(--td-ink); font-weight: 600; }
.td-step__desc { display: block; font-size: 0.86em; color: var(--td-muted); margin-top: 2px; }
.td-step__link {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--td-blue);
    text-decoration: none;
    font-weight: 600;
}
.td-step__link:hover { text-decoration: underline; }

/* ── Cards ──────────────────────────────────────────────────── */
.td-cards {
    display: flex;
    gap: 11px;
    overflow-x: auto;
    padding: 18px 0 8px;
    scrollbar-width: none;
}
.td-cards::-webkit-scrollbar { display: none; }
.td-card {
    flex: 0 0 auto;
    min-width: 168px;
    max-width: 224px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--td-surface);
    border: 1px solid var(--td-border);
    text-decoration: none;
    box-shadow: var(--td-shadow);
    transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}
.td-card:hover {
    transform: translateY(-3px);
    border-color: #CDE6FF;
    box-shadow: 0 14px 32px rgba(16,24,40,0.12);
}
.td-card__type {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--td-teal);
    margin-bottom: 5px;
}
.td-card__title {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--td-ink);
    line-height: 1.35;
}

/* ── Followups ──────────────────────────────────────────────── */
.td-followups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
}
.td-pill {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1.5px solid #CDE6FF;
    background: #F5FAFF;
    color: var(--td-blue-deep);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.16s;
}
.td-pill:hover { background: var(--td-blue); border-color: var(--td-blue); color: #fff; }

/* ── Refine input ───────────────────────────────────────────── */
.td-refine {
    display: flex;
    gap: 10px;
    margin-top: 26px;
    position: sticky;
    bottom: 16px;
}
.td-refine input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--td-border);
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--td-ink);
    font-family: inherit;
    font-size: 0.94rem;
    outline: none;
    box-shadow: var(--td-shadow);
    transition: border-color 0.16s, box-shadow 0.16s;
}
.td-refine input:focus { border-color: var(--td-blue); box-shadow: 0 0 0 4px var(--td-ring); }
.td-refine input::placeholder { color: var(--td-faint); }
.td-refine__send {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(120deg, var(--td-blue), var(--td-teal));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(226,74,30,0.3);
    transition: transform 0.16s;
}
.td-refine__send:hover { transform: scale(1.06); }

.td-powered {
    margin-top: 22px;
    text-align: center;
    font-size: 0.74rem;
    color: var(--td-faint);
}

/* ── AI Orb (loader — brand lago) ───────────────────────────── */
.ig-ai-orb {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--td-blue), var(--td-teal), var(--td-green));
    background-size: 200% 200%;
    animation: td-orb 4s ease infinite;
}
@keyframes td-orb {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
    .td-body { background: #fff; color: #111; }
    .td-header, .td-hero, .td-result__toolbar, .td-refine, .td-followups, .td-powered, .td-usermsg { display: none !important; }
    .td-result { margin-top: 0; box-shadow: none; border: none; padding: 0; }
    .td-intro, .td-step__body, .td-day__title { color: #111 !important; }
    .td-step__body strong { color: #000 !important; }
    .td-step__desc { color: #444 !important; }
    .td-day__header { background: #EAF4FF !important; border-color: #ddd; }
    .td-day__num { color: #fff; background: var(--td-blue); }
    .td-step__time { color: var(--td-blue); }
    .td-cards { display: none; }
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 560px) {
    .td-hero { min-height: 50vh; padding-top: 84px; padding-bottom: 76px; }
    .td-app { padding: 0 12px 48px; }
    .td-wizard, .td-result { margin-top: -40px; border-radius: 20px; }
    .td-opt { font-size: 0.86rem; padding: 9px 13px; }
    .td-q__label { font-size: 1.16rem; }
    .td-usermsg { max-width: 100%; }
    .td-step__time { width: 42px; }
}
