/* =============================================================================
   Agendy — Tendine e calendario personalizzati (vedi js/ag-controlli.js)
   Usa le variabili colore della pagina, con valori di riserva.
   ============================================================================= */

.ag-sel{ position:relative; display:inline-flex; min-width:0; vertical-align:middle; }
label > .ag-sel, .ag-form .ag-sel{ display:flex; }
.ag-sel-native{ position:absolute !important; inset:0; width:1px !important; height:1px !important; opacity:0 !important; pointer-events:none !important; }

.ag-sel-btn{
  display:inline-flex; align-items:center; justify-content:space-between; gap:10px;
  width:100%; min-width:0; min-height:38px; padding:8px 10px 8px 12px;
  border-radius:10px; border:1px solid var(--border, rgba(255,255,255,0.12));
  background:var(--surface-2, rgba(255,255,255,0.045)); color:var(--white, #fff);
  font-family:inherit; font-size:13.5px; font-weight:500; line-height:1.3; text-align:left; cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
.ag-sel-btn:hover{ border-color:rgba(255,255,255,0.25); }
.ag-sel-btn[aria-expanded="true"]{ border-color:rgba(255,106,0,0.6); background:rgba(255,106,0,0.05); }
.ag-sel-btn:focus-visible{ outline:2px solid var(--white, #fff); outline-offset:2px; }
.ag-sel-btn:disabled{ opacity:0.4; cursor:not-allowed; }
.ag-sel-val{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ag-sel-val.vuoto{ color:var(--gray-dim, #8A8A8A); }
.ag-sel-chev{ width:15px; height:15px; flex-shrink:0; fill:none; stroke:var(--gray, #A0A0A0); stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; transition:transform .2s ease; }
.ag-sel-btn[aria-expanded="true"] .ag-sel-chev{ transform:rotate(180deg); }
.ag-date-btn[aria-expanded="true"] .ag-sel-chev{ transform:none; stroke:var(--accent-1, #FF6A00); }
/* versione compatta (tendine in riga, es. scadenzario del configuratore) */
.ag-sel.compact .ag-sel-btn{ min-height:32px; padding:5px 8px 5px 10px; font-size:12.5px; border-radius:8px; border-color:var(--border-soft, rgba(255,255,255,0.08)); }

/* ---- finestra (comune a tendina e calendario) ---- */
.ag-pop{
  position:fixed; z-index:1000;
  background:#141414; border:1px solid rgba(255,255,255,0.12); border-radius:14px;
  box-shadow:0 24px 60px -18px rgba(0,0,0,0.9), 0 0 0 1px rgba(0,0,0,0.4);
  padding:6px; color:#fff; font-family:'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  animation:ag-pop-in .14s ease-out;
}
@keyframes ag-pop-in{ from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce){ .ag-pop{ animation:none; } }

/* ---- tendina ---- */
.ag-sel-pop{ max-height:280px; overflow-y:auto; }
.ag-opt{
  display:flex; align-items:center; gap:10px; padding:9px 12px 9px 10px; border-radius:9px;
  font-size:13.5px; color:#d6d6d6; cursor:pointer; user-select:none;
}
.ag-opt.active{ background:rgba(255,255,255,0.07); color:#fff; }
.ag-opt[aria-selected="true"]{ color:#fff; font-weight:600; }
.ag-opt[aria-disabled="true"]{ opacity:0.35; cursor:not-allowed; }
.ag-opt-check{ width:6px; height:6px; border-radius:50%; flex-shrink:0; background:transparent; }
.ag-opt[aria-selected="true"] .ag-opt-check{ background:linear-gradient(90deg, #FF6A00, #E6216B); box-shadow:0 0 8px rgba(255,106,0,0.6); }
.ag-sel-pop::-webkit-scrollbar{ width:8px; }
.ag-sel-pop::-webkit-scrollbar-thumb{ background:rgba(255,255,255,0.12); border-radius:8px; }

/* ---- calendario ---- */
.ag-date-pop{ padding:12px; width:288px; }
.ag-date-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.ag-date-titolo{ font-size:14px; font-weight:700; text-transform:capitalize; }
.ag-date-nav{
  width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:8px; border:1px solid rgba(255,255,255,0.1); background:transparent; color:#A0A0A0; cursor:pointer;
}
.ag-date-nav:hover{ color:#fff; border-color:rgba(255,255,255,0.25); }
.ag-date-nav svg{ width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.ag-date-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:3px; text-align:center; }
.ag-date-dow{ font-size:10.5px; font-weight:700; color:#8A8A8A; padding:4px 0; }
.ag-date-day{
  height:34px; border-radius:8px; border:0; background:transparent; color:#cfcfcf;
  font-family:inherit; font-size:13px; font-variant-numeric:tabular-nums; cursor:pointer;
}
.ag-date-day:hover{ background:rgba(255,255,255,0.07); color:#fff; }
.ag-date-day.oggi{ color:#FF9A4D; font-weight:700; }
.ag-date-day.active{ box-shadow:inset 0 0 0 1.5px rgba(255,106,0,0.8); color:#fff; }
.ag-date-day.scelto{ background:linear-gradient(90deg, #FF6A00, #E6216B); color:#fff; font-weight:700; }
.ag-date-day:disabled{ opacity:0.25; cursor:not-allowed; background:transparent; }
.ag-date-foot{ display:flex; justify-content:flex-end; margin-top:8px; padding-top:8px; border-top:1px solid rgba(255,255,255,0.08); }
.ag-date-oggi{
  padding:6px 12px; border-radius:999px; border:1px solid rgba(255,255,255,0.12); background:transparent;
  color:#fff; font-family:inherit; font-size:12.5px; font-weight:600; cursor:pointer;
}
.ag-date-oggi:hover{ border-color:rgba(255,106,0,0.6); }
