/* =====================================================================
   LearnSNSI Academy - componenti di fruizione (tema chiaro)
   Avanzamento, schede corso, programma, player, quiz, login.
   ===================================================================== */

.panel.form-panel, .panel.content-block { padding: 1.6rem 1.8rem; margin-top: 1.1rem; }
.panel.content-block h2 { margin-top: 0; }
textarea.tall { min-height: 260px; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 400 !important; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--sea); }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form select { max-width: 320px; }
.log { font-size: .9rem; line-height: 1.7; color: var(--ink-2); }

.sidebar-logout-form { margin: 0; }
.sidebar-logout { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.15rem; padding: .3rem; border-radius: 8px; transition: color .2s, background .2s; }
.sidebar-logout:hover { color: var(--ocean); background: var(--accent-soft); }

/* ------------------------------------------------------------------ avanzamento */

.progress {
    position: relative;
    height: 10px;
    margin: 1rem 0 .5rem;
    border-radius: 999px;
    background: #e8eef4;
    overflow: hidden;
}

.progress-bar {
    position: relative;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: var(--grad);
    transition: width 1.2s var(--ease);
    animation: riempi 1.2s var(--ease) backwards;
}

/* riflesso che scorre sulla barra */
.progress-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
    background-size: 200% 100%;
    animation: riflesso 2.8s linear infinite;
}

@keyframes riempi { from { width: 0; } }
@keyframes riflesso { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.progress-label {
    position: absolute;
    right: 0;
    top: -1.35rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--ink-2);
}

.progress { margin-top: 1.6rem; overflow: visible; }
.progress-bar { overflow: hidden; }

/* ------------------------------------------------------------------ badge, tag, tab */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .38rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: .82rem;
    font-weight: 500;
}

.badge-ok { border-color: rgba(15, 157, 122, .3); background: var(--ok-soft); color: var(--ok); }

.tags { display: inline-flex; gap: .35rem; margin-left: auto; }
.tag { font-size: .7rem; padding: .18rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag-ok { color: var(--ok); border-color: rgba(15, 157, 122, .3); background: var(--ok-soft); }

.tabs {
    display: inline-flex;
    gap: .25rem;
    padding: .3rem;
    margin: 0 0 1.4rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    flex-wrap: wrap;
}

.tab {
    padding: .5rem 1.1rem;
    border-radius: 999px;
    color: var(--ink-2);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .25s var(--ease), color .25s var(--ease);
}

.tab:hover { background: var(--accent-soft); color: var(--ink); }
.tab.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(14, 127, 191, .25); }

/* ------------------------------------------------------------------ schede corso */

.course-card { padding: 0; overflow: hidden; }

.course-cover {
    position: relative;
    height: 96px;
    background: var(--grad);
    overflow: hidden;
}

/* onde animate sulla copertina */
.course-cover::before, .course-cover::after {
    content: "";
    position: absolute;
    left: -50%;
    width: 200%;
    height: 200%;
    border-radius: 42%;
    background: rgba(255, 255, 255, .14);
    animation: onda 14s linear infinite;
}

.course-cover::before { top: 55%; }
.course-cover::after { top: 62%; background: rgba(255, 255, 255, .22); animation-duration: 19s; animation-direction: reverse; }

@keyframes onda { to { transform: rotate(360deg); } }

.course-cover .percent {
    position: absolute;
    right: 1.1rem;
    top: .9rem;
    z-index: 1;
    font-family: var(--serif);
    font-size: 2.1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}

.course-cover .kicker-cover {
    position: absolute;
    left: 1.3rem;
    top: 1.05rem;
    z-index: 1;
    font-size: .66rem;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .92);
}

