/* Componenti condivisi: bottoni, input, form di login. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: 1px solid hsl(var(--customDarkGrey)); border-radius: 0;
  background: transparent; font-family: var(--font-overlock); font-size: 1rem; transition: background .2s, color .2s;
}
.btn-dark { background: hsl(var(--customDarkGrey)); color: #fff; }
.btn-dark:hover { background: hsl(var(--customLightGrey)); border-color: hsl(var(--customLightGrey)); }
.btn:disabled { opacity: .55; cursor: default; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], textarea, select {
  font-family: var(--font-overlock); font-size: 1rem; color: hsl(var(--customDarkGrey));
  background: hsl(var(--light-paper)); border: 1px solid hsl(var(--customDarkGrey)); border-radius: 0; padding: 9px 11px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid hsl(var(--customLightGrey)); outline-offset: 1px; }

/* Login */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 384px; border-radius: 6px; box-shadow: 0 10px 15px -3px rgb(0 0 0 / .12); padding-bottom: 8px; color: hsl(var(--customDarkGrey)); }
.auth-form { display: flex; flex-direction: column; gap: 14px; padding: 28px 32px 32px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: .875rem; }
.auth-form .btn { margin-top: 6px; }
.auth-link { text-align: center; font-size: .875rem; text-decoration: underline; color: hsl(var(--customDarkGrey)); }
.auth-link:hover { color: hsl(var(--customLightGrey)); }

/* ---------- Modali ---------- */
body.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; inset: 0; z-index: 500; background: rgb(30 28 26 / .45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade-in .15s ease-out; }
.modal-panel { position: relative; width: 100%; max-height: 90vh; max-height: 90dvh; overflow-y: auto; background: hsl(var(--light-paper)); color: hsl(var(--customDarkGrey)); border: 1px solid hsl(var(--customDarkGrey)); box-shadow: 0 20px 40px rgb(0 0 0 / .3); padding: 22px 24px; animation: pop-in .18s ease-out; }
.modal-title { font-family: var(--font-overlock); font-size: 1.25rem; letter-spacing: 1px; margin: 0 28px 14px 0; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: 0; background: transparent; padding: 0; color: hsl(var(--customDarkGrey)); }
.modal-x svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.modal-text { margin: 0 0 4px; font-size: 1rem; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn-danger { background: hsl(var(--destructive)); border-color: hsl(var(--destructive)); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm { padding: 5px 12px; font-size: .875rem; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Form generici ---------- */
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .875rem; }
.field > span { letter-spacing: .5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 140px; }

/* ---------- Popover / menu ---------- */
.popover { position: fixed; z-index: 600; background: hsl(var(--light-paper)); color: hsl(var(--customDarkGrey)); border: 1px solid hsl(var(--customDarkGrey)); box-shadow: 0 10px 24px rgb(0 0 0 / .22); min-width: 160px; max-width: 92vw; animation: pop-in .12s ease-out; }
.menu { display: flex; flex-direction: column; padding: 4px; max-height: 60vh; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 8px; text-align: left; background: transparent; border: 0; padding: 7px 10px; font-size: .95rem; color: inherit; white-space: nowrap; }
.menu-item:hover, .menu-item.active { background: hsl(var(--accent)); }
.menu-item.danger { color: hsl(var(--destructive)); }
.menu-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-sep { height: 1px; background: hsl(var(--border)); margin: 4px 0; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; padding: 0; box-shadow: 0 0 0 1px rgb(0 0 0 / .15); }
.swatch.on { border-color: hsl(var(--customDarkGrey)); }
