/* ─── Tokens ────────────────────────────────────────────────────────────────── */
:root {
  --bg:          #0d0d0d;
  --bg-card:     #141414;
  --bg-hover:    #1c1c1c;
  --accent:      #c0392b;
  --accent-soft: rgba(192, 57, 43, 0.15);
  --gold:        #c8a97e;
  --text:        #e8e8e8;
  --text-muted:  #777;
  --text-dim:    #444;
  --border:      rgba(255,255,255,0.07);
  --radius:      4px;
  --font-head:   'Playfair Display', Georgia, serif;
  --font-body:   'Inter', system-ui, sans-serif;
  --nav-h:       64px;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ─── Fonts ─────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500&display=swap&display=swap');
/* font-display: swap injected via Google Fonts &display=swap above */

/* ─── Skip link ─────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--accent); color: #fff; padding: .4rem .8rem;
  border-radius: var(--radius); font-size: .85rem; z-index: 999;
}
.skip-link:focus { top: 1rem; }

/* ─── Nav ────────────────────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  background: rgba(13,13,13,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-family: var(--font-head);
  font-size: 1.15rem;
  letter-spacing: .04em;
  color: var(--gold);
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color .2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--accent);
  margin-top: 2px;
}

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  padding: clamp(5rem, 12vw, 9rem) clamp(1.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
  display: flex; flex-direction: column; gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 80% 50%, rgba(192,57,43,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-label {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--text);
  max-width: 14ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero-sub {
  font-size: clamp(.9rem, 1.5vw, 1rem);
  color: var(--text-muted);
  font-weight: 300;
  max-width: 42ch;
  line-height: 1.8;
}
.hero-line {
  width: 48px; height: 1px;
  background: var(--accent);
  margin-top: .5rem;
}

/* ─── Filters ────────────────────────────────────────────────────────────────── */
.filters {
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  display: flex; align-items: center; gap: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-label {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: .5rem;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: .35rem .9rem;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: .78rem;
  letter-spacing: .06em;
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--text-muted); color: var(--text); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.models-count {
  margin-left: auto;
  font-size: .78rem;
  color: var(--text-dim);
  letter-spacing: .06em;
}

/* ─── Grid ───────────────────────────────────────────────────────────────────── */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  padding: 1px;
}

/* ─── Card ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: background .2s;
}
.card:hover { background: var(--bg-hover); }
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.card-img-wrap {
  aspect-ratio: 5 / 7;
  overflow: hidden;
  position: relative;
}
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
  filter: grayscale(20%);
}
.card:hover .card-img-wrap img {
  transform: scale(1.04);
  filter: grayscale(0%);
}

.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 50%);
  pointer-events: none;
}

.card-badge {
  position: absolute; top: .75rem; left: .75rem;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 2px;
}

.card-body {
  padding: 1rem 1.1rem 1.2rem;
  border-top: 1px solid var(--border);
}
.card-name {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: .2rem;
}
.card-tagline {
  font-size: .78rem;
  color: var(--text-muted);
  letter-spacing: .04em;
  margin-bottom: .6rem;
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
}
.card-location {
  font-size: .72rem;
  color: var(--text-dim);
  letter-spacing: .06em;
  display: flex; align-items: center; gap: .3rem;
}
.card-location::before {
  content: '◎';
  color: var(--accent);
  font-size: .65rem;
}
.card-avail {
  font-size: .68rem;
  color: var(--gold);
  letter-spacing: .04em;
  text-align: right;
}

/* ─── Lightbox ───────────────────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 1.5rem;
}
.lightbox.open { display: flex; }
.lightbox-inner {
  position: relative;
  max-width: 520px; width: 100%;
  display: flex; flex-direction: column; gap: 1rem;
}
.lightbox-inner img {
  width: 100%;
  aspect-ratio: 5/7;
  object-fit: cover;
  border-radius: var(--radius);
}
.lightbox-close {
  position: absolute; top: -.5rem; right: -.5rem;
  width: 36px; height: 36px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 50%; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-close:hover { background: #a93226; }
.lightbox-info {
  display: flex; flex-direction: column; gap: .3rem;
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.lightbox-name {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text);
}
.lightbox-tagline { font-size: .85rem; color: var(--text-muted); }
.lightbox-location { font-size: .78rem; color: var(--text-dim); }
.lightbox-avail { font-size: .78rem; color: var(--gold); margin-top: .2rem; }
.lightbox-contact {
  margin-top: .6rem;
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent);
  color: #fff;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  align-self: flex-start;
  transition: background .2s;
}
.lightbox-contact:hover { background: #a93226; }

/* ─── Contatti ───────────────────────────────────────────────────────────────── */
.contatti {
  padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1rem;
  max-width: 560px;
}
.section-label {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.15;
}
.contatti p { font-size: .95rem; color: var(--text-muted); line-height: 1.8; }
.contatti a { color: var(--gold); border-bottom: 1px solid rgba(200,169,126,.3); }
.contatti a:hover { border-bottom-color: var(--gold); }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
footer {
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; flex-wrap: wrap;
  gap: .5rem 1.5rem;
  font-size: .75rem;
  color: var(--text-dim);
}
footer a { color: var(--text-dim); transition: color .2s; }
footer a:hover { color: var(--text-muted); }

/* ─── Reveal ─────────────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

/* Tablet: 3 colonne */
@media (max-width: 1024px) {
  .models-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet small / landscape phone */
@media (max-width: 768px) {
  .models-grid { grid-template-columns: repeat(2, 1fr); }

  .hero {
    padding-top: clamp(3rem, 10vw, 5rem);
    padding-bottom: clamp(2rem, 5vw, 3rem);
  }

  /* Filtri: scroll orizzontale su tablet */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 1rem;
  }
  .filters::-webkit-scrollbar { display: none; }

  /* Select: tap target minimo 44px */
  select {
    min-height: 44px;
    padding: .55rem 1rem;
    font-size: .85rem;
  }

  /* Lightbox fullscreen */
  .lightbox { padding: 0; align-items: flex-end; }
  .lightbox-inner {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 12px 12px 0 0;
    background: var(--bg);
    padding-bottom: env(safe-area-inset-bottom, 1rem);
  }
  .lightbox-inner img { aspect-ratio: 16/9; border-radius: 0; }
  .lightbox-close {
    top: .75rem; right: .75rem;
    width: 44px; height: 44px;
    font-size: 1.3rem;
  }
  .lightbox-info { border-radius: 0; border-left: none; border-right: none; }
  .lightbox-contact { align-self: stretch; justify-content: center; padding: .9rem; }
}

/* Mobile */
@media (max-width: 640px) {
  .nav-links { gap: 1rem; }
  .models-grid { grid-template-columns: repeat(2, 1fr); }

  /* Lang select: compatto, solo codice lingua */
  .lang-select { font-size: .68rem; padding: .3rem .4rem; padding-right: 1.2rem; }

  /* Filtri: stack verticale su mobile stretto */
  .filters {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    overflow-x: visible;
  }
  select, #filter-country, #filter-city, #filter-category {
    width: 100%;
    min-height: 48px;
    font-size: .9rem;
  }
  .models-count { margin-left: 0; text-align: right; }
}

