/* =============================================================================
   Chiara Florio Trainings - Stile globale
   Palette brand:
     --cft-cream  #fff4f4   sfondo chiaro
     --cft-pink   #ffd6e0   rosa tenue
     --cft-rose   #ae687a   rosa/mauve principale (accent)
     --cft-brown  #3e2f0b   marrone scuro (testo/contrasto)
     --cft-green  #425135   verde scuro
     --cft-sage   #c6c996   verde salvia
   Font: Cormorant Garamond (titoli) + Questrial (corpo)
   ============================================================================= */

:root {
    --cft-cream: #fff4f4;
    --cft-pink:  #ffd6e0;
    --cft-rose:  #ae687a;
    --cft-rose-dark: #91505f;
    --cft-brown: #3e2f0b;
    --cft-green: #425135;
    --cft-sage:  #c6c996;

    --cft-font-title: 'Cormorant Garamond', 'New Standard', Georgia, serif;
    --cft-font-body:  'Questrial', 'Helvetica Neue', Arial, sans-serif;

    --cft-navbar-h: 92px;

    --bs-primary: var(--cft-rose);
}

/* -- Base ------------------------------------------------------------------ */
html, body {
    /* clip (non hidden) evita lo scroll orizzontale SENZA creare un
       contenitore di scroll, che altrimenti romperebbe position: sticky */
    overflow-x: clip;
}

body {
    font-family: var(--cft-font-body);
    color: var(--cft-brown);
    background-color: var(--cft-cream);
}

h1, h2, h3, h4, h5, .cft-brand {
    font-family: var(--cft-font-title);
    font-weight: 600;
    letter-spacing: .3px;
}

a {
    color: var(--cft-rose);
    text-decoration: none;
}
a:hover { color: var(--cft-rose-dark); }

.cft-main { min-height: 60vh; }

/* -- Brand / logo ---------------------------------------------------------- */
.cft-brand {
    font-size: 1.5rem;
    color: #fff;
    padding-top: 0;
    padding-bottom: 0;
}
.cft-brand span { display: inline; }
.cft-logo {
    height: 64px;
    width: auto;
    display: block;
}

/* -- Navbar ---------------------------------------------------------------- */
.cft-navbar {
    background-color: var(--cft-rose);
    border-bottom: 1px solid var(--cft-rose-dark);
    box-shadow: 0 2px 12px rgba(174, 104, 122, .25);
    padding-top: .75rem;
    padding-bottom: .75rem;
    transition: background-color .3s ease, box-shadow .3s ease, border-color .3s ease;
}

/* Home: navbar trasparente in overlay (fixed) sull'hero, finché non si scrolla */
body.home .cft-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    background-color: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
}
body.home .cft-navbar.cft-navbar--scrolled {
    background-color: var(--cft-rose);
    border-bottom-color: var(--cft-rose-dark);
    box-shadow: 0 2px 12px rgba(174, 104, 122, .25);
}
.cft-navbar .nav-link {
    color: #fff;
    font-weight: 500;
}
.cft-navbar .nav-link:hover,
.cft-navbar .nav-link.active { color: var(--cft-pink); }
.cft-navbar .btn-cft {
    background-color: #fff;
    border-color: #fff;
    color: var(--cft-rose);
}
.cft-navbar .btn-cft:hover,
.cft-navbar .btn-cft:focus {
    background-color: var(--cft-cream);
    border-color: var(--cft-cream);
    color: var(--cft-rose-dark);
}
/* Toggler: nessun bordo/sfondo, solo le tre lineette, allineato al logo */
.cft-navbar > .container {
    align-items: center;
    flex-wrap: nowrap;
}
.cft-navbar .navbar-toggler {
    border: 0;
    padding: 0;
    line-height: 1;
    box-shadow: none;
    color: #fff;
}
.cft-navbar .navbar-toggler:focus,
.cft-navbar .navbar-toggler:focus-visible {
    box-shadow: none;
    outline: none;
}
.cft-navbar .navbar-toggler-icon {
    width: 2rem;
    height: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* -- Menu off-canvas (mobile) ---------------------------------------------- */
.cft-offcanvas {
    background-color: var(--cft-rose);
    color: #fff;
    width: min(82vw, 320px);
    border: 0;
}
.cft-offcanvas .offcanvas-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
}
.cft-offcanvas .offcanvas-title {
    color: #fff;
    font-size: 1.35rem;
    margin: 0;
}
.cft-offcanvas .btn-close {
    filter: brightness(0) invert(1);
    opacity: .85;
    box-shadow: none;
}
.cft-offcanvas .offcanvas-body {
    padding: 1rem 1.5rem 1.75rem;
}
.cft-offcanvas .navbar-nav {
    --bs-nav-link-padding-y: .65rem;
    gap: .15rem;
}
.cft-offcanvas .nav-link {
    color: #fff;
    font-size: 1.1rem;
}
.cft-offcanvas .btn-cft {
    margin-top: .5rem;
}

