/* ==========================================================================
   CompagniDiViaggio.net — Design system globale
   Palette: blu notte profondo, arancio tramonto, verde acqua.
   ========================================================================== */

:root {
    --bg-dark: #0a0f1c;
    --primary: #ff6b35;
    --primary-hover: #e85a2a;
    --secondary: #00d2c6;
    --text-light: #ffffff;
    --text-muted: #cbd5e1;
    --card-bg: #1e293b;
    --border-radius: 16px;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);

    --bg-elevated: #101729;
    --bg-soft: rgba(255, 255, 255, 0.035);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --font-heading: "Poppins", "Segoe UI", sans-serif;
    --font-body: "Inter", "Segoe UI", sans-serif;
    --container: 1200px;
    --header-height: 76px;
    --transition: 0.22s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 12% 0%, rgba(255, 107, 53, 0.07), transparent 32%),
        radial-gradient(circle at 88% 18%, rgba(0, 210, 198, 0.045), transparent 30%);
    background-attachment: fixed;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main {
    flex: 1;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text-light);
}

p,
ul,
ol,
figure {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

strong {
    font-weight: 700;
}

::selection {
    background: var(--primary);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
}

.shell {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: clamp(1.1rem, 4vw, 2.5rem);
    padding-right: clamp(1.1rem, 4vw, 2.5rem);
}

.section {
    padding: clamp(2.8rem, 6vw, 5rem) 0;
}

.section-tight {
    padding: clamp(1.8rem, 4vw, 3rem) 0;
}

.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;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 200;
    padding: 0.75rem 1.1rem;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 1rem;
}

.text-muted {
    color: var(--text-muted);
}

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

.mt-sm {
    margin-top: 1rem;
}

.mb-sm {
    margin-bottom: 0.75rem;
}

.mb-md {
    margin-bottom: 0.9rem;
}

.link-teal {
    color: var(--secondary);
    font-weight: 600;
}

.link-teal:hover {
    color: #7ff7ef;
}

.text-gradient {
    background: linear-gradient(104deg, #ff8a5c 0%, var(--primary) 38%, #ffb36b 65%, var(--secondary) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-sm {
    width: 15px;
    height: 15px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    vertical-align: middle;
    opacity: 0.5;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--secondary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 0 4px rgba(0, 210, 198, 0.12);
    animation: pulse-dot 2.8s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 210, 198, 0.12); }
    50% { box-shadow: 0 0 0 8px rgba(0, 210, 198, 0.03); }
}

/* ==========================================================================
   Header e navigazione
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(10, 15, 28, 0.74);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transition: background var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
    background: rgba(10, 15, 28, 0.94);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
}

.nav-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--text-light);
    white-space: nowrap;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff9a5b 100%);
    color: #fff;
    box-shadow: 0 8px 22px rgba(255, 107, 53, 0.28);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.brand-text span {
    color: var(--primary);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.52rem 0.9rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
}

.nav-link .icon {
    width: 16px;
    height: 16px;
}

.nav-link:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.is-active {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.085);
}

.notification-badge {
    display: inline-block;
    flex-shrink: 0;
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 50px;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    vertical-align: middle;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 0.35rem;
    padding: 0.28rem 0.75rem 0.28rem 0.3rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    transition: border-color var(--transition), background var(--transition);
}

.nav-user:hover {
    border-color: rgba(0, 210, 198, 0.32);
    background: rgba(0, 210, 198, 0.055);
}

.nav-avatar,
.nav-avatar-fallback {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
}

.nav-avatar {
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--secondary), #58f2e8);
    color: #032b2b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.nav-greeting {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.nav-greeting strong {
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 600;
}

.nav-logout {
    margin-left: 0.25rem;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-light);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   Bottoni
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.005em;
    white-space: nowrap;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ff8b53 100%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(255, 107, 53, 0.24);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 15px 34px rgba(255, 107, 53, 0.34);
}

.btn-secondary {
    background: var(--secondary);
    color: #032b2b;
    box-shadow: 0 10px 26px rgba(0, 210, 198, 0.18);
}

.btn-secondary:hover {
    background: #22e3d7;
    box-shadow: 0 15px 34px rgba(0, 210, 198, 0.28);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--text-light);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.075);
    border-color: var(--border-strong);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.13);
    color: var(--text-light);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
}

.btn-danger {
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.22);
    color: #ffb0b0;
}

.btn-danger:hover {
    background: rgba(255, 80, 80, 0.18);
}

.btn-lg {
    padding: 1rem 1.55rem;
    border-radius: 14px;
    font-size: 0.96rem;
}

.btn-sm {
    padding: 0.48rem 0.8rem;
    border-radius: 9px;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
}

.btn .icon {
    width: 17px;
    height: 17px;
}

.btn-lg .icon {
    width: 19px;
    height: 19px;
}

/* ==========================================================================
   Form
   ========================================================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
}

.form-label .required {
    color: var(--primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-light);
    font-size: 0.92rem;
    outline: none;
    color-scheme: dark;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(160, 170, 191, 0.55);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.13), 0 0 22px rgba(255, 107, 53, 0.08);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.6rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0aabf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    color-scheme: dark;
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.65;
}

.form-help {
    font-size: 0.74rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1.8rem;
}

.form-file {
    width: 100%;
    padding: 0.65rem 0.7rem;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.form-file:hover {
    border-color: rgba(255, 107, 53, 0.45);
    background: rgba(255, 107, 53, 0.04);
}

.form-file::file-selector-button {
    margin-right: 0.7rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 0.76rem;
    cursor: pointer;
}

/* ==========================================================================
   Card, pannelli, alert, badge e chip
   ========================================================================== */

