/* Stili generali per il sito */
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000;  /* Sfondo completamente nero (default) */
    color: #fff;  /* Testo bianco */
    font-size: clamp(15px, 0.24vw + 14px, 17px);
    line-height: 1.45;
}

:root {
    --rd-btn-min-h: 46px;
    --rd-btn-radius: 999px;
    --rd-btn-pad-y: clamp(10px, 0.65vw, 13px);
    --rd-btn-pad-x: clamp(16px, 1.35vw, 24px);
    --rd-btn-font: clamp(0.94rem, 0.35vw + 0.84rem, 1.02rem);
    --rd-btn-min-w: clamp(148px, 14vw, 210px);
    --rd-section-gap: clamp(14px, 1.2vw, 24px);
}

/* Breakpoint matrix: 375 / 768 / 1024 / 1440 */
@media (max-width: 375px) {
    :root {
        --rd-btn-min-h: 44px;
        --rd-btn-pad-y: 10px;
        --rd-btn-pad-x: 14px;
        --rd-btn-font: 0.93rem;
        --rd-btn-min-w: 0;
    }

    body {
        font-size: 15px;
    }
}

@media (min-width: 376px) and (max-width: 768px) {
    :root {
        --rd-btn-min-h: 46px;
        --rd-btn-pad-y: 11px;
        --rd-btn-pad-x: 16px;
        --rd-btn-font: 0.96rem;
        --rd-btn-min-w: 0;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --rd-btn-min-h: 47px;
        --rd-btn-pad-y: 11px;
        --rd-btn-pad-x: 19px;
        --rd-btn-font: 0.98rem;
        --rd-btn-min-w: 156px;
    }
}

@media (min-width: 1440px) {
    :root {
        --rd-btn-min-h: 50px;
        --rd-btn-pad-y: 12px;
        --rd-btn-pad-x: 24px;
        --rd-btn-font: 1.03rem;
        --rd-btn-min-w: 184px;
    }

    body {
        font-size: 17px;
    }
}

button,
input,
select,
textarea {
    font: inherit;
}

/* ================= NAVBAR ================= */
.navbar {
    background:
        linear-gradient(180deg, rgba(22, 27, 37, 0.72) 0%, rgba(18, 23, 33, 0.56) 100%);
    color: #dbe4f5;
    padding: 10px 0;
    text-align: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(195, 222, 255, 0.18);
    box-shadow: 0 10px 30px rgba(2, 8, 20, 0.24), inset 0 1px 0 rgba(255,255,255,0.16);
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    transition: background-color 0.25s ease, backdrop-filter 0.25s ease, box-shadow 0.25s ease;
}

.navbar.scrolled {
    background-color: rgba(15, 22, 35, 0.82);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 12px 36px rgba(2, 8, 20, 0.38), inset 0 1px 0 rgba(255,255,255,0.12);
}

.navbar .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar nav {
    width: 100%;
}

/* SOLO la lista principale della navbar è flex (robusto anche con wrapper) */
.navbar nav > ul,
.navbar nav > * > ul {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0;
    padding: 0;
    width: 100%;
}

.navbar nav ul li.country-lang-dropdown {
    margin-left: auto;
    order: 2;
}

.navbar nav ul li.account-menu {
    order: 1;
    margin-left: 10px;
}

.navbar nav ul li.navbar-logo {
    order: 0;
    margin-left: 0;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
}

.navbar nav ul li.navbar-logo a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #f3f5f8;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: color 0.2s ease, filter 0.2s ease;
}

.navbar nav ul li.navbar-logo a:hover {
    color: #ffffff;
    background: transparent;
    filter: drop-shadow(0 0 6px rgba(183, 220, 255, 0.55));
    box-shadow: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.navbar nav ul li.dropdown {
    margin-left: 0;
}

.navbar nav ul li a {
    color: #d2dceb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 540;
    letter-spacing: 0.01em;
    transition: color 0.22s ease, text-shadow 0.22s ease;
}

.navbar nav ul li a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(183, 220, 255, 0.28);
}

/* Stato non loggato: icona accedi (senza pill/cornice) */
.navbar nav ul li#account-menu > a:not(.dropbtn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #f3f5f8;
    transition: color 0.2s ease, filter 0.2s ease;
    box-shadow: none;
}

.navbar nav ul li#account-menu > a:not(.dropbtn):hover {
    background: transparent;
    border-color: transparent;
    color: #ffffff;
    filter: drop-shadow(0 0 6px rgba(183, 220, 255, 0.55));
    text-shadow: none;
}

/* ============== DROPDOWN NAVBAR (FA fisso, liquid glass, scoped) ============== */
.navbar .dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.navbar .dropbtn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.25s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.navbar .dropbtn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}

/* Iniziali utente: bottone circolare */
.navbar li#account-menu .dropbtn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    letter-spacing: 0;
    background: transparent;
    border: 1px solid currentColor;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.navbar li#account-menu .dropbtn:hover,
.navbar li#account-menu.dropdown.open .dropbtn {
    background: rgba(127, 127, 127, 0.12);
}

/* Selettore paese/lingua: icona globo, senza cornice */
.navbar .country-lang-dropdown .dropbtn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #f3f5f8;
    letter-spacing: 0;
    text-transform: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: color 0.2s ease, filter 0.2s ease;
}

.navbar .country-lang-dropdown .dropbtn:hover {
    background: transparent;
    border-color: transparent;
    color: #ffffff;
    filter: drop-shadow(0 0 6px rgba(183, 220, 255, 0.55));
}

.navbar .country-lang-dropdown .site-lang-globe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.navbar .country-lang-dropdown .site-lang-globe svg {
    display: block;
}

/* Menu “liquid glass” flottante e allineato al bottone */
.navbar .dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 180px;
    text-align: left;
    z-index: 1001;

    /* Liquid glass */
    background: rgba(20,20,22,0.55);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
    padding: 8px 10px;
    list-style: none;

    animation: rdFadeDown 0.22s ease-out both;
}

@keyframes rdFadeDown {
    from { opacity: 0; margin-top: -8px; }
    to   { opacity: 1; margin-top: 0; }
}

/* Mostra su hover/focus solo per dropdown non account */
.navbar .dropdown:not(#account-menu):hover .dropdown-content,
.navbar .dropdown:not(#account-menu):focus-within .dropdown-content {
    display: block;
}

/* Supporto apertura via click (.open) usato da session.js */
.navbar .dropdown.open .dropdown-content {
    display: block;
}

/* Allinea il menu profilo sotto il bottone iniziali */
.navbar li#account-menu.dropdown .dropdown-content {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: max-content;
    width: max-content;
    padding: 6px 8px;
    background: linear-gradient(180deg, rgba(22, 27, 37, 0.98), rgba(18, 23, 33, 0.98));
    border: 1px solid rgba(195, 222, 255, 0.24);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 14px 30px rgba(2, 8, 20, 0.48);
}

.navbar li#account-menu.dropdown .dropdown-content a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}

.country-overlay {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 18, 0.84);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.country-overlay.active {
    visibility: visible;
    opacity: 1;
}