/* Pellicola di sfondo quasi totalmente opaca */
.offcanvas-backdrop.cft-backdrop,
.offcanvas-backdrop.show {
    background-color: var(--cft-brown);
}
.offcanvas-backdrop.show {
    opacity: .94;
}

/* Da lg in su l'offcanvas torna barra di navigazione normale */
@media (min-width: 992px) {
    .cft-offcanvas {
        background-color: transparent;
        width: auto;
    }
}

/* -- Flash / toast (fissi in basso a destra) ------------------------------- */
.cft-flash {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1080;
    width: 360px;
    max-width: calc(100vw - 2rem);
    display: flex;
    flex-direction: column;
    gap: .75rem;
    pointer-events: none;
}
.cft-flash .alert {
    pointer-events: auto;
    margin: 0;
    border: 0;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    animation: cft-flash-in .3s ease;
}
.cft-flash .alert-success { background-color: #2e7d32; }   /* verde */
.cft-flash .alert-danger  { background-color: #c62828; }   /* rosso */
.cft-flash .alert-warning { background-color: #ef6c00; }   /* arancio */
.cft-flash .alert-info    { background-color: var(--cft-rose); }
.cft-flash .alert .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: .9;
}
@keyframes cft-flash-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- Bottoni brand --------------------------------------------------------- */
.btn-cft {
    background-color: var(--cft-rose);
    border-color: var(--cft-rose);
    color: #fff;
    border-radius: 30px;
    padding: .55rem 1.6rem;
    font-weight: 500;
    transition: background-color .2s ease;
}
.btn-cft:hover, .btn-cft:focus {
    background-color: var(--cft-rose-dark);
    border-color: var(--cft-rose-dark);
    color: #fff;
}
.btn-cft-outline {
    background: transparent;
    border: 1.5px solid var(--cft-rose);
    color: var(--cft-rose);
    border-radius: 30px;
    padding: .55rem 1.6rem;
    font-weight: 500;
}
.btn-cft-outline:hover { background: var(--cft-rose); color: #fff; }

/* -- Hero ------------------------------------------------------------------ */
.cft-hero {
    background: linear-gradient(135deg, var(--cft-pink) 0%, var(--cft-cream) 100%);
    padding: 5rem 0;
    text-align: center;
}
.cft-hero h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    color: var(--cft-rose);
}
.cft-hero p { font-size: 1.15rem; color: var(--cft-brown); }

/* -- Hero full-screen con immagine di copertina ---------------------------- */
.cft-hero--cover {
    position: relative;
    min-height: 100vh;
    padding: 0;
    background-image: var(--cft-cover-desktop);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
/* Cover verticale per display in portrait (mobile/tablet) */
@media (orientation: portrait) {
    .cft-hero--cover { background-image: var(--cft-cover-mobile); }
}
/* Azzera il wrapper main vuoto che l'header inserisce prima dell'hero */
body.home > main.cft-main:first-of-type,
body.chi-sono > main.cft-main:first-of-type { min-height: 0; }
body.home > main.cft-main:first-of-type > .container,
body.chi-sono > main.cft-main:first-of-type > .container { padding-top: 0 !important; padding-bottom: 0 !important; }
.cft-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: clamp(3rem, 10vh, 7rem);
    background: linear-gradient(to bottom, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 35%, rgba(62,47,11,.55) 100%);
}
.cft-hero-content { text-align: center; padding: 0 1.5rem; }
.cft-hero--cover .cft-hero-motto {
    font-family: var(--cft-font-title);
    color: #fff;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 1.75rem;
    text-shadow: 0 2px 12px rgba(0,0,0,.55);
}
.cft-hero--cover .btn-cft { box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* -- Card lezione / pacchetto --------------------------------------------- */
.cft-card {
    background: #fff;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(62, 47, 11, .07);
    transition: transform .2s ease, box-shadow .2s ease;
}
/* Altezza uniforme solo nelle griglie (catalogo/home): usa .cft-card.h-100 */
.cft-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(174, 104, 122, .18);
}
/* Foto cliccabile: porta alla scheda, con leggero zoom in hover */
.cft-card-media {
    display: block;
    overflow: hidden;
    line-height: 0;
}
.cft-card .cft-card-img {
    aspect-ratio: 1 / 1; /* copertine salvate quadrate (800x800): niente ritaglio */
    object-fit: cover;
    width: 100%;
    background: var(--cft-sage);
    transition: transform .5s ease;
}
.cft-card-media:hover .cft-card-img,
.cft-card:hover .cft-card-img {
    transform: scale(1.06);
}
.cft-card-body { padding: 1.25rem; }
/* Nelle griglie a card uniforme: corpo a colonna così il piede va sempre in fondo */
.cft-card.h-100 { display: flex; flex-direction: column; }
.cft-card.h-100 .cft-card-body { flex: 1 1 auto; display: flex; flex-direction: column; }
/* Descrizione limitata a 3 righe, con ellissi e altezza riservata costante */
.cft-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(3 * 1.5em);
}
/* Riga prezzo + pulsante sempre allineata in basso */
.cft-card-foot { margin-top: auto; }
.cft-price { color: var(--cft-rose); font-weight: 700; font-size: 1.2rem; }

.cft-badge {
    background: var(--cft-sage);
    color: var(--cft-green);
    font-size: .75rem;
    padding: .25rem .6rem;
    border-radius: 20px;
}

/* -- Scheda lezione: sidebar sticky + lezioni correlate -------------------- */
/* La colonna acquisto resta fissa allo scroll solo su desktop (due colonne) */
@media (min-width: 992px) {
    .cft-lesson-aside {
        position: sticky;
        top: calc(var(--cft-navbar-h) + 1.5rem);
    }
}

.cft-related-item {
    display: flex;
    gap: .85rem;
    align-items: center;
    padding: .65rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background .2s ease;
}
.cft-related-item + .cft-related-item { margin-top: .35rem; }
.cft-related-item:hover { background: var(--cft-cream); }
.cft-related-thumb {
    width: 64px;
    height: 64px; /* quadrata: copertine salvate 1:1 */
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--cft-sage);
}
.cft-related-text { display: flex; flex-direction: column; min-width: 0; }
.cft-related-title {
    font-weight: 600;
    color: var(--cft-brown);
    line-height: 1.25;
}
.cft-related-desc {
    font-size: .82rem;
    color: #8a7f76;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: .15rem;
}