.card,
.panel {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.panel {
    padding: clamp(1.25rem, 3vw, 1.9rem);
}

.panel-title {
    margin-bottom: 1rem;
    font-size: 1.12rem;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.panel-head h2,
.panel-head h3 {
    font-size: 1.12rem;
}

.panel-head p {
    margin-top: 0.18rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-hover {
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card-hover:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.34);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1.2rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.55;
}

.alert .icon {
    margin-top: 0.15rem;
}

.alert-success {
    background: rgba(0, 210, 198, 0.08);
    border-color: rgba(0, 210, 198, 0.22);
    color: #8ff5ed;
}

.alert-error {
    background: rgba(255, 80, 80, 0.08);
    border-color: rgba(255, 80, 80, 0.22);
    color: #ffb0b0;
}

.alert-info {
    background: rgba(255, 107, 53, 0.08);
    border-color: rgba(255, 107, 53, 0.22);
    color: #ffb999;
}

.alert ul {
    margin: 0.35rem 0 0 1rem;
    padding: 0;
    list-style: disc;
}

.alert li {
    margin: 0.15rem 0;
}

.alert a {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.68rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(255, 107, 53, 0.11);
    border-color: rgba(255, 107, 53, 0.24);
    color: #ffb18e;
}

.badge-teal {
    background: rgba(0, 210, 198, 0.1);
    border-color: rgba(0, 210, 198, 0.24);
    color: var(--secondary);
}

.badge-muted {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.badge-pending {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.24);
    color: #ffd166;
}

.badge-media {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 4;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.3;
}

.chip .icon {
    width: 13px;
    height: 13px;
}

.chip-primary {
    background: rgba(255, 107, 53, 0.08);
    border-color: rgba(255, 107, 53, 0.2);
    color: #ffb18e;
}

.chip-teal {
    background: rgba(0, 210, 198, 0.07);
    border-color: rgba(0, 210, 198, 0.2);
    color: var(--secondary);
}

/* ==========================================================================
   Hero della homepage
   ========================================================================== */

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 12% 15%, rgba(255, 107, 53, 0.14), transparent 46%),
        radial-gradient(ellipse at 78% 65%, rgba(0, 210, 198, 0.09), transparent 44%),
        linear-gradient(165deg, rgba(10, 15, 28, 0.25) 0%, rgba(14, 22, 42, 0.7) 55%, rgba(10, 15, 28, 0.95) 100%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.18;
    -webkit-mask-image: radial-gradient(ellipse at 55% 35%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 55% 35%, #000 0%, transparent 70%);
    pointer-events: none;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.hero-orb-one {
    top: -220px;
    right: -120px;
    width: 480px;
    height: 480px;
    background: var(--primary);
    opacity: 0.22;
}

.hero-orb-two {
    bottom: -200px;
    left: -140px;
    width: 420px;
    height: 420px;
    background: var(--secondary);
    opacity: 0.1;
}

.hero-shell {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.hero-copy {
    max-width: 660px;
    animation: fade-up 0.8s ease both;
}

.hero-title {
    margin: 1.1rem 0 1.35rem;
    font-size: clamp(2.9rem, 5.6vw, 5rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero-subtitle {
    max-width: 540px;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.8vw, 1.12rem);
    line-height: 1.78;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1.3rem;
    margin-top: 2.4rem;
}

.hero-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.hero-feature .icon {
    width: 16px;
    height: 16px;
    color: var(--secondary);
}

/* Visual decorativo della hero */

.hero-visual {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-up 0.9s 0.12s ease both;
}

.hero-visual::before {
    content: "";
    position: absolute;
    width: 390px;
    height: 390px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    animation: spin-slow 45s linear infinite;
}

.hero-visual::after {
    content: "";
    position: absolute;
    width: 282px;
    height: 282px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.float-card {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(20, 26, 46, 0.86);
    box-shadow: 0 32px 75px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 3;
}

.float-card-main {
    top: 50%;
    left: 50%;
    width: min(340px, 86%);
    padding: 1.5rem;
    transform: translate(-50%, -50%);
    animation: float-main 7s ease-in-out infinite;
}

.float-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--secondary);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.float-destination {
    margin-top: 0.65rem;
    font-size: 1.9rem;
    letter-spacing: -0.04em;
}

.float-country {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.float-route {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.35rem 0;
    padding: 0 0.2rem;
}

.float-route::before {
    content: "";
    position: absolute;
    left: 0.35rem;
    right: 0.35rem;
    top: 50%;
    border-top: 1px dashed rgba(255, 255, 255, 0.22);
    transform: translateY(-50%);
}

.route-point {
    position: relative;
    z-index: 1;
    width: 9px;
    height: 9px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    background: var(--card-bg);
}

.route-point.end {
    border-color: var(--primary);
}

.route-plane {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 107, 53, 0.14);
    color: var(--primary);
}

.float-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-stack {
    display: flex;
    padding-left: 0.35rem;
}

.avatar-stack span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: -0.35rem;
    border: 2px solid var(--card-bg);
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8a5c, var(--primary));
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
}

.avatar-stack span:nth-child(2) {
    background: linear-gradient(135deg, #4af0e4, var(--secondary));
    color: #032b2b;
}

.avatar-stack span:nth-child(3) {
    background: linear-gradient(135deg, #8996b8, #5d6a8a);
}

.float-people {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.float-people strong {
    display: block;
    color: var(--text-light);
    font-size: 0.78rem;
}

.float-card-compat {
    top: 34px;
    right: -14px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    animation: float-soft 8s ease-in-out infinite;
}

.compat-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--secondary);
    color: #032b2b;
    box-shadow: 0 0 0 6px rgba(0, 210, 198, 0.1), 0 10px 26px rgba(0, 210, 198, 0.28);
}

.compat-core strong {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.compat-core small {
    margin-top: 0.1rem;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.78;
}

.float-meta strong {
    display: block;
    font-size: 0.8rem;
}

.float-meta span {
    display: block;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.float-card-note {
    bottom: 54px;
    left: -16px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1rem;
    animation: float-soft 9s 0.8s ease-in-out infinite;
}

.float-note-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(0, 210, 198, 0.12);
    color: var(--secondary);
}

.float-card-note strong {
    display: block;
    font-size: 0.78rem;
}

.float-note-text > span {
    display: block;
    color: var(--text-muted);
    font-size: 0.66rem;
}

@keyframes float-main {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-13px); }
}

@keyframes float-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-11px); }
}

@keyframes spin-slow {
    to { transform: rotate(360deg); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Intestazioni di sezione e griglia annunci
   ========================================================================== */

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}

.section-head h2 {
    margin-top: 0.35rem;
    font-size: clamp(1.75rem, 3.8vw, 2.5rem);
}

.section-head p {
    max-width: 460px;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.section-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 335px), 1fr));
    gap: 1.35rem;
}

.listing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.listing-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 107, 53, 0.34);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.card-media {
    position: relative;
    min-height: 168px;
    padding: 1.35rem;
    overflow: hidden;
    background: linear-gradient(135deg, #1b2d52 0%, #111a30 58%, #1d1b2d 100%);
}

.card-media::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 86% 12%, rgba(0, 210, 198, 0.28), transparent 44%),
        radial-gradient(circle at 6% 94%, rgba(255, 107, 53, 0.24), transparent 42%);
}

.card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 19px 19px;
    opacity: 0.24;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

/* Foto di copertina nelle card: immagine ritagliata con overlay leggibile. */
.card-cover {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-media.has-photo {
    background: var(--bg-dark);
}

.card-media.has-photo::before {
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(10, 15, 28, 0.42) 0%,
        rgba(10, 15, 28, 0.2) 38%,
        rgba(10, 15, 28, 0.9) 100%
    );
}

.card-media.has-photo::after {
    z-index: 1;
    opacity: 0.1;
}

.card-media.has-photo .media-route {
    z-index: 2;
    color: rgba(255, 255, 255, 0.55);
}

.card-media.has-photo .media-kicker {
    color: rgba(255, 255, 255, 0.82);
}

.media-content {
    position: relative;
    z-index: 2;
    padding-right: 4.5rem;
}