/* Mobile stretto: 1 colonna */
@media (max-width: 380px) {
  .models-grid { grid-template-columns: 1fr; }
}

/* ─── Accessibility ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .card-badge, .filter-btn.active, .lightbox-contact { forced-color-adjust: none; }
}

/* ─── Selects (filters) ──────────────────────────────────────────────────── */
.filters {
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
  display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .4rem .8rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .8rem;
  cursor: pointer;
  transition: border-color .2s;
}
select:hover, select:focus { border-color: var(--text-muted); outline: none; }
select:disabled { opacity: .35; cursor: default; }

/* ─── Auth page ──────────────────────────────────────────────────────────── */
.auth-main {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.auth-tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 1rem;
  background: transparent; border: none;
  color: var(--text-muted); font-family: var(--font-body);
  font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; transition: color .2s, background .2s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: var(--text); border-bottom: 2px solid var(--accent); }
.auth-form { padding: 2rem; display: flex; flex-direction: column; gap: 1.1rem; }
.auth-form.hidden { display: none; }
.auth-title {
  font-family: var(--font-head); font-size: 1.6rem; font-weight: 400;
  margin-bottom: .25rem;
}
.auth-note { font-size: .75rem; color: var(--text-dim); }

/* ─── Fields ─────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label {
  font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
}
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: .6rem .85rem;
  font-family: var(--font-body); font-size: .9rem;
  transition: border-color .2s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 90px; }
.field-row { display: flex; gap: .75rem; }
.field-row .field { flex: 1; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: .75rem 1.5rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .85rem;
  letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; transition: background .2s; align-self: flex-start;
}
.btn-primary:hover { background: #a93226; }
.nav-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: .3rem .7rem;
  border-radius: var(--radius); font-family: var(--font-body);
  font-size: .78rem; cursor: pointer; transition: all .2s;
}
.nav-btn:hover { border-color: var(--accent); color: var(--text); }

/* ─── Form status ────────────────────────────────────────────────────────── */
.form-status { font-size: .82rem; min-height: 1.2em; }
.form-status.error { color: #e74c3c; }
.form-status.ok    { color: var(--gold); }

/* ─── Dashboard ──────────────────────────────────────────────────────────── */
.dash-main {
  max-width: 720px; margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 4rem);
  display: flex; flex-direction: column; gap: 2.5rem;
}
.dash-header { display: flex; flex-direction: column; gap: .4rem; }
.dash-title {
  font-family: var(--font-head); font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
}
.dash-form { display: flex; flex-direction: column; gap: 2rem; }
.dash-section { display: flex; flex-direction: column; gap: 1.1rem; }
.dash-section-title {
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 400;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}