/* -- Sezioni --------------------------------------------------------------- */
.cft-section { padding: 8rem 0; }
.cft-section-alt { background: #fff; }

/* Fasce orizzontali tono su tono (rosa) per la home */
.cft-band-1 { background: var(--cft-cream); }   /* A - crema #fff4f4 */
.cft-band-2 { background: #fbe7eb; }             /* B - rosa chiarissimo */
.cft-band-3 { background: var(--cft-cream); }    /* A - crema #fff4f4 */
/* Padding extra dopo il blocco "Chi sono" */
.cft-about { padding-top: 7rem; padding-bottom: 7.5rem; }

/* -- Step "Come funziona" -------------------------------------------------- */
.cft-step {
    position: relative;
    height: 100%;
    text-align: center;
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 18px;
    padding: 2.75rem 1.5rem 2rem;
    transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.cft-step:hover {
    transform: translateY(-6px);
    background: #fff;
    box-shadow: 0 16px 36px rgba(174, 104, 122, .18);
}
.cft-step-icon {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cft-cream);
    color: var(--cft-rose);
    font-size: 2.1rem;
    box-shadow: inset 0 0 0 1px var(--cft-pink);
    transition: background-color .25s ease, color .25s ease;
}
.cft-step:hover .cft-step-icon {
    background: var(--cft-rose);
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--cft-rose);
}
.cft-step-num {
    position: absolute;
    top: -22px;
    left: -22px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--cft-rose);
    color: #fff;
    font-family: var(--cft-font-body);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 3px solid #fff;
    box-shadow: 0 6px 16px rgba(174, 104, 122, .3);
}
.cft-step h3 {
    color: var(--cft-rose-dark);
    margin-bottom: .5rem;
    font-size: 1.75rem;
}
.cft-section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--cft-rose);
}
.cft-section-title.text-md-start { margin-bottom: 1.25rem; }

