/* ═══════════════════════════════════════════════════════════════
   Podstract — Lab
   Sintesi su richiesta di un video specifico: form + storico delle
   proprie richieste, visibile solo a chi le ha inviate.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --paper:       #FDFCF9;
  --white:       #FFFFFF;
  --ink:         #111827;
  --body-text:   #374151;
  --night:       #0D1B2E;
  --mid:         #6B7280;
  --light:       #9CA3AF;
  --rule:        #E8E4DA;
  --blue:        #4B6BF5;
  --marker:      #F5C518;
  --marker-deep: #E0B400;
  --radius:      10px;
  --radius-pill: 100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

/* ─── HEADER ─── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253,252,249,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 32px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 800;
  color: var(--ink); letter-spacing: 0.04em; text-transform: uppercase;
}
.logo-mark {
  width: 24px; height: 24px;
  background: var(--marker);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform: rotate(180deg); flex-shrink: 0;
}
.nav { display: flex; gap: 28px; list-style: none; }
.nav a { font-size: 14px; font-weight: 500; color: var(--mid); transition: color 0.15s; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 700; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.btn-ghost {
  padding: 8px 18px; border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
  color: var(--ink); cursor: pointer; background: transparent;
  transition: border-color 0.15s;
}
.btn-ghost:hover { border-color: var(--mid); }
.btn-primary {
  padding: 9px 20px; background: var(--marker); color: var(--ink);
  border: none; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 800; cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--marker-deep); }

/* ─── TOOLBAR ─── */
.lab-toolbar-wrap {
  position: sticky; top: 64px; z-index: 90;
  background: rgba(253,252,249,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  padding: 14px 32px;
}
.lab-toolbar {
  max-width: 780px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
}
.lab-toolbar-field {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px;
  background: var(--white);
  border: 1.5px solid var(--rule); border-radius: var(--radius-pill);
  color: var(--light);
  transition: border-color 0.15s;
}
.lab-toolbar-field:focus-within { border-color: var(--blue); }
.lab-toolbar-field input {
  flex: 1; min-width: 0;
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  border: none; background: transparent;
}
.lab-toolbar-field input:disabled { opacity: 0.5; }
.lab-toolbar-field input::placeholder { color: var(--light); }
.lab-toolbar-icon-btn {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: transparent; color: var(--light); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lab-toolbar-icon-btn:hover { background: var(--paper); color: var(--mid); }
.lab-toolbar-icon-btn[aria-pressed="true"] { color: var(--blue); background: rgba(75,107,245,0.1); }
.lab-toolbar-submit {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border: none; border-radius: 50%;
  background: var(--marker); color: var(--ink); cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.lab-toolbar-submit:hover { background: var(--marker-deep); }
.lab-toolbar-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.lab-toolbar-note {
  display: block;
  max-width: 780px; margin: 10px auto 0;
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink);
  padding: 10px 14px;
  border: 1.5px solid var(--rule); border-radius: 10px;
  background: var(--white); resize: vertical;
}
.lab-toolbar-note[hidden] { display: none; }
.lab-toolbar-note:focus { outline: none; border-color: var(--blue); }
.lab-toolbar-note:disabled { opacity: 0.5; }
.lab-toolbar-hint {
  max-width: 780px; margin: 8px auto 0;
  font-size: 12.5px; color: var(--mid); line-height: 1.5;
}

/* ─── PAGE HEAD ─── */
.page-head {
  max-width: 780px; margin: 0 auto;
  padding: 40px 32px 32px;
}
.page-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--mid); margin-bottom: 14px;
}
.page-eyebrow::before {
  content: '';
  width: 18px; height: 4px;
  background: var(--marker); border-radius: 2px;
  transform: rotate(-1.5deg);
}
.page-head h1 {
  font-family: 'Fraunces', serif;
  font-size: 38px; font-weight: 750;
  letter-spacing: -1px; line-height: 1.15;
  margin-bottom: 12px;
}
.page-head .page-sub {
  font-size: 16px; color: var(--mid); line-height: 1.6;
}

/* ─── CONTAINER ─── */
.lab-container {
  max-width: 780px; margin: 0 auto;
  padding: 0 32px 80px;
}

