@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Sora:wght@400;600;700;800&display=swap');

:root {
    /* Colori principali */
    --teal: #00C896;
    --teal-dark: #00A87E;
    --teal-light: #E6FBF5;
    --red: #E8324A;
    --red-dark: #CC2A3F;
    --red-light: #FEF0F2;
    --gold: #F5A623;
    --gold-dark: #D4901E;
    --gold-light: #FEF8EC;

    --lavander: #727cf5;
    --lavander-dark: #4856f1;
    --grey-dark: #38404a;
    --grey-darker: #171c23;

    /* Layout */
    --bg: #F4F6FB;
    --card: #FFFFFF;
    --border: #E4E9F2;
    --muted: #6B7A99;
    --muted2: #9AA3BA;
    --text: #1A2332;
    --text-light: #4A5568;

    /* Dimensioni */
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;

    --text: 15px;
    --text-large: 18px;
    --text-large-modal: 22px;

    /* Ombre */
    --shadow-sm: 0 1px 3px rgba(15, 37, 81, 0.06);
    --shadow: 0 2px 8px rgba(15, 37, 81, 0.08);
    --shadow-lg: 0 4px 16px rgba(15, 37, 81, 0.12);
}

/* ============================================
   BASE
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--teal-dark);
}

/* ============================================
   TIPOGRAFIA UTILITY
   ============================================ */

.font-mono {
    font-family: 'DM Mono', monospace;
}

.fw-600 {
    font-weight: 600;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash-container {
    position: fixed;

    bottom: 20px;
    right: 20px;

    z-index: 9999;

    display: flex;
    flex-direction: column;

    gap: 12px;

    align-items: flex-end;
}

.flash-message {
    padding: 14px 20px;

    border-radius: var(--radius-sm);

    font-size: 14px;
    font-weight: 500;

    display: flex;
    align-items: center;
    gap: 10px;

    background: white;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

    max-width: 400px;

    animation: flashIn 0.3s ease;
}

.flash-error {
    background: var(--red-light);
    color: #8B1A2B;
    border: 1px solid rgba(232, 50, 74, 0.2);
}

@keyframes flashIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   FORM
   ============================================ */

.form-label-si {
    font-size: var(--text);
    font-weight: 600;
    color: var(--grey-dark);
    margin-bottom: 6px;
    display: block;
}

.form-control-si {
    width: 100% !important;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: var(--text);
}

.form-control-si:focus {
    outline: none;
    border-color: var(--lavander);
    box-shadow: 0 0 0 2px rgba(114, 124, 245, 0.3);
}

.form-control-si.is-invalid {
    border-color: var(--red);
}

.invalid-feedback {
    font-size: 12px;
    color: var(--red);
    margin-top: 4px;
}

.form-input-inline {
    display: inline-block !important;
    justify-content: start;
}

/*Override selettore prefisso telefonico*/
.iti {
    width: 100%;
}

/* Angoli sinistri del selettore prefisso arrotondati come l'input (8px), cosi' l'alone
   di focus segue la curva del campo invece di uscire rettangolare. Doppia classe per
   vincere su .iti__selected-country{border-radius:0} di intl-tel-input (caricato dopo). */
.iti .iti__selected-country {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

/* Focus da tastiera sul selettore prefisso (button bandiera): stesso bordo/alone
   lavanda degli input, al posto del contorno arancione di default del browser */
.iti__selected-country:focus {
    outline: none;
    border-color: var(--lavander);
    box-shadow: 0 0 0 2px rgba(114, 124, 245, 0.3);
}

.iti__search-input {
    outline: none;
    border-color: var(--lavander);
    box-shadow: 0 0 0 2px rgba(114, 124, 245, 0.3);
}

/* ============================================
   BOTTONI
   ============================================ */

.btn-si {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-si:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary {
    color: #ffffff;
    background-color: var(--lavander);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
    color: #ffffff;
    background-color: var(--lavander-dark);
}

.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
    background-color: var(--lavander);
}

.btn-primary:hover {
    background: var(--lavander-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--muted2);
    color: #fff;
}

.btn-secondary:hover {
    background: var(--muted);
    color: #fff;
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--text-large);
}

/* ============================================
   LOGO
   ============================================ */

.logo {
    max-width: 50%;
    margin-bottom: 1%;
    display: flex;
    justify-content: center;
}

.logo img {
    width: 100%;
}

/* ============================================
   AUTH LAYOUT
   ============================================ */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--grey-dark) 0%, var(--grey-darker) 100%);
    padding: 20px;
    flex-direction: column;
}

.auth-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 50%;
    padding: 40px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand h1 {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 28px;
    color: var(--grey-dark);
    margin: 0;
}

.auth-card a {
    color: var(--lavander);
}

.auth-card a:hover {
    color: var(--lavander-dark);
}

/* ============================================
   MISC UTILITIES
   ============================================ */

.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* ============================================
   MODALE
   ============================================ */

.modal {
    height: 100%;
}

.modal-body {
    font-size: var(--text);
    color: var(--grey-dark);
    text-align: center;
}

.modal-header {
    justify-content: center;
}

.modal-header h5 {
    font-size: var(--text-large-modal);
}

.modal-footer {
    justify-content: center;
}

.modal-footer button {
    font-size: var(--text-large);
}

/* ============================================
   PAGINA DI CONFERMA RICHIESTA
   ============================================ */

.success-page {
    text-align: center;
}

/* Il bottone e' un <a>: senza questa regola .auth-card a (color lavanda) vincerebbe
   su .btn-primary, rendendo il testo lavanda invisibile sullo sfondo lavanda. */
.success-page a.btn-si,
.success-page a.btn-si:hover {
    color: #fff;
}

.success-icon {
    font-size: 64px;
    line-height: 1;
    color: var(--teal);
    margin-bottom: 16px;
}

.success-request-id {
    display: inline-block;
    margin-bottom: 16px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--teal-light);
    color: var(--teal-dark);
    font-weight: 600;
    font-size: 14px;
}

.success-text {
    color: var(--text-light);
    font-size: var(--text);
    margin: 0 auto 16px;
    max-width: 460px;
}

.success-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.success-email .bi {
    color: var(--lavander);
}

/* Timeline "Cosa succede ora" */
.success-steps {
    text-align: left;
    max-width: 460px;
    margin: 0 auto;
}

.success-steps-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--grey-dark);
    margin-bottom: 16px;
    text-align: center;
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
}

.step {
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
    position: relative;
}

/* Linea verticale che collega gli step */
.step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.step-marker {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    z-index: 1;
}

.step-done .step-marker {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.step-body {
    display: flex;
    flex-direction: column;
    padding-top: 4px;
}

.step-title {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.step-desc {
    color: var(--muted);
    font-size: 13px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 576px) {
    .auth-card {
        max-width: 90% !important;
    }
}