.media-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: rgba(248, 249, 250, 0.64);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.media-destination {
    margin-top: 0.45rem;
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.media-destination a {
    color: var(--text-light);
    transition: color var(--transition);
}

.media-destination a:hover {
    color: #ffd2c1;
}

.media-route {
    position: absolute;
    right: 1.3rem;
    bottom: 1.1rem;
    width: 105px;
    height: 62px;
    color: rgba(255, 255, 255, 0.34);
    z-index: 1;
}

.media-route .route-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.3;
    stroke-dasharray: 4 5;
}

.media-route .route-icon {
    fill: none;
    stroke: var(--secondary);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.compat-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--secondary);
    color: #032b2b;
    box-shadow: 0 0 0 5px rgba(0, 210, 198, 0.1), 0 10px 28px rgba(0, 210, 198, 0.28);
}

.compat-score {
    font-family: var(--font-heading);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1;
}

.compat-label {
    margin-top: 0.1rem;
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.78rem;
    padding: 1.25rem 1.35rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.meta-item .icon {
    width: 14px;
    height: 14px;
    color: var(--secondary);
}

.card-desc {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.95rem 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.1);
}

.author-mini {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.author-avatar,
.author-avatar-fallback {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.author-avatar {
    object-fit: cover;
}

.author-avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff9a5b);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.author-info {
    min-width: 0;
}

.author-name {
    display: block;
    overflow: hidden;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.author-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.65rem;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

/* ==========================================================================
   Stato vuoto e banner CTA
   ========================================================================== */

.empty-state {
    position: relative;
    padding: clamp(2.6rem, 7vw, 4.5rem) 1.5rem;
    overflow: hidden;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 210, 198, 0.08), transparent 58%),
        var(--card-bg);
    text-align: center;
}

.empty-state-icon {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    margin: 0 auto 1.15rem;
    border-radius: 20px;
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary);
}

.empty-state-icon .icon {
    width: 30px;
    height: 30px;
}

.empty-state h1,
.empty-state h2,
.empty-state h3 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.empty-state p {
    max-width: 460px;
    margin: 0 auto 1.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.empty-list {
    padding: 1.2rem 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: center;
}

.cta-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    overflow: hidden;
    padding: clamp(1.7rem, 4vw, 2.6rem);
    border: 1px solid rgba(255, 107, 53, 0.24);
    border-radius: 22px;
    background:
        radial-gradient(circle at 85% 15%, rgba(0, 210, 198, 0.16), transparent 36%),
        linear-gradient(120deg, rgba(255, 107, 53, 0.16) 0%, rgba(20, 26, 46, 0.95) 55%);
    box-shadow: var(--box-shadow);
}

.cta-banner h2 {
    margin: 0.35rem 0 0.5rem;
    font-size: clamp(1.5rem, 3.4vw, 2.2rem);
}

.cta-banner p {
    max-width: 520px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Pagina dettaglio annuncio
   ========================================================================== */

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: color var(--transition);
}

.breadcrumb:hover {
    color: var(--secondary);
}

.listing-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    animation: fade-up 0.7s ease both;
}

.listing-hero-copy {
    min-width: 0;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.compat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.75rem;
    border: 1px solid rgba(0, 210, 198, 0.3);
    border-radius: 999px;
    background: rgba(0, 210, 198, 0.1);
    color: var(--secondary);
    font-size: 0.74rem;
    font-weight: 600;
}

.compat-pill strong {
    color: #032b2b;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: var(--secondary);
    font-size: 0.7rem;
    font-weight: 800;
}

.compat-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 0 4px rgba(0, 210, 198, 0.12);
}

.listing-title {
    margin-bottom: 0.75rem;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.listing-subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 1.15rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.listing-subtitle .meta-item .icon {
    color: var(--secondary);
}

.listing-subtitle a {
    color: var(--secondary);
    font-weight: 600;
}

.compat-hero {
    flex-shrink: 0;
}

.compat-ring-xl {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 136px;
    height: 136px;
    border-radius: 50%;
    background: var(--secondary);
    color: #032b2b;
    box-shadow: 0 0 0 11px rgba(0, 210, 198, 0.08), 0 22px 55px rgba(0, 210, 198, 0.24);
}

.compat-ring-value {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

.compat-ring-label {
    margin-top: 0.2rem;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    opacity: 0.8;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.7fr);
    gap: 1.4rem;
    align-items: start;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sticky-card {
    position: sticky;
    top: calc(var(--header-height) + 1.4rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 1.7rem);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
}

.description {
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.82;
    overflow-wrap: anywhere;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.022);
}

.detail-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(255, 107, 53, 0.09);
    color: var(--primary);
}

.detail-icon .icon {
    width: 18px;
    height: 18px;
}

.detail-label {
    display: block;
    margin-bottom: 0.12rem;
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.detail-value {
    display: block;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
}

.author-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.author-card-avatar,
.author-card-avatar-fallback {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.author-card-avatar {
    object-fit: cover;
}

.author-card-avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff9a5b);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
}

.author-card-name {
    display: block;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 1.02rem;
    font-weight: 600;
    transition: color var(--transition);
}

.author-card-name:hover {
    color: var(--secondary);
}

.author-card-meta {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.author-card-bio {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.65;
}

.link-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.link-profile:hover {
    color: #7ff7ef;
}

.cta-note {
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.5;
    text-align: center;
}

.match-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.9rem 0 1.1rem;
}

.match-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.match-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.match-status {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
}

.match-ok {
    background: rgba(0, 210, 198, 0.1);
    border-color: rgba(0, 210, 198, 0.24);
    color: var(--secondary);
}

.match-no {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
}

.owner-panel {
    border-color: rgba(255, 107, 53, 0.18);
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 107, 53, 0.1), transparent 55%),
        var(--card-bg);
}

/* ==========================================================================
   Profilo pubblico
   ========================================================================== */

.profile-hero {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: clamp(1.3rem, 3vw, 2.2rem);
    align-items: center;
    overflow: hidden;
    margin-bottom: 2.4rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 8%, rgba(0, 210, 198, 0.13), transparent 34%),
        radial-gradient(circle at 3% 100%, rgba(255, 107, 53, 0.12), transparent 34%),
        var(--card-bg);
    box-shadow: var(--box-shadow);
}

.profile-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.14;
    -webkit-mask-image: linear-gradient(120deg, #000, transparent 60%);
    mask-image: linear-gradient(120deg, #000, transparent 60%);
    pointer-events: none;
}

.profile-avatar-wrap {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.profile-avatar,
.profile-avatar-fallback {
    width: clamp(104px, 13vw, 142px);
    height: clamp(104px, 13vw, 142px);
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 0 0 0 7px rgba(255, 107, 53, 0.09);
}

.profile-avatar {
    object-fit: cover;
}

.profile-avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff9a5b);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
}

.profile-edit-fab {
    position: absolute;
    right: 0.1rem;
    bottom: 0.35rem;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 3px solid var(--card-bg);
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
    transition: transform var(--transition), background var(--transition);
}

