/* ==========================================================================
   MAIN.CSS - Stili condivisi fra index.html, admin.html e report.html
   (reset, variabili, navbar, form, modali, bottoni comuni, ottimizzazioni mobile)
   Le pagine importano questo file PRIMA del proprio CSS dedicato, così da
   poter sovrascrivere solo le proprietà che differiscono (colori nav, larghezze, ecc.)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-main: #0b0b0f;
    --bg-card: #13131a;
    --bg-nav: rgba(255, 255, 255, 0.3);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-neon: #ff4747;
    --accent-hover: #ff5c5c;
    --accent-glow: rgba(255, 71, 71, 0.15);
    --text-white: #ffffff;
    --text-muted: #8f8f9d;
    --text-black: #1a1a1a;
    --input-bg: #1a1a24;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

html,
body {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--accent-neon);
    outline-offset: 2px;
}

/* ==========================================================================
   NAVBAR (struttura comune: ogni pagina personalizza sfondo/z-index/larghezza)
   ========================================================================== */

nav {
    background-color: var(--bg-nav);
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

.nav-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links button {
    font-family: var(--font-sans);
}

nav .logo img {
    width: 200px
}

nav .logo span {
    color: var(--text-muted);
    font-weight: 500;
}

/* Badge utilizzato sopra i titoli di sezione */
.section-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: rgba(255, 71, 71, 0.1);
    border: 1px solid rgba(255, 71, 71, 0.2);
    color: var(--accent-neon);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 100px;
    margin-bottom: 16px;
}

/* ==========================================================================
   CAMPI DI MODULO (label, input, textarea, select)
   ========================================================================== */
label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input,
textarea,
select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text-white);
    font-family: var(--font-sans);
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(255, 71, 71, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 71, 71, 0.12);
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-neon);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 20px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 71, 71, 0.15);
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.panel-header p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================================================
   BOTTONI COMUNI
   ========================================================================== */
.btn-submit {
    background-color: var(--accent-neon);
    color: var(--text-white);
    border: none;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-submit:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 71, 71, 0.4);
}

/* ==========================================================================
   MODALE (overlay comune: la visibilità resta gestita da ogni pagina via
   attributo "hidden" oppure style.display nel rispettivo JS)
   ========================================================================== */
.modal {
    position: fixed;
    z-index: 2000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-button {
    position: absolute;
    right: 20px;
    top: 16px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: var(--text-white);
}

/* ==========================================================================
   OTTIMIZZAZIONE MOBILE COMUNE
   ========================================================================== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

a,
button {
    touch-action: manipulation;
}

@media (max-width: 600px) {

    /* iOS ingrandisce la pagina al focus se il font dell'input è < 16px */
    input,
    textarea,
    select {
        font-size: 16px;
        padding: 13px 14px;
    }

    .nav-container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .modal {
        padding: 0;
    }

    .modal-content {
        height: 100dvh;
        max-height: none;
        max-width: none;
        border: none;
        border-radius: 0;
        padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    }

    .panel-header h2 {
        font-size: 20px;
    }

    .close-button {
        position: fixed;
        right: max(12px, env(safe-area-inset-right));
        top: calc(10px + env(safe-area-inset-top));
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(255, 255, 255, 0.08);
        border-radius: 50%;
        font-size: 26px;
        line-height: 1;
    }
}

.reviews-section {
  padding: 100px 20px;
  background: #0b0b0b;
  color: #fff;
}

.reviews-container {
  max-width: 1200px;
  margin: 0 auto;
}

.reviews-heading {
  text-align: center;
  margin-bottom: 45px;
}

.reviews-label {
  color: #e00000;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
}

.reviews-heading h2 {
  font-size: 42px;
  margin: 10px 0;
  font-weight: 800;
}

.reviews-heading p {
  color: #aaa;
  font-size: 17px;
}

.google-rating {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 45px;
}

.rating-number {
  font-size: 48px;
  font-weight: 800;
}

.stars {
  color: #f5b400;
  font-size: 24px;
  letter-spacing: 2px;
}

.rating-text {
  color: #aaa;
  font-size: 14px;
  margin-top: 3px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.review-card {
  background: #161616;
  border: 1px solid #292929;
  border-radius: 12px;
  padding: 28px;
  transition: transform 0.2s ease;
}

.review-card:hover {
  transform: translateY(-4px);
}

.review-stars {
  color: #f5b400;
  font-size: 18px;
  margin-bottom: 18px;
}

.review-text {
  color: #ddd;
  line-height: 1.6;
  font-size: 15px;
  margin-bottom: 20px;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e00000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.review-name {
  font-weight: 700;
}

.review-source {
  color: #888;
  font-size: 12px;
  margin-top: 3px;
}

.reviews-button {
  text-align: center;
  margin-top: 45px;
}

.reviews-button a {
  display: inline-block;
  background: #e00000;
  color: #fff;
  padding: 14px 25px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.2s ease;
}

.reviews-button a:hover {
  background: #b80000;
}

@media (max-width: 800px) {

  .reviews-heading h2 {
    font-size: 32px;
  }

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

  .reviews-section {
    padding: 70px 20px;
  }

}

.form-error {
    font-size: 13px;
    color: var(--accent-neon);
    background-color: rgba(255, 71, 71, 0.08);
    border: 1px solid rgba(255, 71, 71, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 12px;
}

/* ==========================================================================
   SELETTORE FOTO (admin: nuovo report, report: modifica)
   ========================================================================== */
input[type="file"] {
    padding: 9px 12px;
    cursor: pointer;
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.photo-preview:empty {
    display: none;
}

.photo-thumb {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
}

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

.photo-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.photo-thumb-remove:hover {
    background: var(--accent-neon);
}

.container.privacy-wrapper {
    margin: 100px auto;
}

.privacy-container {
    line-height: 1.6;
    margin-top: 50px;
    letter-spacing: 0.7px;
}

.privacy-container a {
    color: var(--primary-color);
    text-decoration: none;
}

.privacy-container a:hover {
    text-decoration: underline;
}

.privacy-container li {
    margin-left: 30px;
}