.course-card.done .course-cover { background: linear-gradient(120deg, #0b6e56, #0f9d7a 50%, #45c49d); }

.course-body { display: flex; flex-direction: column; flex: 1; padding: 1.2rem 1.4rem 1.3rem; }
.course-body h2 { margin: 0 0 .2rem; }
.course-body .progress { margin-top: 1.4rem; }
.course-meta { font-size: .88rem; color: var(--muted); margin: .2rem 0 0; }
.course-next {
    margin: .7rem 0 0;
    font-size: .88rem;
    color: var(--ink-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}
.course-next strong { font-weight: 500; }
.course-body .actions { margin-top: auto; padding-top: 1rem; margin-bottom: 0; }

/* ------------------------------------------------------------------ riprendi */

.resume-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.4rem;
    padding: 1.1rem 1.3rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid var(--line);
    backdrop-filter: blur(6px);
    flex-wrap: wrap;
}

.resume-box > div { flex: 1 1 280px; }
.resume-box strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }

/* ------------------------------------------------------------------ programma del corso */

.outline { display: flex; flex-direction: column; gap: .9rem; }

.outline-lesson {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.outline-lesson header { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; }
.outline-lesson.done header { background: linear-gradient(90deg, var(--ok-soft), transparent 60%); }
.outline-lesson.done .num { background: var(--ok-soft); color: var(--ok); }
.outline-lesson-title { flex: 1; }
.outline-lesson-title a, .outline-lesson-title strong { color: var(--ink); text-decoration: none; font-weight: 500; }
.outline-lesson-title a:hover { color: var(--ocean); }

.outline-lesson ul { list-style: none; margin: 0; padding: 0 1.2rem .6rem 4.2rem; }
.outline-lesson li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: .93rem; }
.outline-lesson li a { color: var(--ink); text-decoration: none; transition: color .2s; }
.outline-lesson li a:hover { color: var(--ocean); }
.outline-lesson li.locked, .list-row.locked { opacity: .5; }

.state {
    display: inline-flex;
    flex: 0 0 auto;
    width: 1.45rem;
    height: 1.45rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: .72rem;
}

.state-done { background: var(--ok); color: #fff; animation: pop .5s var(--ease) backwards; }
.state-open { border: 2px solid var(--sea); color: transparent; position: relative; }
.state-open::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sea); animation: pulsa 1.8s ease-in-out infinite; }
.state-locked { background: var(--surface-2); border: 1px solid var(--line); font-size: .62rem; }

@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulsa { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .5; } }

/* ------------------------------------------------------------------ player argomento */

.completion-box { padding: 1.3rem; margin-bottom: 1.2rem; box-shadow: none; background: var(--surface-2); }
.completion-box h2 { margin: 0 0 .6rem; font-size: 1.2rem; }
.requisiti { list-style: none; padding: 0; margin: 0 0 1.1rem; }
.requisiti li { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; color: var(--ink-2); font-size: .92rem; }
.requisiti li.ok { color: var(--ok); }
.requisiti li.ok::after { content: "✓"; margin-left: auto; font-weight: 600; }
.completion-box .btn { width: 100%; }

.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; box-shadow: none; filter: grayscale(.4); }

.locked-box .kicker { background: none; color: var(--warn); }

.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 2.4rem 0 1rem; flex-wrap: wrap; }
.step-nav > div { flex: 1 1 220px; }
.step-nav > div:last-child { text-align: right; }

.video-wrap { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; background: #0b1d2e; box-shadow: var(--shadow-2); }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.content-img { max-width: 100%; height: auto; border-radius: 12px; }
.content-audio { width: 100%; }

/* ------------------------------------------------------------------ quiz */

.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.quiz-timer {
    font-family: var(--serif);
    font-size: 2.4rem;
    font-weight: 600;
    padding: .3rem 1.2rem;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    font-variant-numeric: tabular-nums;
}

.quiz-timer.warning { color: var(--warn); border-color: rgba(183, 121, 31, .4); animation: pulsa-box 1s ease-in-out infinite; }
@keyframes pulsa-box { 50% { box-shadow: 0 0 0 6px rgba(183, 121, 31, .12); } }

.quiz-question { padding: 1.4rem 1.6rem; margin: 0 0 1.1rem; }
.quiz-question legend { padding: 0; margin-bottom: .2rem; }
.quiz-text { margin: .4rem 0 1rem; color: var(--ink); }
.quiz-text h1, .quiz-text h2, .quiz-text h3 { font-size: 1.2rem; font-family: var(--sans); font-weight: 500; margin: 0; }

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .85rem 1rem;
    margin: .5rem 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}

.quiz-option:hover { border-color: rgba(14, 127, 191, .45); transform: translateX(2px); }
.quiz-option input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--sea); flex: 0 0 auto; }
.quiz-option:has(input:checked) { border-color: var(--sea); background: linear-gradient(90deg, rgba(14, 127, 191, .08), rgba(23, 179, 193, .03)); box-shadow: 0 0 0 3px rgba(14, 127, 191, .08); }
.quiz-free { max-width: 520px; }

.result-hero.ok { border-color: rgba(15, 157, 122, .35); }
.result-hero.ok h1 { color: var(--ok); }
.result-hero.ko h1 { color: var(--warn); }

.quiz-review { padding: 1.1rem 1.3rem; margin: .8rem 0; border-left: 4px solid var(--line); }
.quiz-review.ok { border-left-color: var(--ok); }
.quiz-review.ko { border-left-color: var(--warn); }
.quiz-review p { margin: .4rem 0; color: var(--ink-2); }