/* Catalogo: area principale più ariosa, coerente con le altre pagine */
body.catalogo > main.cft-main > .container { padding-top: 7rem !important; padding-bottom: 7.5rem !important; }

/* -- Sezione "Chi sono" in home -------------------------------------------- */
.cft-about-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(174, 104, 122, .25);
}
@media (min-width: 768px) {
    .cft-about .cft-section-title { text-align: left; }
}

/* -- Gallery tre foto affiancate ------------------------------------------- */
.cft-gallery-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(174, 104, 122, .22);
    display: block;
}

/* -- Form / card auth ------------------------------------------------------ */
.cft-auth-card {
    max-width: 460px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(62, 47, 11, .08);
}
.form-control:focus, .form-select:focus {
    border-color: var(--cft-rose);
    box-shadow: 0 0 0 .2rem rgba(174, 104, 122, .15);
}

/* -- Pagina Contatti ------------------------------------------------------- */
.cft-contact { padding: 4rem 0 5rem; }
.cft-contact-aside {
    position: sticky;
    top: calc(var(--cft-navbar-h) + 1.5rem);
}
.cft-contact-aside .cft-section-title {
    text-align: left;
    margin-bottom: 1.25rem;
}
.cft-contact-lead {
    font-size: 1.1rem;
    color: var(--cft-brown);
    margin-bottom: 2rem;
}
.cft-contact-info { list-style: none; padding: 0; margin: 0; }
.cft-contact-info li {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1rem;
    color: var(--cft-brown);
}
.cft-contact-info i {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cft-cream);
    color: var(--cft-rose);
    font-size: 1.25rem;
    box-shadow: inset 0 0 0 1px var(--cft-pink);
}
.cft-contact-info a { color: var(--cft-brown); }
.cft-contact-info a:hover { color: var(--cft-rose); }
.cft-contact-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(62, 47, 11, .08);
}
@media (max-width: 991.98px) {
    .cft-contact { padding: 2.5rem 0 3rem; }
    .cft-contact-aside { position: static; margin-bottom: 2.5rem; }
    .cft-contact-card { padding: 1.75rem; }
}

