/* ── Vigilanzi E-Commerce — brand variables ─────────────────────────────── */
:root {
    --vg-yellow:      #FFD700;
    --vg-yellow-dark: #e6c200;
    --vg-navy:        #1a2540;
    --vg-navy-light:  #223060;
    --vg-white:       #ffffff;
    --vg-bg:          #f5f6fa;
    --vg-text:        #1a2540;
    --vg-text-light:  #6b7280;
    --vg-border:      #e5e7eb;
    --vg-radius:      10px;
    --vg-shadow:      0 2px 12px rgba(26,37,64,0.09);
}

/* ── Layout pubblico ─────────────────────────────────────────────────────── */
.vg-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    background: var(--vg-bg);
    color: var(--vg-text);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.vg-header {
    background: var(--vg-navy);
    padding: 0 1.5rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    position: sticky;
    top: 0;
    z-index: 100;
}

.vg-header__logo img {
    height: 44px;
    width: auto;
    filter: brightness(0) invert(1);
}

.vg-header__logo-text {
    color: var(--vg-yellow);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    line-height: 1;
}

.vg-header__nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.vg-header__link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.15s;
}
.vg-header__link:hover { color: var(--vg-yellow); }

.vg-header__cta {
    background: var(--vg-yellow);
    color: var(--vg-navy);
    font-weight: 700;
    padding: 0.45rem 1.1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.vg-header__cta:hover { background: var(--vg-yellow-dark); color: var(--vg-navy); }

@media (max-width: 480px) {
    .vg-header { padding: 0 1rem; }
    .vg-header__logo-text { font-size: 0.92rem; }
    .vg-header__link { display: none; } /* ridondante: il logo porta già al catalogo */
    .vg-header__nav { gap: 0.5rem; }
    .vg-header__cta { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
}

/* ── Main content ────────────────────────────────────────────────────────── */
.vg-main { flex: 1; padding: 2rem 1rem 3rem; }

.vg-container {
    max-width: 1160px;
    margin: 0 auto;
}

/* ── Hero banner ─────────────────────────────────────────────────────────── */
.vg-hero {
    background: var(--vg-navy);
    color: var(--vg-white);
    padding: 3rem 2rem;
    border-radius: var(--vg-radius);
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.vg-hero::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 200px;
    height: 200px;
    background: var(--vg-yellow);
    opacity: 0.08;
    border-radius: 50%;
}

.vg-hero__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--vg-yellow);
}

.vg-hero__subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.92);
}

