/* =========================================================
   SITO PERSONALE — stile minimalista industrial
   Cemento, acciaio, giallo di sicurezza. Poco colore, molta struttura.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500&display=swap');

:root {
  --bg: #121316;
  --panel: #1B1D21;
  --panel-2: #202226;
  --ink: #ECEAE4;
  --muted: #8B9096;
  --line: #303338;
  --yellow: #F2C230;
  --steel: #6E7680;

  --font-display: 'Oswald', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 26px; }

h1, h2, h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .02em;
  font-weight: 600;
  margin: 0 0 .4em;
}

p { color: var(--muted); margin: 0 0 1em; }

/* striscia gialla/nera - elemento di segnale industriale */
.hazard {
  height: 8px; width: 100%;
  background: repeating-linear-gradient(135deg, var(--yellow), var(--yellow) 14px, #16171A 14px, #16171A 28px);
}

/* ---------- header ---------- */
header.site {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.nav { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: var(--font-mono); font-size: .95rem; letter-spacing: .06em;
  text-decoration: none; color: var(--ink); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.logo .bracket { color: var(--yellow); }
.nav a.logout {
  font-family: var(--font-mono); font-size: .8rem; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); padding: 8px 14px; border-radius: 2px;
}
.nav a.logout:hover { color: var(--ink); border-color: var(--steel); }

/* ---------- home / ricerca ---------- */
.home-hero { padding: 90px 0 60px; text-align: center; }
.home-hero .tag {
  font-family: var(--font-mono); font-size: .8rem; color: var(--yellow);
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px; display: inline-block;
}
.home-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 6px; }
.home-hero p.sub { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }

.search-box {
  max-width: 640px; margin: 40px auto 0; display: flex; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: 4px 4px 4px 20px;
}
.search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--font-mono); font-size: 1rem; color: var(--ink); padding: 14px 10px;
}
.search-box input::placeholder { color: var(--steel); }
.search-box button {
  background: var(--yellow); border: none; color: #16171A; font-family: var(--font-mono);
  font-weight: 600; padding: 12px 20px; border-radius: 2px; cursor: pointer; text-transform: uppercase; font-size: .8rem;
}
.search-box button:hover { background: #ffd35c; }

.tiles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 900px; margin: 56px auto 0;
}
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: 30px 26px; text-decoration: none; color: var(--ink); text-align: left;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
  display: block; position: relative; overflow: hidden;
}
.tile:hover { border-color: var(--yellow); transform: translateY(-3px); background: var(--panel-2); }
.tile .idx { font-family: var(--font-mono); font-size: .75rem; color: var(--yellow); display: block; margin-bottom: 14px; }
.tile h3 { margin-bottom: 6px; font-size: 1.15rem; }
.tile p { font-size: .85rem; margin: 0; }
.tile .lock { position: absolute; top: 20px; right: 20px; font-size: .7rem; color: var(--muted); font-family: var(--font-mono); }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: 44px 40px; width: 100%; max-width: 380px;
}
.login-card h1 { font-size: 1.3rem; margin-bottom: 4px; }
.login-card p.sub { font-family: var(--font-mono); font-size: .78rem; margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 8px;
}
.field input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 12px 14px; border-radius: 2px; font-family: var(--font-body); font-size: .95rem;
}
.field input:focus { outline: none; border-color: var(--yellow); }
button.submit {
  width: 100%; background: var(--yellow); color: #16171A; border: none; padding: 13px;
  font-family: var(--font-mono); font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  border-radius: 2px; cursor: pointer; font-size: .85rem;
}
button.submit:hover { background: #ffd35c; }
.error-box {
  background: #3A2020; border: 1px solid #7A3B3B; color: #F2A6A6; padding: 10px 14px;
  border-radius: 3px; font-size: .85rem; margin-bottom: 18px;
}

/* ---------- explorer ---------- */
.explorer-header { padding: 30px 0 10px; }
.explorer-header .back {
  font-family: var(--font-mono); font-size: .78rem; color: var(--muted); text-decoration: none;
}
.explorer-header .back:hover { color: var(--yellow); }
.breadcrumb { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); margin: 14px 0 22px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--yellow); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.toolbar form { display: flex; gap: 8px; align-items: center; }
.toolbar input[type=text] {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 12px; border-radius: 2px; font-family: var(--font-mono); font-size: .85rem;
}
.btn-ind {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 16px; border-radius: 2px; font-family: var(--font-mono); font-size: .8rem;
  text-transform: uppercase; cursor: pointer; letter-spacing: .04em;
}
.btn-ind:hover { border-color: var(--yellow); color: var(--yellow); }
.btn-ind.primary { background: var(--yellow); color: #16171A; border-color: var(--yellow); }
.btn-ind.primary:hover { background: #ffd35c; }

table.files { width: 100%; border-collapse: collapse; margin-bottom: 40px; }
table.files th {
  text-align: left; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 10px 12px;
}
table.files td {
  padding: 12px; border-bottom: 1px solid var(--line); font-size: .9rem;
}
table.files tr:hover td { background: var(--panel); }
.file-name { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.file-name:hover { color: var(--yellow); }
.file-actions a { font-family: var(--font-mono); font-size: .75rem; margin-right: 14px; text-decoration: none; color: var(--muted); }
.file-actions a:hover { color: var(--yellow); }
.file-actions a.danger:hover { color: #E96A6A; }
.empty-row { text-align: center; color: var(--muted); padding: 40px; font-family: var(--font-mono); font-size: .85rem; }
.msg { padding: 12px 16px; border-radius: 3px; font-family: var(--font-mono); font-size: .82rem; margin-bottom: 20px; }
.msg.ok { background: #1E2E22; color: #8FD79E; border: 1px solid #345C3D; }
.msg.error { background: #3A2020; color: #F2A6A6; border: 1px solid #7A3B3B; }

.preview-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 20px; margin-bottom: 30px;
}
.preview-box img { max-height: 480px; margin: 0 auto; }
.preview-box pre { white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: .82rem; max-height: 480px; overflow: auto; }
.preview-box iframe { width: 100%; height: 500px; border: none; }

/* ---------- search results ---------- */
.result-row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.result-row .area-tag {
  font-family: var(--font-mono); font-size: .68rem; color: var(--yellow); text-transform: uppercase;
  border: 1px solid var(--line); padding: 2px 8px; border-radius: 2px; margin-right: 10px;
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 30px 0; margin-top: 60px; }
footer .wrap { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
