/**
 * File: assets/css/custom.css
 * CSS Custom - Conforme AGID
 * Stili personalizzati per Progetto Autoimpiego
 * Versione: 1.0.0
 */

/* ========================================
   VARIABILI CSS (Custom Properties)
   ======================================== */

:root {
    /* Colori Primari PA */
    --primary-color: #0066CC;
    --primary-dark: #004080;
    --primary-light: #3385D6;
    
    /* Colori Secondari */
    --secondary-color: #00C5CA;
    --accent-color: #FFD700;
    
    /* Colori Stato */
    --success-color: #008758;
    --error-color: #D9364F;
    --warning-color: #A66300;
    --info-color: #0073E6;
    
    /* Colori Testo */
    --text-primary: #17324D;
    --text-secondary: #5C6F82;
    --text-disabled: #A5ACB3;
    
    /* Colori Background */
    --bg-white: #FFFFFF;
    --bg-light: #F5F5F5;
    --bg-lighter: #FAFAFA;
    --bg-primary: var(--primary-color);
    
    /* Bordi */
    --border-color: #E6ECEF;
    --border-light: #F0F0F0;
    --border-radius: 4px;
    
    /* Spaziature */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-xxl: 3rem;     /* 48px */
    
    /* Ombre */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    
    /* Transizioni */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========================================
   RESET E BASE
   ======================================== */

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

body {
    color: var(--text-primary);
    background-color: var(--bg-white);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus visibile per accessibilità */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   SKIP LINK (Accessibilità WCAG)
   ======================================== */

.skip-to-main-content {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--border-radius) 0;
    transition: top var(--transition-fast);
}

.skip-to-main-content:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: -4px;
}

/* ========================================
   TIPOGRAFIA
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Link esterni - icona */
a[target="_blank"]::after {
    content: "";
    display: inline-block;
    width: 0.875em;
    height: 0.875em;
    margin-left: 0.25em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230066CC'%3E%3Cpath d='M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    vertical-align: middle;
}

/* ========================================
   LAYOUT HELPERS
   ======================================== */

.container-custom {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.section-spacing {
    padding-top: var(--spacing-xxl);
    padding-bottom: var(--spacing-xxl);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* ========================================
   CARDS E BOXES
   ======================================== */

.card-custom {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.card-custom:hover {
    box-shadow: var(--shadow-md);
}

.card-custom-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-color);
}

/* ========================================
   ALERTS E MESSAGGI
   ======================================== */

.alert-custom {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-custom-success {
    background-color: #E8F5E9;
    border-left-color: var(--success-color);
    color: #1B5E20;
}

.alert-custom-error {
    background-color: #FFEBEE;
    border-left-color: var(--error-color);
    color: #B71C1C;
}

.alert-custom-warning {
    background-color: #FFF3E0;
    border-left-color: var(--warning-color);
    color: #E65100;
}

.alert-custom-info {
    background-color: #E3F2FD;
    border-left-color: var(--info-color);
    color: #0D47A1;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-custom {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-custom-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-custom-primary:hover,
.btn-custom-primary:focus {
    background-color: var(--primary-dark);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-custom-secondary {
    background-color: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-custom-secondary:hover,
.btn-custom-secondary:focus {
    background-color: var(--border-color);
}

/* ========================================
   ACCESSIBILITÀ
   ======================================== */

/* Nascondi visualmente ma mantieni per screen reader */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========================================
   FOOTER PERSONALIZZAZIONI
   ======================================== */

/* Titoli sezioni footer */
.it-footer .footer-heading-title,
.footer-heading-title {
    color: #BDF !important;
}

/* Link nel footer */
.it-footer a,
.it-footer .footer-list a,
.it-footer .link-list a,
.it-footer .it-footer-small-prints-list a {
    color: #b1d8ff !important;
}

.it-footer a:hover,
.it-footer a:focus,
.it-footer .footer-list a:hover,
.it-footer .link-list a:hover,
.it-footer .it-footer-small-prints-list a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .section-spacing {
        padding-top: var(--spacing-xl);
        padding-bottom: var(--spacing-xl);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    thead {
        display: table-header-group;
    }
    
    tr,
    img {
        page-break-inside: avoid;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
}