.vg-hero__badge {
    display: inline-block;
    background: var(--vg-yellow);
    color: var(--vg-navy);
    font-weight: 700;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

/* ── Chip categoria ──────────────────────────────────────────────────────── */
.vg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.vg-tab {
    padding: 0.45rem 1.1rem;
    border-radius: 20px;
    border: 2px solid var(--vg-border);
    background: var(--vg-white);
    color: var(--vg-text-light);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}

.vg-tab:hover, .vg-tab--active {
    border-color: var(--vg-navy);
    background: var(--vg-navy);
    color: var(--vg-white);
}

.vg-tab--active:hover { background: var(--vg-navy-light); }

/* ── Card corso ──────────────────────────────────────────────────────────── */
.vg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.vg-card {
    background: var(--vg-white);
    border-radius: var(--vg-radius);
    box-shadow: var(--vg-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.15s;
    text-decoration: none;
    color: inherit;
}

.vg-card:hover {
    box-shadow: 0 6px 24px rgba(26,37,64,0.15);
    transform: translateY(-2px);
}

.vg-card__image {
    height: 180px;
    object-fit: cover;
    width: 100%;
    background: var(--vg-navy);
}

.vg-card__image--placeholder {
    height: 180px;
    background: linear-gradient(135deg, var(--vg-navy) 0%, var(--vg-navy-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.vg-card__body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }

.vg-card__category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vg-navy);
    background: rgba(230, 194, 0, 0.18);
    border: 1px solid var(--vg-yellow-dark);
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.vg-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0d1626;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

/* Reset colore link MudBlazor/browser per card cliccabili */
a.vg-card,
a.vg-card:link,
a.vg-card:visited,
a.vg-card:hover,
a.vg-card:active {
    color: var(--vg-text) !important;
    text-decoration: none !important;
}

a.vg-card .vg-card__title,
a.vg-card:link .vg-card__title,
a.vg-card:visited .vg-card__title {
    color: #0d1626 !important;
}

a.vg-card .vg-card__meta {
    color: var(--vg-text-light) !important;
}

.vg-card__meta {
    font-size: 0.85rem;
    color: var(--vg-text-light);
    margin-bottom: 0.8rem;
    flex: 1;
}

.vg-card__footer {
    border-top: 1px solid var(--vg-border);
    padding-top: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vg-card__price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--vg-navy);
}

.vg-card__price-sub {
    font-size: 0.78rem;
    color: var(--vg-text-light);
    font-weight: 400;
}

.vg-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}
.vg-badge--green { background: #d1fae5; color: #065f46; }
.vg-badge--yellow { background: #fef3c7; color: #92400e; }
.vg-badge--red { background: #fee2e2; color: #991b1b; }

/* ── Pulsanti ────────────────────────────────────────────────────────────── */
.vg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
}

.vg-btn--primary {
    background: var(--vg-yellow);
    color: var(--vg-navy);
}
.vg-btn--primary:hover { background: var(--vg-yellow-dark); }

.vg-btn--outline {
    background: transparent;
    color: var(--vg-navy);
    border: 2px solid var(--vg-navy);
}
.vg-btn--outline:hover { background: var(--vg-navy); color: var(--vg-white); }

.vg-btn--lg { padding: 0.9rem 2rem; font-size: 1.1rem; }
.vg-btn--full { width: 100%; justify-content: center; }
.vg-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Dettaglio corso ─────────────────────────────────────────────────────── */
.vg-detail-header {
    background: var(--vg-navy);
    border-radius: var(--vg-radius);
    overflow: hidden;
    margin-bottom: 2rem;
}

.vg-detail-header__image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.vg-detail-header__placeholder {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, var(--vg-navy) 0%, #2d4080 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.vg-detail-header__body {
    padding: 1.5rem 2rem;
    color: var(--vg-white);
}

.vg-detail-header__title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--vg-yellow);
}

.vg-detail-header__sub {
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
}

/* ── Info box ────────────────────────────────────────────────────────────── */
.vg-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.vg-info-box {
    background: var(--vg-white);
    border-radius: var(--vg-radius);
    box-shadow: var(--vg-shadow);
    padding: 1.2rem;
    text-align: center;
}

.vg-info-box__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vg-text-light);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.vg-info-box__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vg-navy);
}

/* ── Moduli accordion ────────────────────────────────────────────────────── */
.vg-moduli { margin-bottom: 2rem; }

.vg-modulo {
    background: var(--vg-white);
    border-radius: var(--vg-radius);
    box-shadow: var(--vg-shadow);
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.vg-modulo__header {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    cursor: pointer;
    gap: 0.8rem;
}

.vg-modulo__num {
    width: 32px;
    height: 32px;
    background: var(--vg-navy);
    color: var(--vg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.vg-modulo__title {
    font-weight: 600;
    color: var(--vg-navy);
    flex: 1;
}

.vg-modulo__ore {
    font-size: 0.85rem;
    color: var(--vg-text-light);
    white-space: nowrap;
}

.vg-modulo__body {
    padding: 0 1.2rem 1rem;
    font-size: 0.9rem;
    color: var(--vg-text-light);
    border-top: 1px solid var(--vg-border);
}

/* ── Layout a due colonne (dettaglio corso / checkout) ──────────────────── */
.vg-detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.vg-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .vg-detail-layout,
    .vg-checkout-layout {
        grid-template-columns: 1fr;
    }
    /* la colonna con CTA/riepilogo passa per prima visivamente (senza toccare il DOM) */
    .vg-detail-layout > *:last-child,
    .vg-checkout-layout > *:last-child {
        order: -1;
    }
    .vg-cta-box { position: static; }
}

/* ── CTA sticky ──────────────────────────────────────────────────────────── */
.vg-cta-box {
    background: var(--vg-white);
    border-radius: var(--vg-radius);
    box-shadow: var(--vg-shadow);
    padding: 1.5rem;
    position: sticky;
    top: 84px;
}

.vg-cta-box__price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--vg-navy);
    margin-bottom: 0.2rem;
}

.vg-cta-box__acconto {
    font-size: 0.9rem;
    color: var(--vg-text-light);
    margin-bottom: 1rem;
}

.vg-cta-box__posti {
    font-size: 0.85rem;
    color: #065f46;
    background: #d1fae5;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: inline-block;
    font-weight: 600;
}

.vg-cta-box__posti--esauriti {
    color: #991b1b;
    background: #fee2e2;
}

