/* Rifiniture UI landing OrdinaTU: tipografia, spaziature, accessibilità */
/* Tutti i commenti nel codice sono in italiano */

:root {
    --ot-radius: 14px;
    --ot-shadow: 0 4px 12px rgba(15, 23, 42, .08);
    --ot-shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
    --ot-shadow-hover: 0 12px 32px rgba(15, 23, 42, .15);
    --ot-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skip-link {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: .6rem .9rem;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    text-decoration: none;
    transform: translateY(-140%);
    transition: transform .2s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid rgba(241, 180, 0, .65);
    outline-offset: 2px;
}

section[id] {
    scroll-margin-top: 110px; /* evita che lo sticky header copra l'ancora */
}

/* Barra superiore: messaggi chiave (IA, assistenza, personalizzazione, ecosistema) */
.top-bar {
    background: linear-gradient(90deg, rgba(241, 180, 0, .12) 0%, rgba(241, 180, 0, .06) 50%, rgba(241, 180, 0, .12) 100%);
    border-bottom: 1px solid rgba(241, 180, 0, .2);
    color: #475569;
}

.top-bar-tag {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.top-bar-tag .mdi {
    color: var(--bs-primary);
}

@media (max-width: 991px) {
    .top-bar .d-flex {
        justify-content: center;
    }
    .top-bar-tag {
        font-size: 0.8rem;
    }
}

/* Header / Navbar premium: aspetto distintivo */
#topnav.navbar-premium {
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 2px solid rgba(241, 180, 0, .35);
    box-shadow: 0 2px 16px rgba(15, 23, 42, .06);
}

#topnav .nav-link {
    font-weight: 600;
    color: #334155;
    position: relative;
    padding: 0.5rem 0.75rem;
}

#topnav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--bs-primary);
    border-radius: 2px;
    transition: transform 0.25s ease;
}

#topnav .nav-link:hover,
#topnav .nav-link:focus {
    color: var(--bs-primary);
}

#topnav .nav-link:hover::after,
#topnav .nav-link:focus::after {
    transform: translateX(-50%) scaleX(1);
}

#topnav .btn-nav-cta {
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(241, 180, 0, .35);
}

#topnav .btn-nav-cta:hover {
    box-shadow: 0 6px 20px rgba(241, 180, 0, .45);
    transform: translateY(-1px);
}

/* Logo in navbar: altezza contenuta per non sforare l’header */
/* Logo in navbar: icona più grande, testo Ordina (nero) + TU (arancio) */
/* Logo e scritta a margine sinistro, tasto menu a margine destro (sempre, anche con menu chiuso) */
#topnav .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
}

#topnav .logo.navbar-brand {
    order: 1;
    margin-right: 0;
}

#topnav .navbar-toggler {
    order: 2;
    margin-left: auto;
}

#topnav .navbar-collapse {
    order: 3;
    flex-basis: 100%;
}

@media (min-width: 992px) {
    #topnav .navbar-collapse {
        flex-basis: auto;
        order: 2;
        margin-left: auto;
    }
    #topnav .navbar-toggler {
        display: none;
    }
}

/* Picture nel logo: evita gap dovuto a inline per layout navbar */
.logo picture {
    display: block;
    line-height: 0;
}

.navbar-logo {
    height: 46px;
    width: auto;
    display: block;
}

.logo-text {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #212529;
    letter-spacing: -.02em;
}

.logo-text .text-primary {
    color: var(--bs-primary) !important; /* TU in arancio */
}

.title-heading .heading {
    letter-spacing: -.02em;
    line-height: 1.12;
}

.para-desc {
    max-width: 64ch;
}

.card {
    border-radius: var(--ot-radius);
    overflow: hidden;
    transition: var(--ot-transition);
}

/* Card piano Pro con badge "Popolare": evita taglio da bordo top (overflow + posizione badge) */
.card-piano-popolare {
    overflow: visible;
}

.card-piano-popolare .badge-popolare {
    top: 10px;
    transform: translate(-50%, 0);
}

/* Card con shadow */
.card.shadow {
    box-shadow: var(--ot-shadow) !important;
}

.card.shadow-sm {
    box-shadow: var(--ot-shadow-sm) !important;
}

/* Effetto hover lift per card interattive */
.hover-lift {
    transition: var(--ot-transition);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--ot-shadow-hover) !important;
}

/* Animazione delle icone al hover della card */
.hover-lift:hover .icon,
.hover-lift:hover .ot-icon-pill {
    transform: scale(1.08) rotate(5deg);
}

.icon,
.ot-icon-pill {
    transition: var(--ot-transition);
}

.ot-icon-pill {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.btn.btn-primary {
    box-shadow: 0 10px 22px rgba(241, 180, 0, .28);
}

/* Pulsante back-to-top: nascosto di default, mostrato via JS allo scroll; freccia centrata nel quadrato */
#back-to-top {
    display: none;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    color: inherit;
}

#back-to-top i.mdi {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    font-size: 1.25rem;
}

/* Miglioramenti accessibilità e interattività */
a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    opacity: 0.85;
}

/* Smooth scroll per tutta la pagina */
html {
    scroll-behavior: smooth;
}

/* Arrotondamento coerente per elementi circolari */
.rounded-circle {
    border-radius: 50% !important;
}

/* Card piano acquista: selezione con cornice arancione e zoom leggero */
.piano-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.piano-card.piano-selected {
    border: 2px solid var(--bs-primary) !important;
    transform: scale(1.03);
    box-shadow: 0 8px 28px rgba(241, 180, 0, 0.28);
}

/* Sezione Contatti: mappa e card */
.min-h-map {
    min-height: 380px;
}

.contatti-map-iframe {
    width: 100%;
    height: 100%;
    min-height: 380px;
    display: block;
    border: 0;
}

.contatti-map-label {
    background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
}

/* Evita selezione testo e cursore lampeggiante al clic su contenuti non editabili */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body input,
body textarea,
body select,
body [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