.profile-edit-fab:hover {
    transform: scale(1.06);
    background: var(--primary-hover);
}

.profile-info {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.profile-name {
    margin: 0.3rem 0 0.4rem;
    font-size: clamp(2rem, 4.6vw, 3.2rem);
    letter-spacing: -0.045em;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.profile-meta .meta-item .icon {
    color: var(--secondary);
}

.profile-bio {
    max-width: 680px;
    margin: 1rem 0 1.1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.42rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-size: 0.74rem;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.social-link:hover {
    color: var(--secondary);
    border-color: rgba(0, 210, 198, 0.3);
    background: rgba(0, 210, 198, 0.06);
}

.social-link svg {
    width: 14px;
    height: 14px;
}

.dna-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.profile-stats {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 128px;
}

.stat {
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    text-align: center;
}

.stat-value {
    display: block;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value.small {
    font-size: 0.86rem;
    line-height: 2;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* ==========================================================================
   Pagine form (nuovo annuncio, modifica profilo)
   ========================================================================== */

.page-head {
    max-width: 760px;
    margin-bottom: 2rem;
}

.page-head h1 {
    margin: 0.45rem 0 0.7rem;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    letter-spacing: -0.045em;
}

.page-head p {
    max-width: 620px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.68fr);
    gap: 1.4rem;
    align-items: start;
}

.form-card {
    padding: clamp(1.3rem, 3vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
}

.form-section + .form-section {
    margin-top: 1.8rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.form-section-title {
    margin-bottom: 1rem;
    font-size: 1.02rem;
}

.form-section-title span {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0;
}

.form-side {
    position: sticky;
    top: calc(var(--header-height) + 1.4rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tip-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(0, 210, 198, 0.16);
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 210, 198, 0.1), transparent 55%),
        var(--card-bg);
}

.tip-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 0.8rem;
    border-radius: 12px;
    background: rgba(0, 210, 198, 0.1);
    color: var(--secondary);
}

.tip-card h2 {
    margin-bottom: 0.55rem;
    font-size: 1.05rem;
}

.tip-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tip-list li {
    position: relative;
    padding-left: 1.1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.tip-list li::before {
    content: "";
    position: absolute;
    top: 0.55rem;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

.avatar-upload {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.avatar-preview,
.avatar-preview-fallback {
    width: 86px;
    height: 86px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(255, 107, 53, 0.08);
}

.avatar-preview {
    object-fit: cover;
}

.avatar-preview-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff9a5b);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
}

.avatar-field {
    min-width: 0;
    flex: 1;
}

.avatar-field .form-help {
    display: block;
    margin-top: 0.4rem;
}

/* ==========================================================================
   Pagine di autenticazione
   ========================================================================== */

.page-auth {
    background: var(--bg-dark);
}

.page-auth .site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.page-auth .auth-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    overflow: hidden;
    padding: 7.5rem 1.2rem 3.5rem;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 18% 20%, rgba(255, 107, 53, 0.18), transparent 44%),
        radial-gradient(ellipse at 82% 72%, rgba(0, 210, 198, 0.12), transparent 44%),
        linear-gradient(160deg, #0a0f1c 0%, #111b35 48%, #0a0f1c 100%);
}

.auth-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.2;
    -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 42%, #000 0%, transparent 70%);
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(85px);
    opacity: 0.35;
}

.auth-orb-one {
    top: -120px;
    right: 8%;
    width: 360px;
    height: 360px;
    background: var(--primary);
}

.auth-orb-two {
    bottom: -140px;
    left: 6%;
    width: 340px;
    height: 340px;
    background: var(--secondary);
    opacity: 0.16;
}

.auth-route {
    position: absolute;
    right: 8%;
    top: 18%;
    width: min(340px, 32vw);
    color: rgba(255, 255, 255, 0.14);
    display: none;
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    padding: clamp(1.6rem, 4vw, 2.4rem);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    background: rgba(20, 26, 46, 0.84);
    box-shadow: 0 32px 85px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.45), transparent 38%, rgba(0, 210, 198, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.auth-card-logo {
    display: flex;
    align-items: center;
    width: max-content;
    gap: 0.55rem;
    margin-bottom: 1.1rem;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-card-logo .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.auth-card-logo .brand-mark svg {
    width: 18px;
    height: 18px;
}

.auth-card h1 {
    margin: 0.5rem 0 0.35rem;
    font-size: clamp(1.8rem, 4vw, 2.15rem);
    letter-spacing: -0.04em;
}

.auth-subtitle {
    margin-bottom: 1.4rem;
    color: var(--text-muted);
    font-size: 0.87rem;
    line-height: 1.6;
}

.auth-card .form-group + .form-group {
    margin-top: 0.9rem;
}

.auth-card .btn-block {
    margin-top: 1.2rem;
}

.auth-alt {
    margin-top: 1.3rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

.auth-alt a {
    color: var(--primary);
    font-weight: 600;
}

.auth-alt a:hover {
    color: #ff9a70;
}

.auth-back {
    display: block;
    margin-top: 0.9rem;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-align: center;
    transition: color var(--transition);
}

.auth-back:hover {
    color: var(--secondary);
}

.page-auth .site-footer {
    position: relative;
    z-index: 2;
    margin-top: 0;
    padding: 1rem 0;
    background: rgba(8, 12, 23, 0.6);
}

.page-auth .footer-shell {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.page-auth .footer-brand {
    display: none;
}

.page-auth .footer-links {
    justify-content: center;
    padding-top: 0;
}

.page-auth .footer-link-main {
    display: none;
}

.page-auth .footer-copy {
    padding-top: 0;
    text-align: center;
}

/* ==========================================================================
   Travel Board
   ========================================================================== */

.board-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
}

.board-head h1 {
    margin: 0.35rem 0 0.45rem;
    font-size: clamp(2rem, 4.5vw, 3rem);
    letter-spacing: -0.045em;
}

.board-head p {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.board-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 1.25rem;
    align-items: start;
}

.board-panel {
    padding: clamp(1.2rem, 3vw, 1.6rem);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
}

.badge-count {
    flex-shrink: 0;
    padding: 0.28rem 0.65rem;
    border: 1px solid rgba(0, 210, 198, 0.22);
    border-radius: 999px;
    background: rgba(0, 210, 198, 0.08);
    color: var(--secondary);
    font-size: 0.7rem;
    font-weight: 700;
}

.progress {
    height: 8px;
    margin-bottom: 1.15rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.4s ease;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.inline-form .form-input {
    min-width: 0;
    flex: 1;
    padding: 0.7rem 0.8rem;
    font-size: 0.85rem;
}

.inline-form .form-input[type="number"] {
    flex: 0 0 112px;
}

.inline-form .btn {
    flex-shrink: 0;
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
}

.checklist,
.expense-list {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.check-item,
.expense-item {
    display: flex;
    align-items: center;
    gap: 0.58rem;
    padding: 0.58rem 0.45rem;
    border-radius: 10px;
    transition: background var(--transition);
}

.check-item:hover,
.expense-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.check-form {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.check-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--secondary);
    cursor: pointer;
}

.check-text {
    flex: 1;
    min-width: 0;
    color: var(--text-light);
    font-size: 0.86rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    transition: color var(--transition);
}

.check-item.is-done .check-text {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(0, 210, 198, 0.6);
}

.delete-form {
    display: flex;
    flex-shrink: 0;
}

.btn-delete {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: rgba(160, 170, 191, 0.45);
    font-size: 1.05rem;
    line-height: 1;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.btn-delete:hover {
    color: #ffb0b0;
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.2);
}

.expense-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(0, 210, 198, 0.18);
    border-radius: 12px;
    background: rgba(0, 210, 198, 0.07);
}

.expense-total span {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.expense-total strong {
    color: var(--secondary);
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.expense-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.expense-item:last-child {
    border-bottom: 0;
}

.expense-text {
    flex: 1;
    min-width: 0;
    color: var(--text-light);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.expense-amount {
    flex-shrink: 0;
    color: var(--secondary);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ==========================================================================
   Pagina di manutenzione
   ========================================================================== */

.maintenance-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 58px);
    overflow: hidden;
    padding: clamp(3rem, 8vw, 6rem) 1.2rem;
}

.maintenance-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255, 107, 53, 0.14), transparent 45%),
        radial-gradient(ellipse at 80% 75%, rgba(0, 210, 198, 0.1), transparent 45%);
    pointer-events: none;
}

.maintenance-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    padding: clamp(2rem, 5vw, 3.5rem);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 28px;
    background: rgba(20, 26, 46, 0.84);
    box-shadow: 0 35px 90px rgba(0, 0, 0, 0.45);
    text-align: center;
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}

.maintenance-compass {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.4rem;
    color: var(--primary);
}

.maintenance-card h1 {
    margin: 0.8rem 0 0.9rem;
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.maintenance-card p {
    max-width: 540px;
    margin: 0 auto 1.4rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.75;
}

.maintenance-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.6rem 0 2rem;
}

.maintenance-note {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.maintenance-note a {
    color: var(--secondary);
    font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    margin-top: auto;
    padding: 2.6rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #080c17;
}

.footer-shell {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-brand {
    max-width: 330px;
}

.footer-brand .brand {
    margin-bottom: 0.6rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.65;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    padding-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-links a {
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-copy {
    padding-top: 0.45rem;
    color: rgba(160, 170, 191, 0.6);
    font-size: 0.72rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 1100px) {
    .auth-route {
        display: block;
    }
}

@media (max-width: 1080px) {
    .hero-shell {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-copy {
        max-width: 760px;
    }

    .hero-visual {
        display: none;
    }

    .form-layout,
    .detail-layout {
        grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    }

    .form-side {
        position: static;
    }
}

@media (max-width: 900px) {
    .form-layout,
    .detail-layout,
    .board-grid {
        grid-template-columns: 1fr;
    }

    .sticky-card {
        position: static;
    }

    .listing-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.2rem;
    }

    .compat-hero {
        align-self: flex-start;
    }

    .profile-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .profile-stats {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .profile-stats .stat {
        flex: 1;
        min-width: 110px;
    }
}

@media (max-width: 980px) {
    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
        padding: 0.9rem clamp(1.1rem, 4vw, 2.5rem) 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(10, 15, 28, 0.98);
        box-shadow: 0 24px 45px rgba(0, 0, 0, 0.4);
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-link {
        padding: 0.7rem 0.8rem;
    }

    .nav-user {
        margin: 0.25rem 0;
        padding: 0.45rem 0.8rem 0.45rem 0.45rem;
    }

    .nav-logout {
        margin-left: 0;
    }

    .nav-toggle[aria-expanded="true"] + .site-nav {
        display: flex;
    }

    .hero {
        padding-top: 3.2rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .section-head {
        align-items: flex-start;
    }

    .page-auth .site-nav {
        background: rgba(10, 15, 28, 0.98);
    }
}

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

    .card-footer {
        flex-wrap: wrap;
    }

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

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .profile-hero {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .profile-info {
        width: 100%;
    }

    .profile-meta,
    .social-row,
    .dna-row,
    .profile-actions {
        justify-content: center;
    }

    .profile-bio {
        margin-left: auto;
        margin-right: auto;
    }

    .profile-stats {
        width: 100%;
    }

    .avatar-upload {
        flex-direction: column;
        align-items: flex-start;
    }

    .avatar-field {
        width: 100%;
    }

    .inline-form {
        flex-wrap: wrap;
    }

    .inline-form .form-input[type="number"] {
        flex: 1 1 100%;
    }

    .inline-form .btn {
        width: 100%;
    }

    .footer-shell {
        flex-direction: column;
        gap: 1.1rem;
    }

    .footer-links {
        padding-top: 0;
    }

    .cta-banner {
        align-items: flex-start;
    }

    .cta-banner .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .brand-text {
        font-size: 1rem;
    }

    .nav-greeting {
        font-size: 0.64rem;
    }

    .hero-title {
        font-size: clamp(2.6rem, 13vw, 3.8rem);
    }

    .card-media {
        min-height: 152px;
    }

    .compat-badge {
        width: 58px;
        height: 58px;
    }

    .compat-score {
        font-size: 0.92rem;
    }

    .compat-label {
        font-size: 0.46rem;
    }

    .listing-title {
        font-size: clamp(2rem, 11vw, 2.7rem);
    }

    .compat-ring-xl {
        width: 112px;
        height: 112px;
    }

    .compat-ring-value {
        font-size: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Messaggi e chat privata
   ========================================================================== */

.messages-shell {
    max-width: 920px;
}

.messages-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin-bottom: 1.7rem;
}

.messages-head .section-count {
    margin-top: 0.45rem;
}

.messages-head h1 {
    margin: 0.35rem 0 0.45rem;
    font-size: clamp(2.1rem, 4.6vw, 3.1rem);
    letter-spacing: -0.05em;
}

.messages-head p {
    max-width: 560px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.message-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    color: inherit;
    text-decoration: none;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.message-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 210, 198, 0.3);
    background: #171f35;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
}

.conversation-avatar-wrap {
    flex-shrink: 0;
}

.conversation-avatar,
.conversation-avatar-fallback {
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.conversation-avatar {
    object-fit: cover;
}

.conversation-avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff9a5b);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
}

.conversation-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: 0.12rem;
}

.conversation-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
}

.conversation-name {
    overflow: hidden;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.68rem;
    white-space: nowrap;
}

.conversation-dest {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    overflow: hidden;
    color: var(--secondary);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-dest .icon {
    width: 13px;
    height: 13px;
}

.conversation-excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 0.22rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.tu-prefix {
    color: var(--text-light);
    font-weight: 600;
}

.unread-badge {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    min-width: 24px;
    height: 24px;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--secondary);
    color: #032b2b;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 0 0 4px rgba(0, 210, 198, 0.09);
}

.conversation-arrow {
    flex-shrink: 0;
    color: rgba(160, 170, 191, 0.45);
    transition: color var(--transition), transform var(--transition);
}

.conversation-arrow .icon {
    width: 17px;
    height: 17px;
}

.message-card:hover .conversation-arrow {
    color: var(--secondary);
    transform: translateX(2px);
}

/* Chat */

.chat-shell {
    max-width: 900px;
}

.chat-card {
    display: flex;
    flex-direction: column;
    height: min(740px, calc(100vh - 250px));
    min-height: 520px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
}

.chat-back {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.chat-back:hover {
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.chat-back .icon {
    width: 17px;
    height: 17px;
}

.chat-header-avatar,
.chat-header-avatar-fallback {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
}

.chat-header-avatar {
    object-fit: cover;
}

.chat-header-avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff9a5b);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
}

.chat-header-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: 0.08rem;
}

.chat-header-name {
    overflow: hidden;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--transition);
}

.chat-header-name:hover {
    color: var(--secondary);
}

.chat-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.28rem;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.4;
    text-overflow: ellipsis;
}

.chat-header-meta .icon {
    width: 13px;
    height: 13px;
    color: var(--secondary);
}

.chat-annuncio-link {
    flex-shrink: 0;
}

.chat-alert {
    padding: 0.85rem 1rem 0;
}

.chat-alert .alert {
    margin-bottom: 0;
}

.chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.42rem;
    overflow-y: auto;
    padding: 1.2rem;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 107, 53, 0.035), transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(0, 210, 198, 0.035), transparent 40%),
        rgba(10, 15, 28, 0.45);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.chat-date {
    align-self: center;
    margin: 0.5rem 0 0.65rem;
    padding: 0.22rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.msg-row {
    display: flex;
    width: 100%;
}

.msg-in {
    justify-content: flex-start;
}

.msg-out {
    justify-content: flex-end;
}

.msg-bubble {
    max-width: 74%;
    padding: 0.62rem 0.82rem 0.48rem;
    border-radius: 15px;
    font-size: 0.88rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.msg-bubble p {
    margin: 0;
}

.msg-in .msg-bubble {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 5px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-light);
}

.msg-out .msg-bubble {
    border-bottom-right-radius: 5px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff8b53 100%);
    color: #0a0f1c;
    box-shadow: 0 8px 22px rgba(255, 107, 53, 0.16);
}

.msg-meta {
    display: block;
    margin-top: 0.24rem;
    color: rgba(160, 170, 191, 0.65);
    font-size: 0.6rem;
    line-height: 1.2;
    text-align: right;
}

.msg-out .msg-meta {
    color: rgba(10, 15, 28, 0.62);
}

.chat-empty {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.chat-empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 0.9rem;
    border-radius: 18px;
    background: rgba(0, 210, 198, 0.09);
    color: var(--secondary);
}

.chat-empty-icon .icon {
    width: 26px;
    height: 26px;
}

.chat-empty h2 {
    margin-bottom: 0.35rem;
    font-size: 1.15rem;
}

.chat-empty p {
    max-width: 360px;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}

.chat-input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    max-height: 128px;
    padding: 0.72rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 12px;
    background: rgba(10, 15, 28, 0.55);
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.45;
    outline: none;
    resize: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.chat-input::placeholder {
    color: rgba(160, 170, 191, 0.55);
}

.chat-input:focus {
    border-color: var(--primary);
    background: rgba(10, 15, 28, 0.7);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.13), 0 0 20px rgba(255, 107, 53, 0.07);
}

.chat-send {
    flex-shrink: 0;
    min-height: 48px;
}

.chat-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.85rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    text-align: center;
}