.country-overlay-panel {
    position: relative;
    width: min(900px, calc(100vw - 48px));
    margin: 0 auto;
    background: rgba(12, 18, 28, 0.96);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 30px;
    box-shadow: 0 35px 120px rgba(0,0,0,0.45);
    padding: 36px;
    transform: translateY(24px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.country-overlay.active .country-overlay-panel {
    transform: translateY(0);
    opacity: 1;
}

.country-overlay-backdrop {
    position: absolute;
    inset: 0;
}

.overlay-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.overlay-close:hover {
    background: rgba(255,255,255,0.14);
    transform: scale(1.05);
}

.overlay-header {
    text-align: center;
    margin-bottom: 32px;
}

.overlay-header h2 {
    font-size: clamp(2rem, 2.6vw, 3.4rem);
    margin: 0 0 10px;
    letter-spacing: -0.03em;
}

.overlay-header p {
    margin: 0;
    color: #c7d0df;
    font-size: 1rem;
}

.country-grid,
.language-grid {
    display: grid;
    gap: 18px;
    margin: 0;
    padding: 0;
}

.country-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.country-card,
.lang-card {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    gap: 16px;
    width: 100%;
    min-height: 100px;
    padding: 24px 22px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    color: #fff;
    cursor: pointer;
    position: relative;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.country-card:hover,
.lang-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.08);
}

.country-card .flag,
.lang-card .flag {
    font-size: 40px;
    line-height: 1;
}

.country-body,
.lang-body {
    display: grid;
    gap: 6px;
    justify-items: center;
    text-align: center;
}

.country-name,
.lang-name {
    font-size: 1.05rem;
    font-weight: 800;
}

.country-subtitle,
.lang-subtitle {
    color: #b8c1d4;
    font-size: 0.95rem;
}

.lang-card.is-default-lang::after {
    content: attr(data-default-label);
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(167, 195, 255, 0.45);
    background: rgba(99, 142, 255, 0.18);
    color: #dfe9ff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    max-width: 720px;
    justify-items: center;
    margin: 0 auto;
}

.language-step {
    display: none;
}

.language-step[hidden] {
    display: none;
}

.language-step:not([hidden]) {
    display: grid;
    place-items: center;
    gap: 24px;
    text-align: center;
}

.overlay-back {
    border: none;
    background: transparent;
    color: #a7c3ff;
    cursor: pointer;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.overlay-back:hover {
    color: #fff;
}

body.overlay-open {
    overflow: hidden;
}

/* Link del menu: solo testo */
.navbar .dropdown-content a {
    display: block;
    padding: 8px 10px;
    color: #e5e5e7;
    text-decoration: none;
    font-size: 14px;
    transition: color .2s ease, text-shadow .2s ease;
}
.navbar .dropdown-content .dropdown-header {
    display: block;
    padding: 10px 10px 4px;
    margin: 0;
    color: #a9a9a9;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}
.navbar .dropdown-content a:hover {
    color: #fff;
    text-shadow: 0 0 12px rgba(255,255,255,0.28);
}

/* Hover-bridge: attivo SOLO quando sei in hover/focus su FA (niente overlay fisso sulla home) */
.navbar .dropdown::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    width: 44px;
    height: 10px;
    pointer-events: none;            /* di default non copre nulla */
}
.navbar .dropdown:hover::after,
.navbar .dropdown:focus-within::after {
    pointer-events: auto;            /* attivo mentre scendi col mouse */
}

/* ================ HERO (home) ================= */
.hero {
    background-color: #111;
    padding: 100px 0;  /* Aggiustato per la barra di navigazione fissa */
    text-align: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
}

.hero .container {
    max-width: 600px;
    margin: auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.hero .subtitle {
    font-size: 24px;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    padding: 10px;
    font-size: 16px;
    width: 300px;
    border: 1px solid #ccc;
    border-radius: 24px;
}

.apple-button {
    padding: var(--rd-btn-pad-y) var(--rd-btn-pad-x);
    font-size: var(--rd-btn-font);
    min-height: var(--rd-btn-min-h);
    min-width: var(--rd-btn-min-w);
    max-width: 100%;
    border: none;
    background-color: #0071e3;
    color: #fff;
    cursor: pointer;
    border-radius: var(--rd-btn-radius);
    transition: background-color 0.3s, box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-wrap: balance;
}

.apple-button:hover {
    background-color: #005bb5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============== SEZIONI GENERALI (home) ============== */
section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
}

.rentalvetrina, .magiccontract {
    background-color: #fff;
    color: #000;
    padding: 100px 0;
    text-align: center;
}

.footer {
    background-color: #7d7777;
    color: #000;
    padding: 100px 0;
    text-align: center;
}

.rentalvetrina .container, .magiccontract .container {
    max-width: 800px;
    margin: auto;
    padding: 0 20px;
}

.rentalvetrina h2, .magiccontract h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.rentalvetrina p, .magiccontract p {
    font-size: 18px;
    margin-bottom: 40px;
}

.rentalmatch, .rentalscore {
    background-color: #000;
    color: #fff;
    padding: 100px 0;
    text-align: center;
}

.rentalmatch .container, .rentalscore .container {
    max-width: 800px;
    margin: auto;
    padding: 0 20px;
}

.rentalmatch h2, .rentalscore h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.rentalmatch p, .rentalscore p {
    font-size: 18px;
    margin-bottom: 40px;
}

/* ========== Regole specifiche per la pagina home ========== */
.home-page {
    scroll-snap-type: y mandatory;
}

.home-page section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
}

.home-page section:last-of-type {
    scroll-snap-align: none;
}

.home-page .hidden {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.home-page .visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============== Rentalvetrina (Liquid Glass) ============== */
body.rentalvetrina-page {
    min-height: 100vh;
    background:
        radial-gradient(1000px 560px at 10% -8%, rgba(120, 181, 255, 0.2), transparent 66%),
        radial-gradient(860px 460px at 92% 0%, rgba(87, 203, 255, 0.16), transparent 70%),
        linear-gradient(180deg, #080d17 0%, #0a1322 46%, #090f19 100%);
    color: #ecf3ff;
}

.rentalvetrina-page section,
.rentalvetrina-page .rentalvetrina {
    height: auto;
    scroll-snap-align: none;
}

.rentalvetrina-page .rentalvetrina {
    position: relative;
    background: transparent;
    color: inherit;
    padding: clamp(104px, 13vh, 132px) clamp(14px, 2.2vw, 26px) clamp(24px, 3.6vh, 40px);
    text-align: left;
}

.rentalvetrina-page .rentalvetrina + .rentalvetrina {
    padding-top: clamp(22px, 3.8vh, 38px);
    padding-bottom: clamp(48px, 7vh, 74px);
}

.rentalvetrina-page .rentalvetrina .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(20px, 2.2vw, 32px);
    border-radius: 30px;
    border: 1px solid rgba(190, 221, 255, 0.18);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(174, 211, 255, 0.07) 55%, rgba(126, 178, 242, 0.06) 100%);
    box-shadow:
        0 30px 70px rgba(2, 12, 28, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.rentalvetrina-page .rentalvetrina h2 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 2.4vw, 2.7rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #f6fbff;
}

.rentalvetrina-page .rentalvetrina p {
    margin: 0;
    font-size: clamp(1rem, 0.55vw + 0.88rem, 1.13rem);
    line-height: 1.55;
    color: rgba(224, 236, 255, 0.9);
}

.rentalvetrina-page .search-form {
    margin-top: clamp(22px, 3.4vh, 34px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.rentalvetrina-page .filter-group {
    display: grid;
    gap: 8px;
}

.rentalvetrina-page .filter-group label {
    font-size: 0.9rem;
    color: rgba(203, 224, 255, 0.9);
    letter-spacing: 0.01em;
}

.rentalvetrina-page .filter-group input,
.rentalvetrina-page .filter-group select {
    width: 100%;
    min-height: 48px;
    border-radius: 15px;
    border: 1px solid rgba(186, 218, 255, 0.2);
    background: rgba(8, 22, 42, 0.54);
    color: #f4f8ff;
    padding: 0 14px;
    box-sizing: border-box;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.rentalvetrina-page .filter-group input::placeholder {
    color: rgba(189, 212, 245, 0.62);
}

.rentalvetrina-page .filter-group input:focus,
.rentalvetrina-page .filter-group select:focus {
    outline: none;
    border-color: rgba(139, 205, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(95, 181, 255, 0.2);
    background: rgba(11, 26, 48, 0.7);
}

.rentalvetrina-page .search-form .apple-button {
    min-height: 50px;
    min-width: 0;
    width: 100%;
    border-radius: 15px;
    border: 1px solid rgba(188, 221, 255, 0.3);
    background: linear-gradient(135deg, #2b8bff 0%, #57b7ff 100%);
    box-shadow: 0 14px 34px rgba(30, 112, 214, 0.35);
}

.rentalvetrina-page .search-form .apple-button:hover {
    background: linear-gradient(135deg, #247ce7 0%, #49aef9 100%);
    box-shadow: 0 18px 38px rgba(24, 94, 184, 0.42);
    transform: translateY(-1px);
}

.rentalvetrina-page .property-list {
    margin-top: clamp(20px, 3vh, 30px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.rentalvetrina-page .property-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 22px;
    padding: 18px;
    border: 1px solid rgba(193, 221, 255, 0.2);
    background:
        linear-gradient(170deg, rgba(255, 255, 255, 0.14) 0%, rgba(149, 198, 255, 0.06) 100%);
    box-shadow:
        0 16px 36px rgba(5, 16, 32, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px) saturate(132%);
    -webkit-backdrop-filter: blur(14px) saturate(132%);
}

.rentalvetrina-page .property-item h3 {
    margin: 0 0 2px;
    color: #f5f9ff;
    font-size: clamp(1.08rem, 0.4vw + 0.98rem, 1.2rem);
    letter-spacing: -0.01em;
}

.rentalvetrina-page .property-item p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(223, 236, 255, 0.88);
}

.rentalvetrina-page .property-item .apple-button {
    margin-top: auto;
    width: 100%;
    min-width: 0;
    border-radius: 12px;
    min-height: 44px;
    border: 1px solid rgba(188, 221, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.rentalvetrina-page .property-item .apple-button:hover {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 24px rgba(6, 16, 30, 0.32);
}

.rentalvetrina-page footer {
    margin-top: 0;
    padding: 42px 14px 52px;
    background: linear-gradient(180deg, rgba(11, 18, 31, 0.2), rgba(8, 12, 21, 0.64));
    border-top: 1px solid rgba(184, 217, 255, 0.14);
}

.rentalvetrina-page footer p {
    color: rgba(213, 228, 249, 0.86);
}

@media (max-width: 1080px) {
    .rentalvetrina-page .property-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .rentalvetrina-page .rentalvetrina {
        padding-top: clamp(90px, 12vh, 112px);
    }

    .rentalvetrina-page .rentalvetrina .container {
        border-radius: 22px;
        padding: 16px;
    }

    .rentalvetrina-page .search-form {
        grid-template-columns: 1fr;
    }

    .rentalvetrina-page .property-list {
        grid-template-columns: 1fr;
    }
}

/* ============== Registrazione/Login ============== */
.registration, .login {
    background-color: #fff;
    color: #000;
    padding: 100px 0;
    text-align: center;
    min-height: 100vh;
}

.registration .container, .login .container {
    max-width: 600px;
    margin: auto;
    padding: 0 20px;
}

.registration h2, .login h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.registration-form, .login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.registration-form label, .login-form label {
    font-size: 16px;
    text-align: left;
}

.registration-form input,
.registration-form select,
.login-form input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 24px;
    width: 100%;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    width: 80%;
}

.registration-form input.invalid, .login-form input.invalid {
    border-color: red;
}

.phone-input {
    display: flex;
    gap: 10px;
}

.phone-input select {
    width: 30%;
}

.phone-input input {
    width: 70%;
}

.registration-form .apple-button, .login-form .apple-button {
    padding: var(--rd-btn-pad-y) var(--rd-btn-pad-x);
    font-size: var(--rd-btn-font);
    min-height: var(--rd-btn-min-h);
    min-width: var(--rd-btn-min-w);
    max-width: 100%;
    border: none;
    background-color: #0071e3;
    color: #fff;
    cursor: pointer;
    border-radius: var(--rd-btn-radius);
    transition: background-color 0.3s, box-shadow 0.3s;
    align-self: center;
}

.registration-form .apple-button:hover, .login-form .apple-button:hover {
    background-color: #005bb5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============== Registration premium (Apple-like) ============== */
.registration-page {
    background:
        radial-gradient(1100px 560px at 10% 0%, rgba(56, 122, 210, 0.34), transparent 68%),
        radial-gradient(940px 480px at 94% 10%, rgba(39, 165, 216, 0.24), transparent 70%),
        linear-gradient(180deg, #0a101c 0%, #08111c 46%, #070b12 100%);
    color: #eef4ff;
}

.registration-page .registration.auth-apple {
    /* override della regola generica section { height:100vh } */
    height: auto !important;
    min-height: calc(100vh - 62px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(68px, 7.2vh, 86px) 16px 24px;
    background: transparent;
    color: inherit;
    overflow-y: auto;
    scroll-snap-align: none;
}

.registration-page .auth-wrap {
    width: 100%;
    max-width: min(1260px, calc(100vw - 36px));
    margin: 0 auto;
}

.registration-page .auth-card {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    border: 1px solid rgba(171, 220, 255, 0.24);
    background: linear-gradient(165deg, rgba(13, 22, 37, 0.9), rgba(8, 17, 30, 0.84));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 26px 72px rgba(0,0,0,0.48);
    backdrop-filter: blur(16px) saturate(132%);
    -webkit-backdrop-filter: blur(16px) saturate(132%);
    padding: clamp(24px, 3vw, 34px);
}

.registration-page .auth-card::before {
    content: "";
    position: absolute;
    inset: -40% 18% auto -18%;
    height: 70%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2), transparent 62%);
    pointer-events: none;
}

.registration-page .auth-title {
    margin: 0 0 16px;
    text-align: center;
    font-size: clamp(2rem, 2.8vw, 2.7rem);
    font-weight: 760;
    letter-spacing: -0.02em;
    color: #f4f8ff;
}

.registration-page .registration-form {
    max-width: none;
    margin: 0 auto;
    gap: 0;
}

/* griglia desktop full-width */
.registration-page .registration-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.registration-page .registration-grid.password-grid {
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
}

.registration-page .registration-form .form-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.registration-page .registration-form .form-field input {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.registration-page .registration-form .form-field select {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.registration-page .registration-form .iti {
    width: 100%;
}

.registration-page .registration-form .iti input[type="tel"] {
    width: 100%;
    min-width: 0;
}

/* Dropdown prefissi/paesi: stile coerente con la card registrazione */
.registration-page .registration-form .iti .iti__flag-container {
    left: 8px;
}

.registration-page .registration-form .iti .iti__selected-flag {
    border-radius: 0;
    border: none;
    background: transparent;
    padding: 0 10px;
    height: 30px;
    margin-top: 5px;
    transition: opacity .2s ease;
}

.registration-page .registration-form .iti .iti__selected-flag:hover {
    background: transparent;
    opacity: 0.9;
}

.registration-page .registration-form .iti .iti__selected-dial-code {
    color: #d9e6ff;
    font-weight: 600;
}

.registration-page .registration-form .iti .iti__arrow {
    border-top-color: rgba(217, 230, 255, 0.85);
}

.registration-page .registration-form .iti .iti__country-list {
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid rgba(191, 219, 255, 0.26);
    background: rgba(9, 18, 31, 0.96);
    color: #e7effd;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
}

.registration-page .registration-form .iti .iti__country {
    padding: 8px 10px;
}

.registration-page .registration-form .iti .iti__country-name,
.registration-page .registration-form .iti .iti__dial-code {
    color: #dce7f9;
}

.registration-page .registration-form .iti .iti__country:hover,
.registration-page .registration-form .iti .iti__country.iti__highlight {
    background: rgba(42, 106, 202, 0.34);
}

.registration-page .phone-row {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.registration-page .phone-row select {
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(191, 219, 255, 0.28);
    background: rgba(255,255,255,0.07);
    color: #f4f8ff;
    font-weight: 600;
    padding: 0 10px;
}

.registration-page .phone-row input[type="tel"] {
    width: 100%;
    min-width: 0;
}

.registration-page .gender-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.registration-page .gender-option {
    border: 1px solid rgba(176, 216, 255, 0.35);
    background: rgba(255,255,255,0.06);
    color: #d7e7ff;
    border-radius: 999px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

.registration-page .gender-option:hover {
    background: rgba(41, 96, 170, 0.36);
    border-color: rgba(188, 224, 255, 0.58);
    color: #ffffff;
}

.registration-page .gender-option.active {
    background: linear-gradient(140deg, #1a8cff, #0d67d8);
    border-color: rgba(188, 224, 255, 0.72);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(9, 101, 206, 0.34);
}

.registration-page .password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.registration-page .password-toggle {
    border: 1px solid rgba(188, 224, 255, 0.35);
    background: rgba(15, 31, 56, 0.62);
    color: #d7e7ff;
    border-radius: 999px;
    height: 38px;
    min-width: 78px;
    padding: 0 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.registration-page .password-toggle:hover {
    background: rgba(32, 66, 111, 0.72);
    border-color: rgba(188, 224, 255, 0.52);
    color: #fff;
}

/* ── Indicazioni criteri password ── */
.password-hints {
    margin: 1px 0 2px 2px;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 10px;
}
.password-hints li {
    font-size: 0.78rem;
    color: #7a8fa8;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color .2s ease;
}
.password-hints li::before {
    content: "○";
    font-size: 0.7em;
    flex-shrink: 0;
    transition: color .2s ease, content .1s ease;
}
.password-hints li.met {
    color: #5de89a;
}
.password-hints li.met::before {
    content: "●";
    color: #5de89a;
}

.registration-page .registration-form label {
    color: #d7e2f5;
    font-size: clamp(0.92rem, 0.25vw + 0.86rem, 1rem);
}

.registration-page .registration-form input,
.registration-page .registration-form select {
    border-radius: 16px;
    border: 1px solid rgba(191, 219, 255, 0.28);
    background: rgba(255,255,255,0.07);
    color: #f4f8ff;
    padding: 10px 12px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

/* Evita il giallo brutto di Safari/Chrome su autofill */
.registration-page .registration-form input:-webkit-autofill,
.registration-page .registration-form input:-webkit-autofill:hover,
.registration-page .registration-form input:-webkit-autofill:focus,
.registration-page .registration-form select:-webkit-autofill,
.registration-page .registration-form select:-webkit-autofill:hover,
.registration-page .registration-form select:-webkit-autofill:focus {
    -webkit-text-fill-color: #f4f8ff;
    caret-color: #f4f8ff;
    border: 1px solid rgba(191, 219, 255, 0.32);
    -webkit-box-shadow: 0 0 0 1000px rgba(24, 37, 57, 0.92) inset;
    box-shadow: 0 0 0 1000px rgba(24, 37, 57, 0.92) inset;
    transition: background-color 9999s ease-out 0s;
}

.registration-page .registration-form input:focus,
.registration-page .registration-form select:focus {
    border-color: rgba(132, 201, 255, 0.72);
    background: rgba(255,255,255,0.11);
    box-shadow: 0 0 0 3px rgba(87, 171, 255, 0.24);
}

.registration-page .registration-form .apple-button.btn-filled {
    margin-top: 2px;
    width: 100%;
    min-width: 0;
    background: linear-gradient(140deg, #1a8cff, #0d67d8);
    border: 1px solid rgba(188, 224, 255, 0.4);
    box-shadow: 0 12px 30px rgba(9, 101, 206, 0.44);
}

.registration-page .registration-form .apple-button.btn-filled:hover {
    background: linear-gradient(140deg, #2d98ff, #1174ea);
    box-shadow: 0 16px 34px rgba(9, 101, 206, 0.5);
}

.password-meter {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(201, 220, 248, 0.24);
    overflow: hidden;
    margin: -2px 0 2px;
    /* nascosto finché l'utente non digita */
    display: none;
    opacity: 0;
    transition: opacity .22s ease;
}
.password-meter.visible {
    display: block;
    opacity: 1;
}

.password-meter-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff5a5f, #ff8a5b);
    transition: width .26s ease, background .26s ease;
}

.password-meter-fill.weak {
    background: linear-gradient(90deg, #ff4b5c, #ff7b62);
}

.password-meter-fill.medium {
    background: linear-gradient(90deg, #ff9755, #ffca5e);
}

.password-meter-fill.strong {
    background: linear-gradient(90deg, #f5d952, #7ede6d);
}

.password-meter-fill.very-strong {
    background: linear-gradient(90deg, #6ae870, #2dd66a);
}

.password-meter-fill.ultra {
    background: linear-gradient(90deg, #00e5a0, #00d084);
    box-shadow: 0 0 8px rgba(0, 210, 130, 0.5);
}

.password-strength {
    margin: 0 0 8px;
    font-size: 0.9rem;
    min-height: 0;
    height: 0;
    overflow: hidden;
    text-align: left;
    transition: height .2s ease, opacity .2s ease;
    opacity: 0;
}
.password-strength.visible {
    height: auto;
    min-height: 1.2em;
    opacity: 1;
}

.password-strength.weak {
    color: #ff7f7f;
}

.password-strength.medium {
    color: #ffd38a;
}

.password-strength.strong {
    color: #7df2b6;
}

.password-strength.very-strong {
    color: #5de89a;
}

.password-strength.ultra {
    color: #00edac;
    text-shadow: 0 0 8px rgba(0,220,172,0.35);
}

.registration-page .auth-meta {
    margin: 14px 0 0;
    color: #c8d5ea;
    text-align: center;
}

.registration-page .auth-meta a {
    color: #b8dcff;
    text-decoration: none;
}

.registration-page .auth-meta a:hover {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(160, 221, 255, 0.35);
}

@media (max-width: 1024px) {
    .registration-page .auth-wrap {
        max-width: 640px;
    }

    .registration-page .registration.auth-apple {
        display: block;
        min-height: 100vh;
        padding: clamp(72px, 8.8vh, 96px) 16px 40px;
    }

    .registration-page .registration-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .registration-page .registration-grid.password-grid {
        grid-template-columns: 1fr;
    }

    .password-hints {
        grid-template-columns: 1fr;
    }

    .registration-page .gender-picker {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .registration-page .registration.auth-apple {
        padding-top: clamp(78px, 9vh, 100px);
    }

    .registration-page .auth-card {
        border-radius: 22px;
        padding: 22px 16px;
    }

    .registration-page .registration-form .apple-button.btn-filled {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 430px) {
    .registration-page .auth-card {
        border-radius: 18px;
        padding: 18px 12px;
    }

    .password-meter {
        height: 7px;
    }
}

.registration-popup {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
}

.registration-popup[hidden] {
    display: none !important;
}

.registration-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.registration-popup-content {
    position: relative;
    width: min(92vw, 420px);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(18, 22, 32, 0.96);
    color: #fff;
    padding: 22px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.registration-popup-content h3 {
    margin: 0 0 10px;
}

.registration-popup-content p {
    margin: 0 0 16px;
    color: #d7deea;
}

/* ============== Footer ============== */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 50px 0;
    margin-top: auto;
}

footer .container {
    max-width: 600px;
    margin: auto;
}

/* ========================================================= */
/* ================== WELCOME (Apple style) ================= */
/* ========================================================= */

body.welcome-page {
    background: radial-gradient(1200px 600px at 50% 0%, #1b1b1d 0%, #0e0e10 40%, #0a0a0b 100%) #000;
    color: #f5f5f7;
}

.welcome {
    min-height: calc(100vh - 60px);
    padding-top: 140px;  /* headline più in basso */
    padding-bottom: 40px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}

.welcome .container {
    max-width: 1100px;
    padding: 0 20px;
}

#welcome-message {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin: 0 0 18px 0;
}

/* nascondiamo la frase di stato */
#role-message { display: none !important; }

/* Titolo sezione */
.apple-section { width: 100%; text-align: center; }
.apple-section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.apple-section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #f5f5f7;
    letter-spacing: -0.01em;
}

/* Action button in section header */
.apple-action-btn {
    padding: 7px 18px;
    border-radius: 50px;
    background: #0a84ff;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s, transform 0.12s;
    white-space: nowrap;
}
.apple-action-btn:hover { background: #409cff; transform: translateY(-1px); }

/* Publish CTA section */
.publish-cta-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 28px 24px !important;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.welcome-content .view-section[data-view-section="publish"] .apple-section {
    display: grid;
    justify-items: center;
    row-gap: 10px;
}

.publish-cta-panel p {
    margin: 0;
    white-space: normal;
    font-size: clamp(0.9rem, 0.3vw + 0.84rem, 1rem);
    line-height: 1.3;
}

.publish-cta-btn {
    display: inline-block;
    padding: 16px 40px;
    border-radius: 50px;
    background: #0a84ff;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 20px rgba(10,132,255,0.4);
    transition: background 0.18s, transform 0.14s, box-shadow 0.14s;
}
.publish-cta-btn:hover {
    background: #409cff;
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(10,132,255,0.5);
}

@media (max-width: 980px) {
    .publish-cta-panel p {
        white-space: normal;
    }
}


.apple-grid {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(2, minmax(320px, 420px));
    gap: 16px 18px;
}
@media (max-width: 900px) { .apple-grid { grid-template-columns: 1fr; } }

.role-dashboard-grid {
    grid-template-columns: minmax(320px, 620px);
}

.role-panel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.welcome-content .role-panel {
    margin: 0 auto;
    max-width: 100%;
    padding-left: 24px;
    padding-right: 24px;
}

.role-panel h3 {
    margin: 0 0 10px;
    font-size: 1.3rem;
}

.role-panel p {
    margin: 0 0 18px;
    color: #cfd6e3;
}

.properties-panel {
    text-align: left;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.welcome-content .properties-panel {
    margin: 0 auto;
}

.properties-loading,
.properties-empty {
    margin-top: 8px;
    color: #adc6ec;
    font-size: 0.95rem;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 18px;
    padding: 0;
    align-items: stretch;
}

.properties-card {
    border: 1px solid rgba(191, 221, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    overflow: hidden;
    display: grid;
    min-width: 0;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    grid-template-rows: auto 1fr;
}

.properties-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(10, 80, 160, 0.2);
}

.properties-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: rgba(255, 255, 255, 0.05);
}

.properties-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.properties-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.properties-card-title {
    margin: 0;
    font-size: 1rem;
    color: #fff;
}

.properties-card-specs {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 10px;
    align-items: baseline;
    flex: 1;
}

.properties-card-specs dt {
    color: rgba(175, 200, 232, 0.65);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.properties-card-specs dd {
    margin: 0;
    color: #cfd6e3;
    font-size: 0.88rem;
    font-weight: 600;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
}

.properties-status {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

.properties-status.is-active {
    background: linear-gradient(180deg, rgba(28, 120, 67, 0.94), rgba(20, 88, 50, 0.94));
    color: #f6fff9;
    border: 1px solid rgba(151, 255, 193, 0.72);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    box-shadow: 0 8px 18px rgba(10, 48, 25, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.properties-status.is-inactive {
    background: linear-gradient(180deg, rgba(255, 206, 84, 0.95), rgba(238, 176, 44, 0.94));
    color: #3a2500;
    border: 1px solid rgba(255, 236, 168, 0.78);
    text-shadow: none;
    box-shadow: 0 8px 18px rgba(73, 50, 4, 0.22), inset 0 1px 0 rgba(255, 249, 228, 0.42);
}

.properties-status.is-draft {
    background: linear-gradient(180deg, rgba(100, 110, 130, 0.92), rgba(70, 80, 100, 0.92));
    color: #e8ecf4;
    border: 1px solid rgba(180, 190, 210, 0.45);
    text-shadow: none;
    box-shadow: 0 4px 12px rgba(20, 25, 45, 0.22);
}

.properties-card-complete-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(10, 132, 255, 0.16);
    color: #4ea8ff;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(10, 132, 255, 0.3);
    transition: background 0.2s, color 0.2s;
}
.properties-card-complete-btn:hover {
    background: rgba(10, 132, 255, 0.28);
    color: #90c8ff;
}

.properties-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.properties-card-actions .apple-action-btn {
    padding: 8px 14px;
}

.welcome-properties .properties-card-actions a:first-child {
    display: none;
}

    .kpi-grid {
        display: grid;
        grid-template-columns: repeat(5, minmax(140px, 1fr));
        gap: 10px;
        margin: 6px 0 16px;
    }

    .kpi-card {
        border: 1px solid rgba(191, 221, 255, 0.22);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.06);
        padding: 12px;
        text-align: left;
    }

    .kpi-label {
        margin: 0;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #adc6ec;
    }

    .kpi-value {
        margin: 8px 0 0;
        font-size: 1.25rem;
        font-weight: 700;
        color: #ffffff;
    }
@media (max-width: 1120px) { .kpi-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); } }

.profile-form {
    max-width: 760px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
    padding: 0 20px;
}

.profile-save-btn:disabled,
.profile-form .apple-cta:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.profile-save-btn.is-dirty {
    background: rgba(10, 132, 255, 0.85);
    border-color: rgba(10, 132, 255, 0.95);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(10, 132, 255, 0.35);
}

.profile-save-btn.is-dirty:hover {
    background: rgba(10, 132, 255, 1);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-grid label {
    display: grid;
    gap: 6px;
    text-align: left;
    min-width: 0;
}

.profile-grid label span {
    font-size: 0.9rem;
    color: #cfd6e3;
}

.profile-grid input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.profile-grid input[readonly] {
    opacity: 0.85;
}

.profile-feedback {
    min-height: 20px;
    margin: 6px 0 0;
}

.profile-feedback.success {
    color: #76f2a6;
}

.profile-feedback.error {
    color: #ff7f7f;
}

@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Pill buttons */
.role-btn, .apple-cta {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--rd-btn-radius);
    color: #f5f5f7;
    padding: var(--rd-btn-pad-y) var(--rd-btn-pad-x);
    min-height: var(--rd-btn-min-h);
    min-width: var(--rd-btn-min-w);
    max-width: 100%;
    font-size: var(--rd-btn-font);
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.role-btn:hover, .apple-cta:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,0.35); }
.role-btn:active, .apple-cta:active { background: rgba(255, 255, 255, 0.22); transform: translateY(0); }
.role-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.35); }

.search-form .apple-button,
.hero-search .apple-button,
.registration-form .apple-button,
.login-form .apple-button,
.profile-form .apple-cta,
.profile-form .apple-button,
.registration-popup .apple-button {
    width: auto;
}

/* Fade-in */
.apple-section, #welcome-message { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity:1; transform: translateY(0);} }

/* ============== Media Queries ============== */
@media (max-width: 768px) {
    .hero h1 { font-size: 36px; }
    .hero .subtitle { font-size: 18px; }
    .search-form { flex-direction: column; align-items: center; }
    .search-form input[type="text"], .apple-button { width: 100%; max-width: 300px; }
    .rentalvetrina h2, .rentalmatch h2, .magiccontract h2, .rentalscore h2 { font-size: 28px; }
    .rentalvetrina p, .rentalmatch p, .magiccontract p, .rentalscore p { font-size: 16px; }
    .registration h2, .login h2 { font-size: 28px; }
    .registration-form label,
    .registration-form input,
    .registration-form select,
    .login-form label,
    .login-form input { font-size: 14px; }
    .phone-input { flex-direction: column; }

    .role-btn,
    .apple-cta,
    .registration-form .apple-button,
    .login-form .apple-button,
    .profile-form .apple-cta,
    .registration-popup .apple-button {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* ============== Mobile/Tablet Navbar Drawer ============== */
@media (max-width: 980px) {
    .navbar {
        padding: 8px 0;
        background: #0f1623;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid rgba(195, 222, 255, 0.18);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    }
    .navbar .container {
        padding: 0 14px;
        position: relative;
        justify-content: flex-start;
        align-items: center;
    }
    .navbar nav {
        width: auto;
        flex: 1;
    }

    /* Logo mobile visibile in alto a sinistra (clone iniettato da mobile-nav.js) */
    .navbar .navbar-mobile-logo {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        color: #f3f5f8;
        text-decoration: none;
        order: -10;
    }
    .navbar .navbar-mobile-logo svg {
        width: 26px;
        height: 26px;
    }
    /* Burger a destra */
    .navbar-burger {
        order: 20;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Lista navbar diventa un pannello a scomparsa (opaco, no backdrop) */
    .navbar nav > ul,
    .navbar nav > * > ul,
    body > ul#rd-mobile-nav-list {
        position: fixed;
        top: 56px;
        left: 12px;
        right: 12px;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        padding: 14px;
        margin: 0;
        list-style: none;
        background: #0f1623;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none;
        isolation: isolate;
        border: 1px solid rgba(195, 222, 255, 0.18);
        border-radius: 18px;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 1100;
    }
    body.rd-mobile-nav-open .navbar nav > ul,
    body.rd-mobile-nav-open .navbar nav > * > ul,
    body.rd-mobile-nav-open > ul#rd-mobile-nav-list {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .navbar nav ul li,
    body > ul#rd-mobile-nav-list > li {
        width: 100%;
        order: unset !important;
        margin: 0 !important;
        list-style: none;
    }
    .navbar nav ul li a,
    .navbar nav ul li .dropbtn,
    body > ul#rd-mobile-nav-list > li a,
    body > ul#rd-mobile-nav-list > li .dropbtn {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
        padding: 14px 16px;
        font-size: 1.02rem;
        font-weight: 600;
        color: #ffffff !important;
        background: transparent;
        border: 0;
        border-radius: 12px;
        text-align: left;
        text-decoration: none;
    }
    .navbar nav ul li a:hover,
    .navbar nav ul li .dropbtn:hover,
    .navbar nav ul li a:active,
    .navbar nav ul li .dropbtn:active,
    .navbar nav ul li a:focus,
    .navbar nav ul li a:focus-visible,
    .navbar nav ul li .dropbtn:focus,
    .navbar nav ul li .dropbtn:focus-visible,
    body > ul#rd-mobile-nav-list > li a:hover,
    body > ul#rd-mobile-nav-list > li .dropbtn:hover,
    body > ul#rd-mobile-nav-list > li a:active,
    body > ul#rd-mobile-nav-list > li .dropbtn:active,
    body > ul#rd-mobile-nav-list > li a:focus,
    body > ul#rd-mobile-nav-list > li a:focus-visible,
    body > ul#rd-mobile-nav-list > li .dropbtn:focus,
    body > ul#rd-mobile-nav-list > li .dropbtn:focus-visible {
        background: rgba(255, 255, 255, 0.14) !important;
        outline: 1px solid rgba(176, 214, 255, 0.45);
        outline-offset: -1px;
    }

    /* Nascondi logo dentro il drawer */
    .navbar nav ul li.navbar-logo,
    body > ul#rd-mobile-nav-list > li.navbar-logo {
        display: none;
    }

    /* Icone con etichetta nel drawer */
    .navbar nav ul li.country-lang-dropdown .dropbtn .sr-only,
    .navbar nav ul li#account-menu > a:not(.dropbtn) .sr-only,
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown .dropbtn .sr-only,
    body > ul#rd-mobile-nav-list > li#account-menu > a:not(.dropbtn) .sr-only {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        clip: auto;
        clip-path: none;
        overflow: visible;
        white-space: normal;
    }
    .navbar nav ul li.country-lang-dropdown .dropbtn,
    .navbar nav ul li#account-menu > a:not(.dropbtn),
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown .dropbtn,
    body > ul#rd-mobile-nav-list > li#account-menu > a:not(.dropbtn) {
        width: 100%;
        height: auto;
        min-width: 0;
        box-sizing: border-box;
        justify-content: flex-start;
        background: transparent !important;
        border: 0 !important;
        border-radius: 12px !important;
        padding: 14px 16px !important;
        color: #ffffff !important;
    }
    .navbar nav ul li.country-lang-dropdown .dropbtn:hover,
    .navbar nav ul li.country-lang-dropdown .dropbtn:focus,
    .navbar nav ul li.country-lang-dropdown .dropbtn:focus-visible,
    .navbar nav ul li.country-lang-dropdown .dropbtn:active,
    .navbar nav ul li#account-menu > a:not(.dropbtn):hover,
    .navbar nav ul li#account-menu > a:not(.dropbtn):focus,
    .navbar nav ul li#account-menu > a:not(.dropbtn):focus-visible,
    .navbar nav ul li#account-menu > a:not(.dropbtn):active,
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown .dropbtn:hover,
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown .dropbtn:focus,
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown .dropbtn:focus-visible,
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown .dropbtn:active,
    body > ul#rd-mobile-nav-list > li#account-menu > a:not(.dropbtn):hover,
    body > ul#rd-mobile-nav-list > li#account-menu > a:not(.dropbtn):focus,
    body > ul#rd-mobile-nav-list > li#account-menu > a:not(.dropbtn):focus-visible,
    body > ul#rd-mobile-nav-list > li#account-menu > a:not(.dropbtn):active {
        background: rgba(255, 255, 255, 0.14) !important;
        outline: 1px solid rgba(176, 214, 255, 0.45);
        outline-offset: -1px;
    }
    .navbar nav ul li.country-lang-dropdown .dropbtn svg,
    .navbar nav ul li#account-menu > a:not(.dropbtn) svg,
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown .dropbtn svg,
    body > ul#rd-mobile-nav-list > li#account-menu > a:not(.dropbtn) svg {
        width: 22px;
        height: 22px;
    }
    .navbar nav ul li.country-lang-dropdown,
    .navbar nav ul li#account-menu,
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown,
    body > ul#rd-mobile-nav-list > li#account-menu {
        margin-left: 0 !important;
    }
    /* Separatore prima delle icone di servizio */
    .navbar nav ul li.country-lang-dropdown,
    body > ul#rd-mobile-nav-list > li.country-lang-dropdown {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 6px !important;
        padding-top: 6px;
    }

    /* Account dropdown inline nel drawer mobile */
    body > ul#rd-mobile-nav-list > li#account-menu .dropdown-content,
    .navbar nav ul li#account-menu .dropdown-content {
        position: static !important;
        display: none;
        width: 100%;
        margin: 4px 0 0 0 !important;
        padding: 4px 0 0 8px !important;
        list-style: none;
        background: transparent !important;
        border: 0 !important;
        border-left: 2px solid rgba(255, 255, 255, 0.12) !important;
        box-shadow: none !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        opacity: 1 !important;
    }
    body > ul#rd-mobile-nav-list > li#account-menu.open .dropdown-content,
    .navbar nav ul li#account-menu.open .dropdown-content {
        display: block;
    }
    body > ul#rd-mobile-nav-list > li#account-menu .dropdown-content li,
    .navbar nav ul li#account-menu .dropdown-content li {
        margin: 0 !important;
    }
    body > ul#rd-mobile-nav-list > li#account-menu .dropdown-content a,
    .navbar nav ul li#account-menu .dropdown-content a {
        display: block;
        padding: 12px 14px !important;
        color: rgba(255, 255, 255, 0.85) !important;
        font-weight: 500 !important;
        font-size: 0.95rem !important;
        border-radius: 10px;
    }
    body > ul#rd-mobile-nav-list > li#account-menu .dropdown-content a:hover,
    body > ul#rd-mobile-nav-list > li#account-menu .dropdown-content a:focus,
    body > ul#rd-mobile-nav-list > li#account-menu .dropdown-content a:focus-visible,
    .navbar nav ul li#account-menu .dropdown-content a:hover,
    .navbar nav ul li#account-menu .dropdown-content a:focus,
    .navbar nav ul li#account-menu .dropdown-content a:focus-visible {
        background: rgba(255, 255, 255, 0.12) !important;
        color: #ffffff !important;
        outline: 1px solid rgba(176, 214, 255, 0.4);
        outline-offset: -1px;
    }
}

/* Hamburger button */
.navbar-burger {
    display: none;
    background: transparent;
    border: 0;
    color: #f5f5f7;
    padding: 8px;
    margin-right: 4px;
    cursor: pointer;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
}

/* Logo mobile iniettato da mobile-nav.js: nascosto su desktop */
.navbar .navbar-mobile-logo {
    display: none;
}
.navbar-burger:hover {
    background: rgba(255, 255, 255, 0.08);
}
.navbar-burger:focus-visible {
    outline: 2px solid rgba(10, 132, 255, 0.5);
    outline-offset: 2px;
}

.navbar-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 18, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

@media (max-width: 980px) {
    .navbar-burger {
        display: inline-flex;
    }
    body.rd-mobile-nav-open .navbar-mobile-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    body.rd-mobile-nav-open {
        overflow: hidden;
    }
}

/* ========================================================= */
/* ================= Welcome App Redesign ================== */
/* ========================================================= */

body.welcome-page {
    --welcome-shell-top: 88px;
    --welcome-shell-bottom: 16px;
    --welcome-shell-side: 18px;
    --welcome-content-pad: 24px;
    --welcome-panel-pad-top: 24px;
    --welcome-panel-pad-side: 12px;
    --welcome-panel-width: 250px;
    --welcome-panel-gap: 26px;
    --welcome-inner-pad: 32px;
    --welcome-inner-max: 1280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
      radial-gradient(1200px 620px at 8% 0%, rgba(77, 118, 199, 0.26), transparent 70%),
      radial-gradient(1000px 520px at 92% 8%, rgba(0, 177, 255, 0.2), transparent 72%),
      linear-gradient(180deg, #0a111f 0%, #090d14 44%, #07090d 100%);
    color: #eef3ff;
}

.welcome-page section,
.welcome-page .welcome-app section {
    height: auto;
    display: block;
    scroll-snap-align: none;
}

.welcome-page [hidden] {
    display: none !important;
}

.welcome-app {
    flex: 1;
    padding: var(--welcome-shell-top) var(--welcome-shell-side) var(--welcome-shell-bottom);
}

.side-hotzone {
    position: fixed;
    left: 0;
    top: 70px;
    bottom: 0;
    width: 14px;
    z-index: 2400;
}

.side-panel {
    position: fixed;
    left: 12px;
    top: var(--welcome-shell-top);
    bottom: var(--welcome-shell-bottom);
    width: var(--welcome-panel-width);
    border: 1px solid rgba(176, 214, 255, 0.2);
    border-radius: 26px;
    padding: var(--welcome-panel-pad-top) var(--welcome-panel-pad-side) 12px;
    background: rgba(11, 20, 34, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.24s ease, opacity 0.24s ease;
    transform: translateX(-120%);
    opacity: 0;
    z-index: 2500;
    overflow-y: auto;
}

body.side-revealed .side-panel,
.side-panel:hover,
.side-panel:focus-within {
    transform: translateX(0);
    opacity: 1;
}

.side-nav {
    display: grid;
    gap: 10px;
}

.side-link {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    color: #d7e4ff;
    text-align: left;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.side-link .icon {
    width: 24px;
    text-align: center;
    flex: 0 0 24px;
}

.side-link .label {
    opacity: 1;
    transform: translateX(0);
    white-space: nowrap;
}

.side-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.side-link.active {
    background: linear-gradient(135deg, rgba(61, 140, 255, 0.45), rgba(0, 182, 255, 0.35));
    border-color: rgba(156, 208, 255, 0.6);
    color: #fff;
    box-shadow: 0 10px 24px rgba(10, 80, 160, 0.28);
}

.welcome-content {
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    border: 1px solid rgba(170, 218, 255, 0.16);
    border-radius: 30px;
    padding: var(--welcome-content-pad);
    background: rgba(8, 16, 27, 0.76);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    min-height: calc(100vh - (var(--welcome-shell-top) + var(--welcome-shell-bottom)));
    max-width: none;
    margin: 0 auto;
    transition: margin-left 0.24s ease, width 0.24s ease;
}

body.side-revealed .welcome-content {
    margin-left: calc(var(--welcome-panel-width) + var(--welcome-panel-gap));
    width: calc(100% - (var(--welcome-panel-width) + var(--welcome-panel-gap)));
}

.welcome-hero {
    width: min(var(--welcome-inner-max), calc(100% - (var(--welcome-inner-pad) * 2)));
    margin: 0 auto 18px;
    text-align: center;
}

.welcome-hero #welcome-message {
    margin: 0;
    font-size: clamp(2.1rem, 4vw, 3.2rem);
    letter-spacing: -0.02em;
}

.welcome-hero #role-message {
    margin: 8px 0 0;
    color: #b7c9e7;
}

.view-section {
    animation: viewFade 0.22s ease;
}

@keyframes viewFade {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-content .apple-section {
    width: 100%;
    margin-top: 16px;
    padding: var(--rd-section-gap) 0;
}

.welcome-content .apple-section > .apple-section-header,
.welcome-content .apple-section > .role-panel,
.welcome-content .apple-section > .properties-panel,
.welcome-content .apple-section > .publish-cta-panel,
.welcome-content .apple-section > .profile-form,
.welcome-content .apple-section > .dashboard-role-sections,
.welcome-content .apple-section > .role-multiselect,
.welcome-content .apple-section > .role-intent-grid,
.welcome-content .apple-section > .role-actions,
.welcome-content .apple-section > .role-feedback {
    width: min(var(--welcome-inner-max), calc(100% - (var(--welcome-inner-pad) * 2)));
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.welcome-content .view-section[data-view-section="properties"] .apple-section > .apple-section-header,
.welcome-content .view-section[data-view-section="properties"] .apple-section > .properties-panel {
    width: 100%;
    max-width: none;
}

.welcome-content .view-section[data-view-section="dossier"] .apple-section > .apple-section-header,
.welcome-content .view-section[data-view-section="dossier"] .apple-section > #dossier-panel {
    width: calc(100% - 24px);
    max-width: none;
}

.welcome-content .apple-section-header h2 {
    font-size: clamp(1.08rem, 0.5vw + 0.96rem, 1.28rem);
    color: #eaf3ff;
    text-align: center;
}

.welcome-content .apple-section-header {
    width: 100%;
    margin: 0 auto 14px;
    justify-content: center;
}

.welcome-page[data-active-view="dossier"] #role-message {
    display: none !important;
}

.welcome-content .profile-form {
    max-width: 980px;
    padding: 0;
}

.welcome-content .profile-grid {
    gap: 10px;
}

.welcome-content .profile-grid input {
    border-radius: 12px;
    border: 1px solid rgba(189, 217, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
}

.dashboard-role-sections {
    display: grid;
    gap: 14px;
    margin-bottom: 12px;
    padding: 0;
}

.dashboard-scenario {
    display: none;
    border: 1px solid rgba(141, 203, 255, 0.32);
    border-radius: 18px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(35, 101, 170, 0.28), rgba(28, 139, 176, 0.14));
    text-align: center;
}

.dashboard-scenario h3 {
    margin: 2px 0 6px;
    font-size: 1rem;
}

.dashboard-scenario p {
    margin: 0;
    color: #cde3ff;
    font-size: 0.93rem;
}

.role-kpi-section {
    border: 1px solid rgba(171, 211, 255, 0.22);
    border-radius: 18px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
}

.role-kpi-title {
    margin: 4px 0 10px;
    text-align: center;
    font-size: 1.1rem;
}

.role-kpi-grid {
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid transparent;
}

.status-green {
    color: #96f3be;
    background: rgba(28, 89, 60, 0.35);
    border-color: rgba(93, 222, 161, 0.5);
}

.status-yellow {
    color: #ffe08a;
    background: rgba(100, 79, 26, 0.32);
    border-color: rgba(255, 215, 115, 0.5);
}

.status-red {
    color: #ffb0b0;
    background: rgba(100, 28, 28, 0.32);
    border-color: rgba(255, 138, 138, 0.5);
}

.status-unknown {
    color: #d0dbef;
    background: rgba(46, 59, 82, 0.35);
    border-color: rgba(154, 177, 220, 0.45);
}

.role-actions {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.role-actions .apple-cta {
    width: 100%;
    justify-content: center;
    min-height: 48px;
}

.role-multiselect,
.role-intent-grid {
    display: grid;
    gap: clamp(10px, 1vw, 14px);
    margin: 12px auto 14px;
    width: 100%;
    max-width: 760px;
}

.role-intent-grid {
    display: none;
}

.role-check {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

.role-switch-row {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    justify-content: space-between;
    min-height: clamp(66px, 7.4vw, 76px);
    padding: clamp(14px, 1.9vw, 18px) clamp(14px, 2.2vw, 22px);
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(255,255,255,0.16), rgba(255,255,255,0.03));
    border: 1px solid rgba(182, 217, 255, 0.28);
    color: #edf4ff;
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), background 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 10px 24px rgba(0,0,0,0.2);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
}

.role-switch-row::before {
    content: "";
    position: absolute;
    inset: -35% 25% auto -20%;
    height: 120%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.24), transparent 58%);
    pointer-events: none;
}

.role-switch-row:hover {
    transform: translateY(-1px);
    background: linear-gradient(160deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    border-color: rgba(194, 228, 255, 0.42);
}

.role-switch-row:active {
    transform: translateY(0);
}

.role-switch-row:focus-within {
    border-color: rgba(161, 226, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 0 0 3px rgba(108, 188, 255, 0.25), 0 10px 24px rgba(0,0,0,0.22);
}

.role-switch-row.role-selected {
    border-color: rgba(164, 236, 196, 0.7);
    background: linear-gradient(160deg, rgba(70, 210, 145, 0.28), rgba(45, 145, 255, 0.2));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.32), 0 12px 28px rgba(0,0,0,0.24);
}

.role-switch-row.locked-role {
    opacity: 0.82;
}

.role-switch-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    line-height: 1.38;
    font-size: clamp(0.95rem, 0.55vw + 0.82rem, 1.07rem);
    font-weight: 560;
    letter-spacing: -0.01em;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

input.apple-switch {
    position: relative;
    appearance: none;
    outline: none;
    width: 52px;
    height: 32px;
    flex: 0 0 52px;
    background: linear-gradient(180deg, #eef0f4, #e0e3e8);
    border: 1px solid rgba(172, 178, 188, 0.85);
    border-radius: 50px;
    box-shadow: inset -22px 0 0 0 #f7f8fa, inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 6px rgba(0,0,0,0.16);
    transition: box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
    cursor: pointer;
}

input.apple-switch:after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.9);
    background: linear-gradient(180deg, #ffffff, #f1f3f6);
    transition: left 200ms ease, box-shadow 200ms ease;
}

input.apple-switch:checked {
    border-color: rgba(44, 170, 89, 0.95);
    background: linear-gradient(180deg, #4fe07c, #34c759);
    box-shadow: inset 22px 0 0 0 #34c759, 0 2px 6px rgba(0,0,0,0.18);
}

input.apple-switch:checked:after {
    left: 21px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.16), inset 0 1px 1px rgba(255,255,255,0.95);
}

input.apple-switch:focus-visible {
    box-shadow: inset -22px 0 0 0 #f7f8fa, inset 0 1px 0 rgba(255,255,255,0.8), 0 0 0 3px rgba(108, 188, 255, 0.35), 0 2px 6px rgba(0,0,0,0.16);
}

input.apple-switch:checked:focus-visible {
    box-shadow: inset 22px 0 0 0 #34c759, 0 0 0 3px rgba(82, 226, 132, 0.35), 0 2px 6px rgba(0,0,0,0.18);
}

input.apple-switch:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

.role-feedback {
    min-height: 20px;
    margin: 12px 0 0;
    text-align: center;
    font-size: 0.92rem;
}

.role-feedback.success {
    color: #8fe7b2;
}

.role-feedback.error {
    color: #ff9d9d;
}

@media (prefers-reduced-motion: reduce) {
    .role-switch-row,
    input.apple-switch,
    input.apple-switch:after {
        transition: none;
    }
}

.profile-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.profile-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.profile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 18, 0.84);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.profile-modal-panel {
    position: relative;
    width: min(440px, calc(100vw - 32px));
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 18, 28, 0.96);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
    box-shadow: 0 35px 120px rgba(0, 0, 0, 0.5);
    padding: 22px 24px;
    color: #f5f5f7;
    transform: translateY(8px);
    transition: transform 0.25s ease;
}

.profile-modal-overlay.show .profile-modal-panel {
    transform: translateY(0);
}

.profile-modal-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.profile-modal-text {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(223, 236, 255, 0.92);
    line-height: 1.45;
}

.profile-modal-overlay.success .profile-modal-panel {
    border-color: rgba(92, 225, 168, 0.45);
}

.profile-modal-overlay.error .profile-modal-panel {
    border-color: rgba(255, 136, 136, 0.5);
}

.profile-modal-overlay.error .profile-modal-title {
    color: #ffd1d1;
}

@media (max-width: 980px) {
    body.welcome-page {
        --welcome-shell-top: 82px;
        --welcome-shell-bottom: 12px;
        --welcome-shell-side: 10px;
        --welcome-content-pad: 18px;
        --welcome-panel-pad-top: 18px;
        --welcome-panel-pad-side: 10px;
        --welcome-inner-pad: 16px;
    }

    /* Hotzone diventa una tab visibile per aprire il pannello */
    .side-hotzone {
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 64px;
        background: rgba(11, 20, 34, 0.92);
        border: 1px solid rgba(176, 214, 255, 0.25);
        border-left: 0;
        border-radius: 0 14px 14px 0;
        z-index: 2600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .side-hotzone::after {
        content: '';
        width: 4px;
        height: 32px;
        background: rgba(220, 235, 255, 0.55);
        border-radius: 4px;
    }

    .side-panel {
        left: 0;
        top: 56px;
        bottom: 0;
        width: min(86vw, 320px);
        max-height: none;
        border-radius: 0 22px 22px 0;
        border-left: 0;
        background: #0b1422;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
        z-index: 2550;
    }

    /* Backdrop scuro quando il pannello è aperto su mobile */
    body.welcome-page.side-revealed::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(8, 12, 18, 0.55);
        z-index: 2540;
    }

    .welcome-content {
        width: 100%;
        min-height: auto;
        padding: var(--welcome-content-pad);
        margin-left: 0;
    }

    body.side-revealed .welcome-content {
        margin-left: 0;
        width: 100%;
    }

    .role-multiselect,
    .role-intent-grid {
        max-width: 100%;
    }

    /* Country/lang overlay più adatto a mobile */
    .country-overlay {
        padding: 12px;
        align-items: flex-start;
    }
    .country-overlay-panel {
        width: 100%;
        max-width: 100%;
        margin-top: 60px;
        padding: 24px 18px;
        border-radius: 22px;
    }
    .overlay-header { margin-bottom: 18px; }
    .overlay-header h2 { font-size: 1.5rem; }
    .overlay-header p { font-size: 0.9rem; }
    .country-grid,
    .language-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }
    .country-card,
    .lang-card {
        min-height: 78px;
        padding: 14px 10px;
        border-radius: 16px;
        gap: 8px;
    }
    .country-card .flag, .lang-card .flag { font-size: 28px; }
    .country-name, .lang-name { font-size: 0.95rem; }
    .country-subtitle, .lang-subtitle { font-size: 0.8rem; }

    /* Badge "Predefinita" più compatto sulle card piccole */
    .lang-card.is-default-lang {
        padding-top: 22px;
    }
    .lang-card.is-default-lang::after {
        top: 6px;
        right: 6px;
        left: auto;
        padding: 2px 8px;
        font-size: 0.58rem;
        letter-spacing: 0.02em;
        white-space: nowrap;
        width: auto;
    }

    /* Dashboard welcome: una colonna, padding ridotti */
    .role-dashboard-grid,
    .apple-grid {
        grid-template-columns: 1fr !important;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }
    .welcome-content .role-panel,
    .welcome-content .properties-panel {
        padding: 16px;
        padding-left: 16px;
        padding-right: 16px;
        border-radius: 18px;
    }
    .welcome-content .apple-section {
        padding: 14px;
        border-radius: 18px;
    }
    .welcome-content {
        padding: 14px;
    }
    .profile-form {
        padding: 0 4px;
    }

    /* === Mobile flat design: rimuovi tutti i "cubi" interni ed esterni === */
    .welcome-content,
    .welcome-content .apple-section,
    .welcome-content .role-panel,
    .welcome-content .properties-panel,
    .welcome-content .publish-cta-panel,
    .welcome-content .dashboard-role-sections,
    .welcome-content .profile-form,
    .role-panel,
    .properties-panel,
    .apple-section,
    .apple-card,
    .role-card,
    .kpi-card,
    .stat-card,
    .info-card,
    .dashboard-card {
        background: transparent !important;
        background-color: transparent !important;
        background-image: none !important;
        border: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-radius: 0 !important;
    }

    .welcome-content {
        padding: 12px 14px !important;
    }
    .welcome-content .apple-section,
    .welcome-content .role-panel,
    .welcome-content .properties-panel {
        padding: 8px 0 !important;
        margin: 0 !important;
    }
    .welcome-content .apple-section + .apple-section,
    .welcome-content .role-panel + .role-panel {
        margin-top: 18px !important;
        padding-top: 18px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    /* KPI/cards: niente sfondo, solo testo allineato */
    .kpi-card,
    .stat-card,
    .apple-card,
    .role-card,
    .info-card {
        padding: 6px 0 !important;
    }
    .kpi-grid {
        gap: 6px 16px !important;
    }
}

@media (max-width: 640px) {
    .role-switch-row {
        border-radius: 18px;
    }

    .role-switch-text {
        font-size: 0.97rem;
    }
}

@media (min-width: 1280px) {
    .role-multiselect,
    .role-intent-grid {
        max-width: 700px;
    }
}

/* --- Dossier preview in welcome/home --- */
.dossier-loading { opacity: .6; padding: 12px 0; }
.dossier-empty { text-align: center; padding: 18px 8px; }
.dossier-summary { display: flex; flex-direction: column; gap: 14px; }
.role-panel#dossier-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    text-align: left;
}
.dossier-summary-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.dossier-summary-kv dt { color: rgba(255,255,255,.6); font-weight: 500; }
.dossier-summary-kv dd { margin: 0; }
.dossier-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dossier-chip { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); font-size: .8rem; }
.dossier-summary-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.apple-cta-secondary { background: transparent !important; border: 1px solid rgba(255,255,255,.22) !important; color: rgba(255,255,255,.85) !important; }
.apple-cta--danger { background: rgba(220,53,69,.18) !important; border: 1px solid rgba(220,53,69,.45) !important; color: #ff8a93 !important; }
.apple-cta--danger:hover { background: rgba(220,53,69,.32) !important; }

.dossier-dashboard-head {
    display: none;
}

.dossier-cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.dossier-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    padding: 12px 0 14px;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.dossier-card::before {
    content: none;
}

.dossier-card > * {
    position: relative;
    z-index: 1;
}

.dossier-card-head,
.dossier-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.dossier-card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
}

.dossier-card-badges,
.dossier-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.dossier-role-badge,
.dossier-state-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dossier-role-badge { background: rgba(255,255,255,.08); color: #d6e6ff; }
.dossier-role-badge[data-role="main"] { background: rgba(80,200,140,.18); color: #97efbc; }
.dossier-role-badge[data-role="partner"] { background: rgba(120,170,255,.18); color: #bfd8ff; }
.dossier-role-badge[data-role="cohabitant"] { background: rgba(255,200,120,.16); color: #ffe0a0; }
.dossier-role-badge[data-role="guarantor"] { background: rgba(255,160,210,.16); color: #ffd0e7; }
.dossier-state-badge[data-status="draft"] { background: rgba(255,184,0,.18); color: #ffc957; }
.dossier-state-badge[data-status="complete"] { background: rgba(80,200,140,.18); color: #97efbc; }
.dossier-state-badge[data-status="incomplete"] { background: rgba(255,120,0,.18); color: #ffaa57; }

.dossier-card-title {
    margin: 0;
    font-size: clamp(1.3rem, 0.7vw + 1.05rem, 1.75rem);
    line-height: 1.25;
    color: #f4f8ff;
}

.dossier-card-meta-line {
    margin: 8px 0 0;
    color: rgba(255,255,255,.58);
    font-size: .84rem;
    line-height: 1.45;
}

.dossier-card-intro {
    margin: 8px 0 0;
    max-width: 58ch;
    color: rgba(255,255,255,.64);
    font-size: .92rem;
    line-height: 1.45;
}

.dossier-card-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 0 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    width: min(760px, 72%);
    max-width: 100%;
}

.dossier-card-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: .84rem;
    color: rgba(255,255,255,.72);
}

.dossier-card-progress-meta strong {
    color: #f3f7ff;
    font-size: .95rem;
}

.dossier-card-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    overflow: hidden;
}

.dossier-card-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #59a9ff, #84d7ff);
    box-shadow: 0 0 18px rgba(79,163,255,.3);
}

.dossier-card-kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 14px;
    margin: 0;
    font-size: .9rem;
}

.dossier-card-kv dt { color: rgba(255,255,255,.58); }
.dossier-card-kv dd { margin: 0; color: #f0f5ff; font-weight: 600; }

.dossier-card-actions .apple-cta,
.dossier-card-actions .apple-cta-secondary,
.dossier-card-actions .apple-cta--danger {
    width: 190px;
    min-width: 190px;
    height: var(--rd-btn-min-h);
    min-height: var(--rd-btn-min-h);
    flex: 0 0 190px;
    box-sizing: border-box;
    padding: 10px 18px;
    font-size: .88rem;
    line-height: 1.1;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.dossier-card-foot {
    justify-content: center;
    margin-top: 10px;
}

.dossier-state-badge {
    order: -1;
}

.dossier-invites-panel {
    margin-top: 12px;
    padding: 18px 0 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid rgba(173, 217, 255, 0.14);
    background: transparent;
    box-shadow: none;
}

.dossier-invites-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
}

.dossier-invites-head h3 {
    margin: 0;
    font-size: 1.15rem;
}

.dossier-invites-subtitle {
    margin: 8px 0 0;
    max-width: 62ch;
    color: rgba(255,255,255,.62);
    font-size: .9rem;
    line-height: 1.5;
}

.dossier-invites-counters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.dossier-invites-counter {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(173,217,255,.14);
    background: rgba(255,255,255,.04);
    color: rgba(228,240,255,.86);
    font-size: .76rem;
    font-weight: 600;
}

.dossier-invite-actions {
    justify-content: flex-start;
    margin-top: 18px;
    gap: 12px;
}

.dossier-invite-actions .apple-cta-secondary {
    min-width: 168px;
    padding: 10px 18px;
    font-size: .86rem;
    border-color: rgba(173,217,255,.16) !important;
    background: rgba(255,255,255,.04) !important;
}

.dossier-invite-actions.is-locked {
    opacity: .7;
}

.dossier-invite-actions button:disabled {
    cursor: not-allowed;
    opacity: .68;
}

.dossier-invite-hint,
.dossier-invite-empty {
    margin: 16px 0 0;
    padding: 12px 0 0;
    border-radius: 16px;
    font-size: .86rem;
    text-align: left;
    max-width: 100%;
}

.dossier-invite-hint {
    background: transparent;
    border: 0;
    color: #f1d59a;
}

.dossier-invite-empty {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,.65);
}

.dossier-invites-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.dossier-invite-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dossier-invite-group-title {
    margin: 0;
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.54);
}

.dossier-invite-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dossier-invite-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-radius: 16px;
    border: 0;
    border-bottom: 1px solid rgba(173, 217, 255, 0.10);
    background: transparent;
}

.dossier-invite-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dossier-invite-name { font-weight: 600; }

.dossier-invite-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .79rem;
    color: rgba(255,255,255,.58);
}

.dossier-invite-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .69rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.dossier-invite-status[data-s="pending"] { background: rgba(255,184,0,.16); color: #ffc957; }
.dossier-invite-status[data-s="accepted"] { background: rgba(80,200,140,.18); color: #97efbc; }
.dossier-invite-status[data-s="declined"] { background: rgba(255,120,120,.16); color: #ffb0b0; }
.dossier-invite-status[data-s="expired"],
.dossier-invite-status[data-s="revoked"] { background: rgba(255,255,255,.08); color: rgba(255,255,255,.72); }

.dossier-invite-row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.welcome-page .dos-modal { position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center; }
.welcome-page .dos-modal[hidden] { display: none; }
.welcome-page .dos-modal-backdrop { position: absolute; inset: 0; background: rgba(3,8,16,0.78); backdrop-filter: blur(8px); }
.welcome-page .dos-modal-panel {
    position: relative; z-index: 1;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 64px); overflow: auto;
    background: linear-gradient(180deg, rgba(18,28,44,.96), rgba(11,18,32,.94));
    border: 1px solid rgba(173, 217, 255, 0.16);
    border-radius: 24px; padding: 26px;
    box-shadow: 0 24px 56px rgba(0,0,0,.45);
}
.welcome-page .dos-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.welcome-page .dos-modal-head h2 { margin: 0; font-size: 1.15rem; }
.welcome-page .dos-modal-close { background: none; border: none; color: rgba(255,255,255,.72); font-size: 1.8rem; cursor: pointer; }
.welcome-page .dos-modal-close:hover { color: #fff; }
.welcome-page .dos-invite-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.welcome-page .dos-invite-tabs { display: flex; gap: 6px; background: rgba(255,255,255,.04); padding: 4px; border-radius: 12px; }
.welcome-page .dos-invite-tab { flex: 1; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.62); padding: 9px 10px; cursor: pointer; font-weight: 600; }
.welcome-page .dos-invite-tab.active { background: rgba(61,140,255,.20); color: #d7eaff; }
.welcome-page .nl-label { display: block; margin-bottom: 6px; font-size: .82rem; color: rgba(255,255,255,.72); }
.welcome-page .nl-input {
    width: 100%; box-sizing: border-box;
    padding: 12px 14px; border-radius: 14px;
    border: 1px solid rgba(173, 217, 255, 0.16);
    background: rgba(255,255,255,.05); color: #fff;
}
.welcome-page .nl-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.welcome-page .nl-checkbox-row { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius:14px; background: rgba(255,255,255,.04); border: 1px solid rgba(173,217,255,.12); }
.welcome-page .dos-invite-search-list { list-style:none; margin:6px 0 0; padding:0; display:flex; flex-direction:column; gap:6px; max-height:220px; overflow:auto; }
.welcome-page .dos-invite-search-list li { padding:10px 12px; border-radius:12px; border:1px solid rgba(173,217,255,.10); background: rgba(255,255,255,.04); cursor:pointer; }
.welcome-page .dos-invite-search-list li.selected { background: rgba(61,140,255,.18); border-color: rgba(61,140,255,.45); }
.welcome-page .dos-invite-search-list .sug-email { font-size:.78rem; color: rgba(255,255,255,.58); }
.welcome-page .dos-invite-link-row { display:flex; gap:8px; align-items:center; padding:10px 12px; border-radius:12px; background: rgba(80,200,140,.08); border:1px solid rgba(80,200,140,.26); }
.welcome-page .dos-invite-link-row code { flex:1; white-space:nowrap; overflow:auto; color:#bff9d9; }

@media (max-width: 860px) {
    .dossier-summary {
        gap: 12px;
    }

    .dossier-cards-grid,
    .welcome-page .nl-form-row {
        grid-template-columns: 1fr;
    }

    .dossier-card,
    .dossier-invites-panel {
        padding: 16px 0 0;
        border-radius: 0;
    }

    .dossier-card-topline,
    .dossier-invites-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .dossier-card-title {
        font-size: 1.18rem;
    }

    .dossier-card-intro {
        font-size: .88rem;
        max-width: none;
    }

    .dossier-card-progress {
        width: 100%;
    }

    .dossier-card-kv {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .dossier-card-kv dt {
        margin-top: 6px;
    }

    .dossier-card-foot,
    .dossier-invite-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .dossier-card-actions,
    .dossier-invite-row-actions {
        width: 100%;
        justify-content: stretch;
    }

    .dossier-card-actions .apple-cta,
    .dossier-invite-actions .apple-cta-secondary,
    .dossier-card-actions .apple-cta-secondary,
    .dossier-card-actions .apple-cta--danger {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding: 11px 14px;
        font-size: .9rem;
    }

    .dossier-invites-head,
    .dossier-invite-actions {
        justify-content: center;
        text-align: center;
    }

    .dossier-invites-counters {
        justify-content: center;
    }

    .dossier-invites-subtitle,
    .dossier-invite-hint,
    .dossier-invite-empty,
    .dossier-invite-group-title {
        text-align: center;
    }

    .dossier-invite-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .dossier-invite-hint,
    .dossier-invite-empty {
        text-align: left;
    }

    .welcome-page .dos-modal-panel {
        width: min(100vw - 20px, 560px);
        padding: 18px;
    }
}

/* Stato dossier (bozza) */
.dos-status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }
.dos-status-draft { background: rgba(255,184,0,.18); color: #ffc957; border: 1px solid rgba(255,184,0,.35); }

/* Codice fiscale: feedback validazione (registrazione e dashboard) */
.auth-hint { display: block; margin-top: 6px; font-size: .8rem; color: var(--text-secondary, #aaa); min-height: 1em; }
.auth-hint.vat-ok { color: #8ce0b4; }
.auth-hint.vat-err { color: #ffd79a; }
.form-field--full { grid-column: 1 / -1; }
.registration-form input.input-ok,
.tax-code-modal input.input-ok { border-color: #4ec88a !important; box-shadow: 0 0 0 2px rgba(78,200,138,0.18); }
.registration-form input.input-err,
.tax-code-modal input.input-err { border-color: #e07a3a !important; box-shadow: 0 0 0 2px rgba(224,122,58,0.2); }

/* Modal generico Profilo / Codice fiscale */
.profile-modal-overlay { position: fixed; inset: 0; z-index: 240; display: flex; align-items: center; justify-content: center; padding: 20px; }
.profile-modal-overlay[hidden] { display: none; }
.profile-modal-backdrop { position: absolute; inset: 0; background: rgba(3,8,16,0.78); backdrop-filter: blur(8px); }
.profile-modal-panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #15212f 0%, #0c1622 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 22px 24px;
  width: min(460px, 100%);
  color: #f4f6f8;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.profile-modal-title { margin: 0 0 8px; font-size: 1.2rem; font-weight: 600; }
.profile-modal-text { margin: 0 0 14px; font-size: .95rem; color: rgba(255,255,255,0.78); line-height: 1.45; }
.tax-code-modal .nl-label { display: block; margin: 6px 0 6px; font-size: .85rem; color: rgba(255,255,255,0.85); }
.tax-code-modal .nl-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04); color: #fff;
  font-size: 1rem; letter-spacing: .02em;
}
.tax-code-modal .nl-input:focus { outline: none; border-color: #4ec88a; box-shadow: 0 0 0 2px rgba(78,200,138,0.2); }

/* Link discreto per cancellazione account */
.profile-delete-row {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
.profile-delete-link {
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: .85rem;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s ease;
}
.profile-delete-link:hover { color: #ff8a72; }
.apple-cta.apple-cta-danger {
  background: linear-gradient(180deg, #c2422a 0%, #9c2c1c 100%);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
}
.apple-cta.apple-cta-danger:hover { filter: brightness(1.07); }
.apple-cta.apple-cta-danger:disabled { opacity: 0.6; cursor: not-allowed; }

.delete-account-modal .delete-account-summary {
  list-style: none; padding: 0; margin: 0 0 12px; font-size: .9rem; color: rgba(255,255,255,0.85);
}
.delete-account-modal .delete-account-summary li { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.delete-account-modal .delete-account-summary li:last-child { border-bottom: none; }
.delete-account-modal .delete-account-warning {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 8px;
  background: rgba(255, 122, 90, 0.12); color: #ffb091; font-size: .85rem;
}

/* Schermata a tutto schermo: account eliminato */
.account-deleted-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #08111a;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: adFadeIn .5s ease both;
}
.account-deleted-screen[hidden] { display: none; }
@keyframes adFadeIn { from { opacity: 0; } to { opacity: 1; } }
.account-deleted-inner {
  text-align: center;
  padding: 32px 24px;
  max-width: 520px;
  animation: adSlideUp .6s ease both;
}
@keyframes adSlideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.account-deleted-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  font-size: 2rem;
  line-height: 72px;
  margin: 0 auto 28px;
  color: #a8e6cf;
}
.account-deleted-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.3;
}
.account-deleted-msg {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin: 0;
}