/* ── Form checkout ───────────────────────────────────────────────────────── */
.vg-form { display: flex; flex-direction: column; gap: 1rem; }

.vg-field { display: flex; flex-direction: column; gap: 0.3rem; }
.vg-field label { font-size: 0.9rem; font-weight: 600; color: var(--vg-text); }
.vg-field input {
    padding: 0.7rem 1rem;
    border: 2px solid var(--vg-border);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
    background: var(--vg-white);
    color: var(--vg-text);
}
.vg-field input:focus { border-color: var(--vg-navy); }
.vg-field--error input { border-color: #dc2626; }
.vg-field__error { font-size: 0.8rem; color: #dc2626; }

.vg-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .vg-form-grid { grid-template-columns: 1fr; }
    .vg-hero { padding: 1.75rem 1.25rem; margin-bottom: 1.5rem; }
    .vg-hero__title { font-size: 1.5rem; }
    .vg-hero__subtitle { font-size: 0.95rem; }
    .vg-detail-header__title { font-size: 1.3rem; }
    .vg-detail-header__body { padding: 1.2rem 1.25rem; }
    .vg-detail-header__image,
    .vg-detail-header__placeholder { height: 190px; }
    .vg-grid { grid-template-columns: 1fr; }
    .vg-page-title { font-size: 1.3rem; }
}

/* ── Checkout riepilogo ──────────────────────────────────────────────────── */
.vg-riepilogo {
    background: var(--vg-navy);
    color: var(--vg-white);
    border-radius: var(--vg-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.vg-riepilogo__title { font-size: 0.85rem; opacity: 0.7; margin-bottom: 0.3rem; }
.vg-riepilogo__corso { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.8rem; }
.vg-riepilogo__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.vg-riepilogo__total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    padding-top: 0.7rem;
    color: var(--vg-yellow);
}

/* ── Successo / Annullato ────────────────────────────────────────────────── */
.vg-result-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vg-result-box {
    background: var(--vg-white);
    border-radius: 16px;
    box-shadow: var(--vg-shadow);
    padding: 3rem 2.5rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.vg-result-box__icon { font-size: 4rem; margin-bottom: 1rem; }
.vg-result-box__title { font-size: 1.6rem; font-weight: 700; color: var(--vg-navy); margin-bottom: 0.6rem; }
.vg-result-box__text { color: var(--vg-text-light); margin-bottom: 1.8rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.vg-footer {
    background: var(--vg-navy);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.85rem;
    margin-top: auto;
}

.vg-footer a { color: var(--vg-yellow); text-decoration: none; }
.vg-footer a:hover { text-decoration: underline; }

/* ── Titolo pagina ───────────────────────────────────────────────────────── */
.vg-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--vg-navy);
    margin-bottom: 1.5rem;
}

/* ── Sezione titolo ──────────────────────────────────────────────────────── */
.vg-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vg-navy);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--vg-yellow);
    display: inline-block;
}

.vg-alert {
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.vg-alert--error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.vg-alert--info  { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Descrizione ricca ───────────────────────────────────────────────────── */
.vg-descrizione {
    white-space: pre-line;
    line-height: 1.85;
    color: var(--vg-text-light);
    font-size: 0.98rem;
    margin-bottom: 2rem;
}

/* ── Blocchi PDF (regolamento + calendario) ──────────────────────────────── */
.vg-btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--vg-navy);
    color: #fff;
    padding: 0.65rem 1.3rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: background 0.15s;
}
.vg-btn-pdf:hover { background: var(--vg-navy-light); color: #fff; }

/* ── Card PDF scaricabile ────────────────────────────────────────────────── */
.vg-pdf-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--vg-white);
    border: 2px solid var(--vg-border);
    border-radius: var(--vg-radius);
    padding: 1.1rem 1.4rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.vg-pdf-card:hover {
    border-color: var(--vg-navy);
    box-shadow: var(--vg-shadow);
}

.vg-pdf-card__icon { font-size: 2rem; flex-shrink: 0; }

.vg-pdf-card__body { flex: 1; }

.vg-pdf-card__name {
    font-weight: 700;
    color: var(--vg-navy);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.vg-pdf-card__note {
    font-size: 0.8rem;
    color: var(--vg-text-light);
}

.vg-pdf-card__cta {
    background: var(--vg-navy);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.vg-pdf-card:hover .vg-pdf-card__cta { background: var(--vg-navy-light); }

.vg-disclaimer {
    color: var(--vg-text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