.chat-note .icon {
    width: 13px;
    height: 13px;
}

.sticky-card .alert {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .messages-head h1 {
        font-size: 2.1rem;
    }

    .message-card {
        gap: 0.7rem;
        padding: 0.85rem 0.9rem;
    }

    .conversation-avatar,
    .conversation-avatar-fallback {
        width: 48px;
        height: 48px;
    }

    .conversation-name {
        font-size: 0.9rem;
    }

    .conversation-time {
        font-size: 0.62rem;
    }

    .conversation-excerpt {
        font-size: 0.78rem;
        -webkit-line-clamp: 2;
    }

    .conversation-arrow {
        display: none;
    }

    .chat-card {
        height: calc(100dvh - 190px);
        min-height: 500px;
        border-radius: 16px;
    }

    .chat-header {
        padding: 0.75rem 0.8rem;
        gap: 0.55rem;
    }

    .chat-back {
        width: 32px;
        height: 32px;
    }

    .chat-header-avatar,
    .chat-header-avatar-fallback {
        width: 40px;
        height: 40px;
    }

    .chat-header-name {
        font-size: 0.9rem;
    }

    .chat-header-meta {
        font-size: 0.64rem;
    }

    .chat-annuncio-link {
        width: 36px;
        height: 36px;
        padding: 0;
        overflow: hidden;
        font-size: 0;
    }

    .chat-annuncio-link .icon {
        width: 17px;
        height: 17px;
    }

    .chat-messages {
        padding: 0.9rem;
    }

    .msg-bubble {
        max-width: 86%;
        font-size: 0.84rem;
    }

    .chat-composer {
        padding: 0.7rem;
        gap: 0.45rem;
    }

    .chat-input {
        font-size: 16px;
    }

    .chat-send {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}

/* ==========================================================================
   Verifica email e recupero password
   ========================================================================== */

.auth-link-row {
    margin: 0.85rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.auth-link-row a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--transition);
}

