/* =====================================================================
   Valorafy — booking page (calendario.html)
   Loaded on top of styles.css, which owns the tokens, header, footer and
   buttons. Everything here is booking-specific.
   ===================================================================== */

.cal-main{padding:calc(var(--header-h) + clamp(1.75rem,4vw,2.75rem)) 0 clamp(3rem,6vw,4.5rem)}

/* ------------------------------- Intro ------------------------------- */
.cal-intro{text-align:center;max-width:60ch;margin-inline:auto}
.cal-intro h1{font-size:clamp(2rem,4.4vw,3rem);font-weight:800;line-height:1.1;letter-spacing:-.025em}
.cal-intro .lede{margin-top:1rem;margin-inline:auto;max-width:52ch}

/* Three steps. A row of statements, not cards — they explain the page, they
   are not things to click. */
.cal-steps{
  display:flex;justify-content:center;flex-wrap:wrap;
  gap:clamp(1.25rem,4vw,3rem);
  margin-top:clamp(1.75rem,3.5vw,2.5rem);
}
.cal-steps li{display:flex;align-items:flex-start;gap:.75rem;max-width:26ch}
.cal-step-ico{
  display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:11px;
  background:rgba(0,153,51,.14);color:var(--color-green-primary);font-size:18px;
}
.cal-step-text{display:flex;flex-direction:column;gap:.15rem;font-weight:400;font-size:.875rem;line-height:1.45;color:var(--color-text-secondary)}
.cal-step-text b{font-weight:600;font-size:.9375rem;color:#fff}

/* ------------------------------- Shell ------------------------------- */
.cal-shell{
  display:grid;grid-template-columns:minmax(0,1fr) 320px;
  gap:clamp(1rem,2vw,1.5rem);align-items:start;
  margin-top:clamp(1.75rem,3.5vw,2.5rem);
}

.cal-panel{
  border:1px solid var(--color-divider);border-radius:var(--radius-card);
  background:rgba(255,255,255,.025);overflow:hidden;
}

.cal-head{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  padding:1.1rem 1.25rem;border-bottom:1px solid var(--color-divider);
}
.cal-head-title{display:flex;align-items:center;gap:.7rem}
.cal-head-title > span{display:flex;flex-direction:column}
.cal-head-title b{font-size:1rem;font-weight:600;color:#fff}
.cal-head-ico{
  display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:10px;
  background:rgba(0,153,51,.14);color:var(--color-green-primary);font-size:17px;
}
.cal-head-sub{font-size:.8125rem;font-weight:400;color:var(--color-text-secondary)}

.cal-nav{display:flex;align-items:center;gap:.5rem;margin-left:auto}
.cal-week-label{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary);margin-right:.25rem}
.cal-arrow{
  display:grid;place-items:center;width:32px;height:32px;border-radius:9px;
  border:1px solid var(--color-divider);background:rgba(255,255,255,.03);
  color:var(--color-text-secondary);font-size:15px;
  transition:color .18s ease,border-color .18s ease,background-color .18s ease;
}
.cal-arrow:hover:not(:disabled){color:#fff;border-color:rgba(255,255,255,.22);background:rgba(255,255,255,.06)}
.cal-arrow:disabled{opacity:.35;cursor:not-allowed}

/* Day picker — mobile only (see the breakpoint at the bottom). */
.cal-daypicker{display:none;gap:.4rem;padding:.75rem 1rem;overflow-x:auto;border-bottom:1px solid var(--color-divider)}
.cal-day-chip{
  flex:none;display:flex;flex-direction:column;align-items:center;gap:.1rem;
  padding:.5rem .7rem;border-radius:12px;min-width:56px;
  border:1px solid var(--color-divider);background:rgba(255,255,255,.03);
  font-size:.8125rem;font-weight:600;color:var(--color-text-secondary);
  transition:border-color .18s ease,background-color .18s ease,color .18s ease;
}
.cal-day-chip small{font-size:.6875rem;font-weight:500;opacity:.8}
.cal-day-chip[aria-selected="true"]{
  border-color:var(--color-green-glow);background:rgba(0,153,51,.12);color:#fff;
}
.cal-day-chip:disabled{opacity:.35;cursor:not-allowed}

/* ------------------------------- Grid -------------------------------
   The hour range is taller than any sensible card, so the columns scroll
   inside their own window with the day names pinned above them. */
.cal-grid-wrap{max-height:min(52vh,420px);overflow-y:auto;overscroll-behavior:contain}
.cal-grid{
  display:grid;grid-template-columns:56px repeat(7,minmax(0,1fr));
  gap:0 .4rem;padding:0 1rem 1rem;
}
.cal-col-head{
  position:sticky;top:0;z-index:2;
  padding:.85rem 0 .6rem;text-align:center;
  background:var(--color-navy-panel);
  font-size:.8125rem;font-weight:600;color:var(--color-text-secondary);
}
.cal-col-head.is-today{color:var(--color-green-bright)}
.cal-col-head small{display:block;font-size:.6875rem;font-weight:500;opacity:.75}
/* The gutter head is empty but still has to mask the scrolling slots. */
.cal-gutter-head{position:sticky;top:0;z-index:2;background:var(--color-navy-panel)}

.cal-time{
  display:flex;align-items:center;justify-content:flex-end;
  padding-right:.6rem;height:30px;
  font-size:.75rem;font-weight:500;color:var(--color-text-muted);
}
.cal-slot{
  height:30px;margin-bottom:4px;border-radius:8px;
  border:1px solid var(--color-divider);background:rgba(255,255,255,.03);
  font-size:.8125rem;font-weight:500;color:var(--color-text-secondary);
  transition:border-color .15s ease,background-color .15s ease,color .15s ease;
}
.cal-slot:hover:not(:disabled){
  border-color:var(--color-green-glow);background:rgba(0,153,51,.14);color:#fff;
}
.cal-slot:disabled{opacity:.28;cursor:not-allowed}
/* Same selected-state device as .pill/.tile/.badge elsewhere on the site: a
   tinted background and a green outline, never a solid fill — a full-strength
   green button here read as a different, brighter green than the rest of
   the palette. */
.cal-slot[aria-pressed="true"]{
  background:rgba(0,153,51,.16);border-color:var(--color-green-primary);
  color:#fff;font-weight:600;
  box-shadow:0 0 0 1px var(--color-green-primary);
}

.cal-weekend-note{
  display:flex;align-items:center;gap:.55rem;
  padding:.85rem 1.25rem;border-top:1px solid var(--color-divider);
  font-size:.8125rem;font-weight:400;color:var(--color-text-secondary);
}
.cal-weekend-note .ico{width:16px;height:16px;flex:none;color:var(--color-green-primary);stroke-width:2.6}
.cal-weekend-note b{color:#fff;font-weight:600}

/* ------------------------------- Side ------------------------------- */
.cal-side{
  border:1px solid var(--color-divider);border-radius:var(--radius-card);
  background:rgba(255,255,255,.025);padding:1.35rem 1.25rem;
  position:sticky;top:calc(var(--header-h) + 1rem);
}
.cal-side-empty{text-align:center;padding:1.5rem .5rem}
.cal-side-ico{
  display:grid;place-items:center;width:44px;height:44px;border-radius:50%;margin:0 auto 1rem;
  background:rgba(255,255,255,.06);color:var(--color-text-secondary);font-size:21px;
}
.cal-side-empty-title{font-size:1rem;font-weight:600;color:#fff}
.cal-side-empty-sub{margin-top:.4rem;font-size:.875rem;font-weight:400;line-height:1.5;color:var(--color-text-secondary)}

.cal-picked{padding-bottom:1.1rem;margin-bottom:1.1rem;border-bottom:1px solid var(--color-divider)}
.cal-picked-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.cal-picked-label{font-size:.75rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--color-text-secondary)}
.cal-clear{
  display:grid;place-items:center;width:26px;height:26px;border-radius:7px;
  color:var(--color-text-secondary);font-size:14px;
  transition:color .18s ease,background-color .18s ease;
}
.cal-clear:hover{color:#fff;background:rgba(255,255,255,.08)}
.cal-picked-date{margin-top:.5rem;font-size:1.125rem;font-weight:700;letter-spacing:-.01em;color:#fff}
.cal-picked-time{
  display:flex;align-items:center;gap:.45rem;margin-top:.35rem;
  font-size:.9375rem;font-weight:500;color:var(--color-green-bright);
}
.cal-picked-time .ico{width:16px;height:16px;flex:none}

.cal-field + .cal-field{margin-top:.85rem}
.cal-field .field-label{display:block;font-size:.8125rem;font-weight:600;color:#fff;margin-bottom:.4rem}
.cal-input{
  width:100%;height:44px;padding:0 .85rem;
  border-radius:var(--radius-field);border:1px solid var(--color-divider);
  background:rgba(255,255,255,.04);
  font-family:var(--font);font-size:.9375rem;font-weight:500;color:#fff;
  transition:border-color .18s ease,background-color .18s ease;
}
.cal-input::placeholder{color:var(--color-text-muted);font-weight:400}
.cal-input:focus{outline:none;border-color:var(--color-green-primary);background:rgba(255,255,255,.06)}
.cal-input.has-error{border-color:#FF8B84}
.cal-error{margin-top:.35rem;font-size:.75rem;font-weight:500;color:#FF8B84}

.cal-form .btn{margin-top:1.25rem}
.cal-fineprint{margin-top:.75rem;font-size:.75rem;font-weight:400;line-height:1.45;color:var(--color-text-muted)}

.cal-done{text-align:center;padding:1rem .5rem}
.cal-done-mark{
  display:grid;place-items:center;width:52px;height:52px;border-radius:50%;margin:0 auto 1rem;
  background:rgba(0,153,51,.16);color:var(--color-green-primary);font-size:26px;
  box-shadow:0 0 0 1px var(--color-green-glow),0 0 28px rgba(0,153,51,.22);
}
.cal-done-title{font-size:1.0625rem;font-weight:700;color:#fff}
.cal-done-sub{margin-top:.5rem;font-size:.875rem;font-weight:400;line-height:1.55;color:var(--color-text-secondary)}

/* ------------------------------- Trust ------------------------------- */
.cal-trust{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:clamp(1rem,2.5vw,2rem);
  margin-top:clamp(2rem,4vw,2.75rem);
}
.cal-trust li{display:flex;align-items:flex-start;gap:.75rem}
.cal-trust-ico{
  display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:10px;
  background:rgba(0,153,51,.14);color:var(--color-green-primary);font-size:17px;
}
.cal-trust span:last-child{display:flex;flex-direction:column;font-weight:400;font-size:.8125rem;line-height:1.45;color:var(--color-text-secondary)}
.cal-trust b{font-weight:600;font-size:.9375rem;color:#fff;margin-bottom:.1rem}

/* ---------------------------- Breakpoints ---------------------------- */
@media (max-width:1000px){
  /* The side panel stops fitting beside the grid; it drops underneath and
     un-sticks, since a sticky element in normal flow just jitters. */
  .cal-shell{grid-template-columns:minmax(0,1fr)}
  .cal-side{position:static}
}

@media (max-width:768px){
  .cal-intro{text-align:left}
  .cal-intro .lede{margin-inline:0}
  .cal-steps{justify-content:flex-start;gap:1rem}
  .cal-steps li{max-width:none;flex:1 1 100%}

  /* Seven columns cannot fit a phone. One day at a time, chosen from the
     chip row, with the time gutter kept for context. */
  .cal-daypicker{display:flex}
  .cal-grid{grid-template-columns:56px minmax(0,1fr);padding-inline:.85rem}
  .cal-grid > [data-day]:not([data-day="0"]){display:none}
  .cal-grid[data-active="1"] > [data-day="0"]{display:none}
  .cal-grid[data-active="1"] > [data-day="1"]{display:block}
  .cal-grid[data-active="2"] > [data-day="0"]{display:none}
  .cal-grid[data-active="2"] > [data-day="2"]{display:block}
  .cal-grid[data-active="3"] > [data-day="0"]{display:none}
  .cal-grid[data-active="3"] > [data-day="3"]{display:block}
  .cal-grid[data-active="4"] > [data-day="0"]{display:none}
  .cal-grid[data-active="4"] > [data-day="4"]{display:block}
  .cal-grid[data-active="5"] > [data-day="0"]{display:none}
  .cal-grid[data-active="5"] > [data-day="5"]{display:block}
  .cal-grid[data-active="6"] > [data-day="0"]{display:none}
  .cal-grid[data-active="6"] > [data-day="6"]{display:block}

  .cal-grid-wrap{max-height:min(56vh,400px)}
  .cal-head{padding:1rem}
  .cal-nav{width:100%;justify-content:space-between;margin-left:0}
  .cal-slot{height:40px}
  .cal-time{height:40px}
}

@media (prefers-reduced-motion:reduce){
  .cal-slot,.cal-arrow,.cal-day-chip,.cal-input,.cal-clear{transition:none}
}

/* Fallback link in the done panel — only rendered when the booking went out
   as an email, so the visitor has a second chance if no mail client opened. */
.cal-done-link{
  display:inline-block;margin-top:.85rem;
  font-size:.875rem;font-weight:600;color:var(--color-green-primary);
  text-decoration:underline;text-decoration-color:rgba(0,153,51,.4);text-underline-offset:.15em;
  transition:color .18s ease;
}
.cal-done-link:hover{color:var(--color-green-hover)}