/* ─── Category checkboxes ────────────────────────────────────────────────── */
.cat-checkboxes {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.cat-checkbox {
  display: flex; align-items: center; gap: .4rem;
  padding: .3rem .75rem;
  border: 1px solid var(--border); border-radius: 2px;
  font-size: .78rem; color: var(--text-muted);
  cursor: pointer; transition: all .15s; user-select: none;
}
.cat-checkbox:hover { border-color: var(--text-muted); color: var(--text); }
.cat-checkbox input { display: none; }
.cat-checkbox:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent); color: var(--text);
}

/* ─── Photo upload ───────────────────────────────────────────────────────── */
.dash-photos { gap: 1rem; }
.photos-preview {
  display: flex; flex-wrap: wrap; gap: .75rem;
}
.photo-thumb {
  width: 100px; height: 140px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.photo-upload-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100px; height: 140px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-size: .78rem;
  cursor: pointer; transition: all .2s;
}
.photo-upload-btn:hover { border-color: var(--accent); color: var(--text); }

/* ─── Lightbox tags ──────────────────────────────────────────────────────── */
.lb-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.lb-tag {
  font-size: .68rem; padding: .2rem .55rem;
  border: 1px solid var(--border); border-radius: 2px;
  color: var(--text-muted);
}

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1/-1; padding: 4rem 2rem;
  text-align: center; color: var(--text-dim); font-size: .9rem;
}
.city-prompt {
  text-align: center; padding: 2rem 1rem 3rem;
  color: var(--gold); font-size: .95rem; letter-spacing: .04em;
  opacity: .85;
}
.lang-select {
  margin-left: auto;
  background: var(--surface, #1a1a1a);
  color: var(--text-dim, #888);
  border: 1px solid rgba(200,169,126,.25);
  border-radius: 4px;
  font-size: .72rem;
  padding: .25rem .5rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c8a97e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .4rem center;
  padding-right: 1.4rem;
  transition: border-color .2s, color .2s;
}
.lang-select:hover, .lang-select:focus {
  border-color: var(--gold, #c8a97e);
  color: var(--gold, #c8a97e);
}