.auth-link-row a:hover {
    color: var(--secondary);
}

.auth-status {
    text-align: center;
}

.auth-status .auth-card-logo {
    margin-left: auto;
    margin-right: auto;
}

.auth-status-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0.4rem auto 1.1rem;
    border: 1px solid transparent;
    border-radius: 50%;
}

.auth-status-icon .icon {
    width: 31px;
    height: 31px;
}

.auth-status-icon.is-success {
    border-color: rgba(0, 210, 198, 0.35);
    background: rgba(0, 210, 198, 0.1);
    color: var(--secondary);
    box-shadow: 0 0 0 8px rgba(0, 210, 198, 0.05);
}

.auth-status-icon.is-error {
    border-color: rgba(255, 80, 80, 0.3);
    background: rgba(255, 80, 80, 0.08);
    color: #ffb0b0;
    box-shadow: 0 0 0 8px rgba(255, 80, 80, 0.04);
}

.auth-status h1 {
    margin-top: 0.55rem;
}

.auth-status .btn-block {
    margin-top: 1.4rem;
}

.auth-status .auth-alt {
    margin-top: 1.1rem;
}


/* ==========================================================================
   Scelte multiple del Travel DNA
   ========================================================================== */

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.45rem;
}

.check-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.check-option:hover {
    border-color: rgba(255, 107, 53, 0.32);
    color: var(--text-light);
}