/* -- Footer ---------------------------------------------------------------- */
.cft-footer {
    background: var(--cft-brown);
    color: var(--cft-cream);
}
.cft-footer .cft-brand { color: var(--cft-pink); }
.cft-logo-footer { height: 72px; width: auto; display: block; }
.cft-footer-links a { color: var(--cft-pink); display: block; padding: .15rem 0; }
.cft-footer-links a:hover { color: #fff; }

/* =============================================================================
   PANNELLO ADMIN
   ============================================================================= */
body.cft-admin { background: #f6f3ee; }
.cft-admin-sidebar {
    --bs-offcanvas-width: 260px;
    background: var(--cft-green);
}
/* La lista delle voci scorre, il footer resta fisso */
.cft-admin-sidebar .nav { overflow-y: auto; }

/* Da md in su: sidebar statica sempre visibile */
@media (min-width: 768px) {
    .cft-admin-sidebar {
        width: 260px;
        height: 100vh;
        position: sticky;
        top: 0;
        overflow: hidden;
        /* Bootstrap forza transparent su .offcanvas-md da md in su */
        background: var(--cft-green) !important;
    }
}

/* Hamburger nella topbar (solo mobile) */
.cft-admin-burger {
    font-size: 1.6rem;
    line-height: 1;
    color: var(--cft-green);
    border: 0;
}
.cft-admin-burger:hover { color: var(--cft-rose); }
.cft-admin-logo { font-family: var(--cft-font-title); font-size: 1.4rem; }
.cft-admin-sidebar .nav-link.active { background: var(--cft-rose); }
.cft-admin-sidebar .nav-link:hover { background: rgba(255, 255, 255, .12); }

/* Footer fisso della sidebar: link "Vai al sito" / "Esci" */
.cft-admin-userbox {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .15);
}
.cft-admin-footlink {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    border-radius: .5rem;
    color: rgba(255, 255, 255, .75);
    font-size: .9rem;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.cft-admin-footlink + .cft-admin-footlink { margin-top: .15rem; }
.cft-admin-footlink .bi { font-size: 1rem; opacity: .85; }
.cft-admin-footlink:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}
.cft-admin-footlink--logout:hover {
    background: var(--cft-rose);
    color: #fff;
}
.cft-admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e7e1d6;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.cft-admin-content { min-height: 100vh; }

@media (max-width: 768px) {
    /* Su mobile il badge col numero non deve uscire dallo schermo */
    .cft-step-num {
        top: -18px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    .cft-step { padding-top: 3.25rem; }
}

/* -- Timeline "Percorso formativo" ---------------------------------------- */
.cft-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
/* Linea verticale che collega i pallini */
.cft-timeline::before {
    content: "";
    position: absolute;
    top: .6rem;
    bottom: .6rem;
    left: 26px;
    width: 2px;
    background: var(--cft-pink);
}
.cft-tl-item {
    position: relative;
    padding: 0 0 2.5rem 4.75rem;
}
.cft-tl-item:last-child { padding-bottom: 0; }
.cft-tl-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cft-cream);
    color: var(--cft-rose);
    font-size: 1.4rem;
    box-shadow: inset 0 0 0 2px var(--cft-pink);
}
.cft-tl-title {
    color: var(--cft-rose-dark);
    font-size: 1.6rem;
    margin-bottom: .35rem;
}
.cft-tl-body p { margin-bottom: 0; }

/* Sottotitolo interno a un blocco "Chi sono" (es. "La mia esperienza") */
.cft-about-subtitle {
    color: var(--cft-rose);
    font-size: 1.75rem;
    margin: 1.75rem 0 .75rem;
}

/* -- Citazione in evidenza ------------------------------------------------- */
.cft-quote {
    position: relative;
    margin: 2rem auto 0;
    padding: .25rem 0 .25rem 1.5rem;
    border-left: 3px solid var(--cft-rose);
    font-family: var(--cft-font-title);
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--cft-rose-dark);
    text-align: left;
}