/* ─── LISTA RICHIESTE ─── */
.lab-section-label {
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--mid); margin-bottom: 16px;
}
.lab-section-label--library { margin-top: 36px; }
.lab-empty { font-size: 14.5px; color: var(--mid); margin-bottom: 8px; }
.lab-list { display: flex; flex-direction: column; gap: 14px; }
.lab-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 20px;
}
.lab-card--library { border-left: 3px solid var(--marker); }
.lab-card-head {
  display: flex; align-items: center; gap: 12px;
}
a.lab-card-head { cursor: pointer; }
.lab-card-arrow {
  flex-shrink: 0; color: var(--light);
  transition: transform 0.15s, color 0.15s;
}
a.lab-card-head:hover .lab-card-arrow { transform: translateX(3px); color: var(--ink); }
.lab-card-main { flex: 1; min-width: 0; }
.lab-card-title {
  font-family: 'Fraunces', serif;
  font-size: 15.5px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lab-card-meta { font-size: 12px; color: var(--mid); margin-top: 2px; }
.lab-card-note {
  font-size: 13px; color: var(--mid); line-height: 1.5;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule);
}
.lab-cancel {
  flex-shrink: 0; width: 26px; height: 26px;
  border: none; background: transparent;
  color: var(--light); font-size: 20px; line-height: 1;
  cursor: pointer; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.lab-cancel:hover { color: #B4232A; background: #FBF1F0; }

.lab-badge {
  flex-shrink: 0;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: var(--radius-pill);
  white-space: nowrap;
}
.lab-badge--pending { background: #EEF0F4; color: var(--mid); }
.lab-badge--in_progress { background: rgba(75,107,245,0.12); color: var(--blue); }
.lab-badge--done { background: rgba(245,197,24,0.28); color: #8A6A00; }
.lab-badge--rejected { background: #FBF1F0; color: #B4232A; }

.lab-card-move {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.lab-card-move label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--mid);
}
.lab-card-move select {
  font-family: inherit; font-size: 13px; color: var(--ink);
  padding: 5px 10px; border: 1.5px solid var(--rule); border-radius: 8px;
  background: var(--paper); cursor: pointer;
}
.lab-card-move select:focus { outline: none; border-color: var(--blue); }

/* ─── COLLEZIONI ─── */
.lab-collections {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.lab-collection-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--rule); background: var(--white);
  font-size: 13px; font-weight: 600; color: var(--mid);
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.lab-collection-pill:hover { border-color: var(--mid); color: var(--ink); }
.lab-collection-pill.active {
  background: var(--ink); border-color: var(--ink); color: var(--white);
}
.lab-collection-delete {
  font-size: 15px; line-height: 1; color: inherit; opacity: 0.5;
  transition: opacity 0.15s;
}
.lab-collection-delete:hover { opacity: 1; }
.lab-collection-add {
  border-style: dashed; color: var(--blue); border-color: rgba(75,107,245,0.35);
}
.lab-collection-add:hover { border-color: var(--blue); color: var(--blue); background: rgba(75,107,245,0.06); }

/* ─── STATI VUOTI / GATE ─── */
.lab-gate {
  max-width: 480px; margin: 0 auto;
  text-align: center;
  padding: 72px 24px 96px;
}
.empty-mark {
  width: 52px; height: 8px;
  background: var(--marker); border-radius: 4px;
  transform: rotate(-2deg);
  margin: 0 auto 28px;
}
.lab-gate h2 {
  font-family: 'Fraunces', serif;
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.4px; margin-bottom: 12px;
}
.lab-gate p {
  font-size: 15.5px; color: var(--mid); line-height: 1.65;
  margin-bottom: 28px;
}
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-big {
  display: inline-block;
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 800;
  transition: background 0.15s, border-color 0.15s;
}
.btn-big--primary { background: var(--marker); color: var(--ink); }
.btn-big--primary:hover { background: var(--marker-deep); }
.btn-big--ghost { border: 1.5px solid var(--rule); color: var(--ink); }
.btn-big--ghost:hover { border-color: var(--mid); }

.loading {
  text-align: center; padding: 96px 24px;
  color: var(--mid); font-size: 14px;
}

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: white;
  padding: 10px 20px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── FOOTER ─── */
.footer {
  background: var(--ink); color: rgba(255,255,255,0.4);
  padding: 32px 24px; text-align: center;
  font-size: 13px; margin-top: 24px;
}
.footer a { color: #6B83F7; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .nav { display: none; }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .lab-toolbar-wrap { padding: 12px 16px; }
  .lab-toolbar-note, .lab-toolbar-hint { padding-left: 0; padding-right: 0; }
  .page-head { padding: 32px 20px 28px; }
  .page-head h1 { font-size: 28px; }
  .lab-container { padding: 0 20px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.001s !important;
    animation-duration: 0.001s !important;
  }
}