.check-option:has(input:checked) {
    border-color: rgba(255, 107, 53, 0.45);
    background: rgba(255, 107, 53, 0.08);
    color: var(--text-light);
}

.check-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}


/* ==========================================================================
   Pagine legali e cookie banner
   ========================================================================== */

.page-legal {
    background: var(--bg-dark);
}

.legal-main {
    padding: clamp(2rem, 5vw, 4rem) 0;
}

.legal-shell {
    max-width: 980px;
}

.legal-doc {
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
}

.legal-doc h1 {
    margin: 0.55rem 0 0.35rem;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    letter-spacing: -0.04em;
}

.legal-doc h2 {
    margin: 2rem 0 0.7rem;
    color: var(--text-light);
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    letter-spacing: -0.02em;
}

.legal-doc h3 {
    margin: 1.3rem 0 0.45rem;
    color: var(--text-light);
    font-size: 1rem;
}

.legal-doc p,
.legal-doc li {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

.legal-doc p {
    margin-bottom: 0.9rem;
}

.legal-doc ul,
.legal-doc ol {
    margin: 0.4rem 0 1.1rem 1.2rem;
    padding: 0;
}

.legal-doc li {
    margin-bottom: 0.35rem;
}

.legal-doc strong {
    color: var(--text-light);
}

.legal-doc a {
    color: var(--secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-doc a:hover {
    color: var(--primary);
}

.legal-updated {
    margin-bottom: 1.5rem;
    color: rgba(203, 213, 225, 0.65) !important;
    font-size: 0.76rem !important;
}

.legal-intro {
    color: var(--text-muted);
    font-size: 1rem !important;
    line-height: 1.8;
}

.legal-box {
    margin: 1rem 0 1.4rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 107, 53, 0.24);
    border-radius: 12px;
    background: rgba(255, 107, 53, 0.06);
}

.legal-box p:last-child {
    margin-bottom: 0;
}

.legal-toc {
    margin: 1.2rem 0 1.8rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.legal-toc strong {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 0.82rem;
}

.legal-toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.legal-toc li {
    margin: 0;
}

.legal-toc a {
    font-size: 0.8rem;
}

.legal-table-wrap {
    margin: 1rem 0 1.4rem;
    overflow-x: auto;
}

.legal-doc table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.legal-doc th,
.legal-doc td {
    padding: 0.72rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: left;
    vertical-align: top;
}

.legal-doc th {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-light);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.legal-back-link {
    margin-top: 1.4rem;
}

/* Footer: link legali e gestione cookie */

.footer-cookie-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: color var(--transition);
}

.footer-cookie-link:hover {
    color: var(--secondary);
}

.footer-copy-sep {
    margin: 0 0.3rem;
    opacity: 0.55;
}

/* Banner cookie */

.cookie-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    width: auto;
    max-width: 1120px;
    margin: 0 auto;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    background: rgba(20, 26, 46, 0.97);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.48);
    color: var(--text-light);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.cookie-banner[hidden],
.cookie-banner.is-hidden {
    display: none !important;
}

.cookie-banner-copy {
    max-width: 780px;
}

.cookie-banner-copy strong {
    display: block;
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.cookie-banner-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.6;
}

.cookie-banner-copy a {
    color: var(--secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.cookie-banner-actions .btn {
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
}

@media (max-width: 720px) {
    .cookie-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        right: 0.6rem;
        bottom: 0.6rem;
        left: 0.6rem;
        padding: 0.9rem;
    }

    .cookie-banner-actions {
        width: 100%;
    }

    .cookie-banner-actions .btn {
        flex: 1;
    }

    .legal-doc ul,
    .legal-doc ol {
        margin-left: 1rem;
    }
}


/* Il link di ritorno nelle pagine legali mantiene l'aspetto da bottone. */
.legal-doc .legal-back-link {
    color: var(--text-light);
    text-decoration: none;
}

.legal-doc .legal-back-link:hover {
    color: var(--text-light);
}


/* ==========================================================================
   Icone social nel footer
   ========================================================================== */

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.footer-social-link {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #e8c98c;
    transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition);
}

.footer-social-link svg {
    display: block;
    width: 24px;
    height: 24px;
}

.footer-social-link:hover {
    color: var(--primary);
    border-color: rgba(255, 107, 53, 0.4);
    background: rgba(255, 107, 53, 0.08);
    transform: translateY(-2px);
}

.footer-social-link:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.footer-copy-text {
    margin: 0;
    line-height: 1.55;
}

.page-auth .footer-social {
    justify-content: center;
}

/* ==========================================================================
   Conferma reciproca del viaggio (chat)
   ========================================================================== */

.trip-confirm-wrap {
    padding: 1rem 1.1rem 0;
}

.trip-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1.1rem;
    border: 1px solid rgba(255, 107, 53, 0.28);
    border-radius: 14px;
    background: rgba(255, 107, 53, 0.055);
}

.trip-confirm.is-confirmed {
    border-color: rgba(0, 210, 198, 0.38);
    background: rgba(0, 210, 198, 0.075);
}

.trip-confirm.is-waiting {
    border-color: rgba(232, 201, 140, 0.3);
    background: rgba(232, 201, 140, 0.055);
}

.trip-confirm-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.14);
    color: var(--primary);
}

.trip-confirm.is-confirmed .trip-confirm-icon {
    background: rgba(0, 210, 198, 0.16);
    color: var(--secondary);
}

.trip-confirm.is-waiting .trip-confirm-icon {
    background: rgba(232, 201, 140, 0.14);
    color: #e8c98c;
}

.trip-confirm-copy {
    flex: 1 1 240px;
    min-width: 0;
}

.trip-confirm-copy strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.98rem;
    color: var(--text-light);
}

.trip-confirm-copy p {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.trip-confirm-copy .trip-confirm-hint {
    margin-top: 0.3rem;
    color: var(--secondary);
    font-weight: 600;
}

.trip-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.trip-confirm-form {
    margin-left: auto;
}

/* Pulsante discreto per la conferma del viaggio */
.btn-small-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 5px 10px;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    background-color: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.8rem;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.btn-small-outline:hover {
    border-color: var(--primary);
    background-color: rgba(255, 107, 53, 0.08);
    color: var(--primary);
}

.btn-small-outline:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* ==========================================================================
   Recensioni
   ========================================================================== */

.reviews-section,
.profile-gallery-section {
    margin-top: 3.2rem;
}

.rating-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.rating-summary strong {
    color: var(--text-light);
}

.stars {
    display: inline-flex;
    align-items: center;
    gap: 0.08em;
    color: rgba(255, 255, 255, 0.22);
    font-size: 1rem;
    letter-spacing: 0.03em;
    line-height: 1;
}

.stars .star.is-on {
    color: #ffc857;
}

.review-note {
    margin-top: 0.9rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.review-form {
    margin: 1.1rem 0 1.5rem;
    border-color: rgba(0, 210, 198, 0.22);
}

.star-field {
    margin: 1rem 0 1.1rem;
    padding: 0;
    border: 0;
}

.star-field legend {
    margin-bottom: 0.45rem;
}

.star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.15rem;
}

.star-input input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.star-input label {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.22);
    font-size: 1.8rem;
    line-height: 1;
    transition: color var(--transition), transform var(--transition);
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
    color: #ffc857;
}