.quiz-editor-question { padding: 1.3rem; margin-bottom: 1rem; }
.quiz-editor-answer { gap: .6rem; grid-template-columns: 1fr auto auto; }
.quiz-editor-answer input:not([type=checkbox]):not([type=hidden]) { flex: 1; }

/* ------------------------------------------------------------------ login */

.login-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
    background: #eaf1f7;
    position: relative;
}

/* acqua luminosa animata sullo sfondo */
.login-body::before {
    content: "";
    position: fixed;
    inset: -30%;
    background:
        radial-gradient(30% 35% at 25% 30%, rgba(23, 179, 193, .35), transparent 70%),
        radial-gradient(28% 32% at 75% 25%, rgba(14, 127, 191, .30), transparent 70%),
        radial-gradient(35% 40% at 55% 85%, rgba(11, 79, 138, .22), transparent 70%);
    animation: caustiche 18s ease-in-out infinite alternate;
}

/* bolle */
.login-body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 12% 90%, rgba(255, 255, 255, .8) 0 3px, transparent 4px),
        radial-gradient(circle at 22% 70%, rgba(255, 255, 255, .7) 0 2px, transparent 3px),
        radial-gradient(circle at 80% 95%, rgba(255, 255, 255, .8) 0 4px, transparent 5px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .6) 0 2px, transparent 3px),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, .7) 0 3px, transparent 4px);
    animation: bolle 12s linear infinite;
    pointer-events: none;
}

@keyframes bolle { from { transform: translateY(20%); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-60%); opacity: 0; } }

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    padding: 2.4rem 2.2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 30px 80px rgba(11, 45, 80, .18);
    animation: sale .7s var(--ease) backwards;
}

.login-brand { padding: 0 0 1.4rem; }
.login-card h1 { margin: 0 0 .3rem; font-size: 2.2rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.4rem; }
.login-submit { width: 100%; padding: .9rem; font-size: 1rem; }
.login-foot { margin-top: 1.6rem; font-size: .9rem; }

/* ------------------------------------------------------------------ responsive */

.topbar .top-link { white-space: nowrap; }

@media (max-width: 760px) {
    .outline-lesson ul { padding-left: 1.2rem; }
    .tags { display: none; }
    .step-nav > div:last-child { text-align: left; }
    .tabs { display: flex; border-radius: 16px; }
}

@media (max-width: 520px) {
    .topbar .top-link { display: none; }
    .topbar > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* legenda del quiz dentro la scheda, non sul bordo */
.quiz-question legend { float: left; width: 100%; margin-bottom: .4rem; }
.quiz-question legend + * { clear: both; }
.resume-box .kicker { display: block; margin-bottom: .2rem; }

/* schede numeriche della dashboard */
.dash-card .big {
    font-family: var(--serif);
    font-size: 3.2rem;
    font-weight: 600;
    line-height: 1;
    margin-top: auto;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.dash-card .big small { font-size: 1rem; font-family: var(--sans); font-weight: 500; color: var(--muted); -webkit-text-fill-color: var(--muted); margin-left: .4rem; }

/* ------------------------------------------------------------------ import LearnDash */

.opzioni-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .7rem 1.6rem; margin: .4rem 0 1.2rem; }
.import-table .row-lezione td { background: var(--surface-2); font-weight: 600; color: var(--ink); }
.import-table .row-lezione td:first-child { border-left: 3px solid var(--sea); }
.import-table .indent { padding-left: 1.4rem; position: relative; }
.import-table .indent::before { content: ""; position: absolute; left: .45rem; top: .1rem; bottom: .1rem; width: 1px; background: var(--line-strong); }
.import-table td span.muted.small { display: block; font-weight: 400; margin-top: .1rem; }
.small { font-size: .84rem; }
.avviso { color: var(--warn); }
.avviso::before { content: "⚠ "; }
.cell-actions { text-align: right; white-space: nowrap; }

.azione { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; border: 1px solid transparent; white-space: nowrap; }
.azione-crea { color: #fff; background: var(--grad); box-shadow: 0 4px 12px rgba(14, 127, 191, .25); }
.azione-aggiorna { color: var(--warn); background: rgba(183, 121, 31, .1); border-color: rgba(183, 121, 31, .28); }
.azione-collega { color: var(--sea); background: var(--accent-soft); border-color: rgba(14, 127, 191, .28); }
.azione-invariato { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.azione-salta { color: var(--danger); background: rgba(194, 65, 59, .08); border-color: rgba(194, 65, 59, .25); }

.import-esito details { margin-top: 1rem; }
.import-esito summary { cursor: pointer; color: var(--sea); font-weight: 500; }
.import-esito .stats { margin: .8rem 0 1rem; }