.star-input label:hover {
    transform: scale(1.08);
}

.star-input input:focus-visible + label {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
    border-radius: 4px;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.1rem;
}

.review-card {
    padding: 1.15rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
}

.review-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.review-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-strong);
}

.review-avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--secondary), #48e6dd);
    color: #06201f;
    font-size: 0.68rem;
    font-weight: 800;
}

.review-author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.review-author-info strong {
    color: var(--text-light);
    font-size: 0.88rem;
}

.review-author-info time {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.review-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.empty-state-compact {
    padding: 1.6rem 1.2rem;
    margin-top: 1rem;
}

/* ==========================================================================
   Gallery condivisa e Gallery Viaggi
   ========================================================================== */

.gallery-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.gallery-head h1 {
    margin: 0.35rem 0 0.5rem;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.gallery-head p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.gallery-head .dot {
    margin: 0 0.45rem;
}

.gallery-upload {
    padding: 1.35rem;
}

.gallery-upload-form {
    margin-top: 0.9rem;
}

.gallery-section {
    margin-top: 0.4rem;
}

.gallery-grid,
.gallery-trip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.15rem;
    margin-top: 1.1rem;
}

.gallery-card,
.gallery-trip-card {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
}

.gallery-photo {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--bg-elevated);
}

.gallery-photo-missing {
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.gallery-caption {
    padding: 0.9rem 1rem 1rem;
}

.gallery-description {
    margin-bottom: 0.4rem;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
}

.gallery-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.author-avatar-sm {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
}

.gallery-trip-cover {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--bg-elevated);
}

.gallery-trip-cover img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-trip-card:hover .gallery-trip-cover img {
    transform: scale(1.04);
}

.gallery-trip-placeholder {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 107, 53, 0.2), transparent 55%),
        radial-gradient(circle at 80% 60%, rgba(0, 210, 198, 0.16), transparent 55%),
        var(--bg-elevated);
    color: var(--secondary);
}

.gallery-trip-body {
    padding: 1rem 1.05rem 1.1rem;
}

.gallery-trip-body h3 {
    font-size: 1.05rem;
}

.gallery-trip-body h3 a:hover {
    color: var(--secondary);
}

.gallery-trip-meta {
    margin: 0.35rem 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.gallery-trip-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .trip-confirm-wrap {
        padding: 0.8rem 0.8rem 0;
    }

    .trip-confirm {
        padding: 0.85rem;
    }

    .trip-confirm-form {
        width: 100%;
        margin-left: 0;
    }

    .trip-confirm-form .btn {
        width: 100%;
    }

    .trip-confirm-actions {
        width: 100%;
    }

    .trip-confirm-actions .btn {
        flex: 1 1 auto;
    }

    .rating-summary {
        width: 100%;
        justify-content: center;
    }

    .gallery-grid,
    .gallery-trip-grid {
        grid-template-columns: 1fr;
    }

    .gallery-upload {
        padding: 1.1rem;
    }
}

/* ==========================================================================
   Ricerca, filtri e paginazione homepage
   ========================================================================== */

.search-panel {
    margin: 1.4rem 0 2rem;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
}

.search-main {
    display: flex;
    align-items: stretch;
    gap: 0.7rem;
}

.search-field {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transform: translateY(-50%);
}

.search-input {
    min-height: 48px;
    padding-left: 2.9rem;
}

.search-submit {
    min-width: 120px;
    min-height: 48px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.filter-field {
    min-width: 0;
}

.filter-field .form-label {
    margin-bottom: 0.3rem;
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-filter-submit {
    white-space: nowrap;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
}

.pagination-link,
.pagination-current,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.65rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.pagination-link:hover {
    border-color: rgba(255, 107, 53, 0.45);
    background: rgba(255, 107, 53, 0.08);
    color: var(--text-light);
}

.pagination-current {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.pagination-ellipsis {
    min-width: auto;
    padding: 0 0.2rem;
    border-color: transparent;
}

.pagination-arrow .icon {
    width: 18px;
    height: 18px;
}

.pagination-link.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ==========================================================================
   Autocomplete jQuery UI: tema scuro coerente con il sito
   ========================================================================== */

.ui-autocomplete {
    z-index: 1200;
    max-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.ui-autocomplete .ui-menu-item {
    margin: 0;
}

.ui-autocomplete .ui-menu-item-wrapper {
    padding: 0.6rem 0.75rem;
    border: 0;
    border-radius: 8px;
    color: var(--text-muted);
}

.ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete .ui-menu-item-wrapper:hover {
    margin: 0;
    border: 0;
    background: rgba(255, 107, 53, 0.12);
    color: var(--text-light);
}

@media (max-width: 900px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .search-panel {
        padding: 0.9rem;
    }

    .search-main {
        flex-direction: column;
    }

    .search-submit {
        width: 100%;
    }

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

    .search-actions {
        justify-content: stretch;
    }

    .search-actions .btn {
        flex: 1 1 auto;
    }

    .pagination-link,
    .pagination-current {
        min-width: 34px;
        height: 34px;
        padding: 0 0.5rem;
    }
}

/* ==========================================================================
   Foto degli annunci: anteprima nel form e galleria nel dettaglio
   ========================================================================== */

.photo-limit-note {
    color: var(--primary);
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.9rem;
}

.photo-preview-item {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    aspect-ratio: 4 / 3;
    background: var(--bg-elevated);
}

.photo-preview-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-gallery {
    margin: 1.5rem 0 2rem;
}

.listing-gallery-single {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.listing-gallery-single img {
    display: block;
    width: 100%;
    max-height: 540px;
    object-fit: cover;
}

.listing-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.listing-gallery-item {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--box-shadow);
}

.listing-gallery-item img {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
}

.listing-gallery-grid.has-three .listing-gallery-item:first-child {
    grid-column: 1 / -1;
}

.listing-gallery-grid.has-three .listing-gallery-item:first-child img {
    height: 340px;
}

@media (max-width: 640px) {
    .photo-preview-grid {
        gap: 0.45rem;
    }

    .listing-gallery-grid {
        grid-template-columns: 1fr;
    }

    .listing-gallery-grid.has-three .listing-gallery-item:first-child {
        grid-column: auto;
    }

    .listing-gallery-item img,
    .listing-gallery-grid.has-three .listing-gallery-item:first-child img {
        height: 220px;
    }

    .listing-gallery-single img {
        max-height: 380px;
    }
}

