/* =========================================================================
   Forms, booking widgets and feedback — shared by the site and the admin.
   ========================================================================= */

.field { display: flex; flex-direction: column; gap: var(--s-2); }

/* Sentence case, bold, black — "Scegli le tue date *" on the live site. */
.field__label {
  font-size: var(--t-sm);
  font-weight: 700;
  color: #000;
}
.section--dark .field__label,
.on-dark .field__label { color: var(--text-on-dark-muted); }

.field__label .req { color: var(--danger); margin-left: 0.15rem; }

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.8125rem 1rem;
  font-size: var(--t-base);
  font-family: inherit;
  color: var(--text-on-light);
  background: #fff;
  border: 1px solid var(--bone-300);
  border-radius: var(--r-field);
  transition: border-color var(--d-fast) var(--ease-out),
              box-shadow var(--d-fast) var(--ease-out),
              background-color var(--d-fast) var(--ease-out);
  min-height: 3rem;
  appearance: none;
}

.input::placeholder,
.textarea::placeholder { color: var(--text-on-light-faint); }

.input:hover,
.select:hover,
.textarea:hover { border-color: var(--gold-600); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(194, 160, 54, 0.22);
}

.textarea { min-height: 8rem; resize: vertical; line-height: var(--lh-base); }

.select {
  /* A gold chevron drawn inline — no image request, and it inherits crisply
     at any pixel density. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238E724C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
  cursor: pointer;
}

/* Dark-surface variants. */
.on-dark .input,
.on-dark .select,
.on-dark .textarea {
  background: rgba(244, 241, 234, 0.06);
  border-color: rgba(244, 241, 234, 0.2);
  color: var(--text-on-dark);
}
.on-dark .input::placeholder,
.on-dark .textarea::placeholder { color: var(--text-on-dark-faint); }
.on-dark .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C2A036' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
}

/* The browser's own date picker indicator is invisible on a dark field. */
.on-dark input[type='date']::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.6); }

.field--error .input,
.field--error .select,
.field--error .textarea { border-color: var(--danger); }
.field--error .input:focus { box-shadow: 0 0 0 3px rgba(192, 72, 63, 0.2); }

.field__error {
  font-size: var(--t-xs);
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.field__error svg { width: 0.875rem; height: 0.875rem; flex: none; }

.field__hint { font-size: var(--t-xs); color: var(--text-on-light-faint); }
.on-dark .field__hint { color: var(--text-on-dark-faint); }

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--s-4);
}

/* --- Checkbox & radio --------------------------------------------------- */

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  cursor: pointer;
  font-size: var(--t-sm);
  line-height: var(--lh-snug);
}

.check input[type='checkbox'],
.check input[type='radio'] {
  appearance: none;
  width: 1.25rem; height: 1.25rem;
  flex: none;
  margin-top: 0.125rem;
  border: 1px solid var(--bone-400);
  border-radius: var(--r-sm);
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background-color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}
.check input[type='radio'] { border-radius: var(--r-full); }

.check input:checked { background: var(--gold-500); border-color: var(--gold-500); }
.check input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  left: 0.4rem; top: 0.15rem;
  width: 0.3rem; height: 0.6rem;
  border: solid var(--ink-900);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check input[type='radio']:checked::after {
  content: '';
  position: absolute;
  inset: 0.3rem;
  border-radius: var(--r-full);
  background: var(--ink-900);
}
.check input:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

.on-dark .check input { background: rgba(244, 241, 234, 0.08); border-color: rgba(244, 241, 234, 0.28); }

/* --- Switch ------------------------------------------------------------- */

.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; }
.switch input { appearance: none; position: absolute; opacity: 0; }
.switch__track {
  width: 2.75rem; height: 1.5rem;
  background: var(--bone-400);
  border-radius: var(--r-full);
  position: relative;
  transition: background-color var(--d-base) var(--ease-out);
  flex: none;
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 0.1875rem; left: 0.1875rem;
  width: 1.125rem; height: 1.125rem;
  background: #fff;
  border-radius: var(--r-full);
  box-shadow: var(--sh-sm);
  transition: transform var(--d-base) var(--ease-spring);
}
.switch input:checked + .switch__track { background: var(--gold-500); }
.switch input:checked + .switch__track::after { transform: translateX(1.25rem); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.switch__label { font-size: var(--t-sm); }

/* --- Selectable card (payment method, suite choice) --------------------- */

.choice {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--bone-400);
  border-radius: var(--r-md);
  cursor: pointer;
  background: #fff;
  transition: border-color var(--d-fast) var(--ease-out),
              background-color var(--d-fast) var(--ease-out),
              box-shadow var(--d-fast) var(--ease-out);
}
.choice:hover { border-color: var(--gold-500); }
.choice:has(input:checked) {
  border-color: var(--gold-500);
  background: rgba(194, 160, 54, 0.07);
  box-shadow: 0 0 0 1px var(--gold-500);
}
.choice input { appearance: none; position: absolute; opacity: 0; }
.choice__icon { width: 1.5rem; height: 1.5rem; color: var(--gold-700); flex: none; }
.choice__body { flex: 1; min-width: 0; }
.choice__title { display: block; font-size: var(--t-sm); font-weight: 600; }
.choice__desc { display: block; margin-top: 0.15rem; font-size: var(--t-xs); line-height: 1.5; color: var(--text-on-light-muted); }
.choice__check { width: 1.25rem; height: 1.25rem; flex: none; color: var(--gold-600); opacity: 0; transition: opacity var(--d-fast); }
.choice:has(input:checked) .choice__check { opacity: 1; }

/* ------------------------------------------------------------------------ */
/* Booking search bar                                                        */
/* ------------------------------------------------------------------------ */

.booking-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: var(--s-3);
  align-items: end;
  padding: var(--s-5);
  background: var(--bone-200);
  border: 1px solid var(--bone-300);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
}
.booking-bar--dark {
  background: rgba(244, 241, 234, 0.05);
  border-color: rgba(194, 160, 54, 0.22);
  backdrop-filter: blur(10px);
}
.booking-bar--gold {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-400));
  border-color: transparent;
}

@media (max-width: 899px) {
  .booking-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-bar__submit { grid-column: 1 / -1; }
}
@media (max-width: 479px) {
  .booking-bar { grid-template-columns: 1fr; }
}

.booking-card {
  padding: var(--s-6);
  background: #fff;
  border: 1px solid var(--bone-300);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}

/* Sticky summary: follows the guest down a long configuration page, but only
   where there is room for it beside the content. */
.booking-sticky { position: sticky; top: calc(var(--header-h-scrolled) + var(--s-4)); }
@media (max-width: 899px) { .booking-sticky { position: static; } }

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--s-8);
  align-items: start;
}
@media (max-width: 899px) { .booking-layout { grid-template-columns: minmax(0, 1fr); } }

/* --- Price summary ------------------------------------------------------ */

.summary { display: flex; flex-direction: column; gap: var(--s-3); }
.summary__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); font-size: var(--t-sm); }
.summary__row dt { color: var(--text-on-light-muted); }
.summary__row dd { margin: 0; font-variant-numeric: tabular-nums; }
.summary__row--discount dd { color: var(--success); }
/* Price-rule lines under the room total ("di cui weekend +20 €"). */
.summary__row--sub { font-size: var(--t-xs); color: var(--text-on-light-muted); margin-top: -0.25rem; }
.summary__row--sub dt { padding-left: var(--s-3); }
.summary__divider { height: 1px; background: var(--bone-300); margin-block: var(--s-2); }
.summary__total { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); }
.summary__total dt { font-size: var(--t-sm); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; }
.summary__total dd { margin: 0; font-size: var(--t-xl); font-weight: 700; color: #000; font-variant-numeric: tabular-nums; }
.summary__note { font-size: var(--t-xs); color: var(--text-on-light-faint); line-height: var(--lh-snug); }

/* ------------------------------------------------------------------------ */
/* Availability calendar                                                     */
/* ------------------------------------------------------------------------ */

.cal { user-select: none; }
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }
.cal__month { font-size: var(--t-md); font-weight: 400; text-transform: capitalize; }
.cal__nav { display: flex; gap: var(--s-2); }
.cal__nav-btn {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border: 1px solid var(--bone-400);
  border-radius: var(--r-md);
  transition: border-color var(--d-fast), background-color var(--d-fast);
}
.cal__nav-btn:hover:not(:disabled) { border-color: var(--gold-500); background: rgba(194, 160, 54, 0.08); }
.cal__nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.cal__nav-btn svg { width: 1rem; height: 1rem; }

.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }

.cal__dow {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-light-faint);
  padding-bottom: var(--s-2);
}

.cal__day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  position: relative;
  transition: background-color var(--d-fast) var(--ease-out),
              color var(--d-fast) var(--ease-out),
              border-color var(--d-fast) var(--ease-out);
  min-height: 2.5rem;
  min-width: 0;
}
/* On a narrow phone seven squares of 40px do not fit: keep the height (what a
   thumb needs) and let the width shrink. */
@media (max-width: 479px) { .cal__day { aspect-ratio: auto; min-height: 2.75rem; } }

.cal__day-price { font-size: 0.6875rem; color: var(--text-on-light-faint); line-height: 1; }

.cal__day--out { visibility: hidden; }
.cal__day--free:hover { background: rgba(194, 160, 54, 0.16); border-color: var(--gold-500); }

.cal__day--busy {
  color: var(--text-on-light-faint);
  cursor: not-allowed;
  background: repeating-linear-gradient(
    -45deg,
    transparent, transparent 3px,
    rgba(26, 23, 16, 0.07) 3px, rgba(26, 23, 16, 0.07) 6px
  );
}
.cal__day--busy .cal__day-price { display: none; }

.cal__day--past { color: var(--text-on-light-faint); opacity: 0.4; cursor: not-allowed; }

.cal__day--start,
.cal__day--end { background: var(--gold-500); color: var(--ink-900); font-weight: 600; }
.cal__day--start .cal__day-price,
.cal__day--end .cal__day-price { color: rgba(16, 15, 12, 0.9); }
.cal__day--between { background: rgba(194, 160, 54, 0.22); }

.cal__legend { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-4); font-size: var(--t-xs); color: var(--text-on-light-muted); }
.cal__legend-item { display: flex; align-items: center; gap: var(--s-2); }
.cal__legend-swatch { width: 0.875rem; height: 0.875rem; border-radius: var(--r-xs); border: 1px solid var(--bone-400); }
.cal__legend-swatch--free { background: #fff; }
.cal__legend-swatch--busy { background: repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(26,23,16,0.15) 2px, rgba(26,23,16,0.15) 4px); }
.cal__legend-swatch--sel { background: var(--gold-500); border-color: var(--gold-500); }

/* ------------------------------------------------------------------------ */
/* Feedback                                                                  */
/* ------------------------------------------------------------------------ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border-left: 3px solid currentColor;
  font-size: var(--t-sm);
  line-height: var(--lh-snug);
}
.alert svg { width: 1.25rem; height: 1.25rem; flex: none; margin-top: 0.05rem; }
.alert__body { flex: 1; min-width: 0; }
.alert__title { font-weight: 600; margin-bottom: 0.15rem; }
.alert__close { flex: none; opacity: 0.6; transition: opacity var(--d-fast); }
.alert__close:hover { opacity: 1; }

.alert--success { background: var(--success-bg); color: var(--success-ink); }
.alert--error   { background: var(--danger-bg);  color: var(--danger-ink); }
.alert--warning { background: var(--warning-bg); color: var(--warning-ink); }
.alert--info    { background: var(--info-bg);    color: var(--info-ink); }

/* Toast: a flash message that floats in and dismisses itself. */
.toast-stack {
  position: fixed;
  top: calc(var(--header-h-scrolled) + var(--s-4));
  right: var(--gutter);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  width: min(24rem, calc(100vw - 2 * var(--gutter)));
  pointer-events: none;
}
.toast-stack .alert {
  pointer-events: auto;
  box-shadow: var(--sh-lg);
  animation: toast-in var(--d-base) var(--ease-out) both;
}
.toast-stack .alert.is-leaving { animation: toast-out var(--d-base) var(--ease-out) both; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(1.5rem); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(1.5rem); } }

/* ------------------------------------------------------------------------ */
/* Empty state                                                               */
/* ------------------------------------------------------------------------ */

.empty {
  text-align: center;
  padding: var(--s-16) var(--s-6);
  color: var(--text-on-light-muted);
}
.empty__icon { width: 3rem; height: 3rem; margin: 0 auto var(--s-4); color: var(--bone-400); }
.empty__title { font-size: var(--t-lg); font-weight: 700; color: var(--text-on-light); margin-bottom: var(--s-2); }
.empty__body { font-size: var(--t-sm); max-width: 28rem; margin: 0 auto var(--s-6); }

/* ------------------------------------------------------------------------ */
/* Loading                                                                   */
/* ------------------------------------------------------------------------ */

.spinner {
  width: 1.25rem; height: 1.25rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--r-full);
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.is-loading { position: relative; pointer-events: none; }
.is-loading > * { opacity: 0.4; }
.is-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 1.5rem; height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border: 2px solid var(--gold-500);
  border-top-color: transparent;
  border-radius: var(--r-full);
  animation: spin 0.7s linear infinite;
}

/* A shimmering placeholder for content that is still loading. */
.skeleton {
  background: linear-gradient(90deg, var(--bone-200) 25%, var(--bone-300) 37%, var(--bone-200) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ------------------------------------------------------------------------ */
/* Cookie banner                                                             */
/* ------------------------------------------------------------------------ */

.consent {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--s-4);
  z-index: var(--z-modal);
  max-width: 40rem;
  max-height: calc(100svh - 2rem);
  overflow-y: auto;
  margin-inline: auto;
  padding: var(--s-6) var(--s-6) var(--s-5);
  background: var(--ink-900);
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--sh-xl);
  animation: consent-in var(--d-slow) var(--ease-out) 0.6s both;
}
@keyframes consent-in { from { opacity: 0; transform: translateY(1.5rem); } }

.consent__close {
  position: absolute;
  top: var(--s-3); right: var(--s-3);
  width: 2.25rem; height: 2.25rem;
  display: grid; place-items: center;
  color: var(--text-on-dark-muted);
}
.consent__close:hover { color: #fff; }
.consent__close svg { width: 1.125rem; height: 1.125rem; }

.consent__title { font-size: var(--t-md); font-weight: 600; margin: 0 0 var(--s-2); padding-right: var(--s-8); }
.consent__text { font-size: var(--t-sm); line-height: 1.55; color: var(--text-on-dark-muted); margin: 0; }
.consent__text a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.consent__choices { margin-top: var(--s-5); border-top: 1px solid rgba(255, 255, 255, 0.12); }
.consent__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.consent__row-text { font-size: var(--t-sm); line-height: 1.5; color: var(--text-on-dark-muted); }
.consent__row-text strong { display: block; color: var(--text-on-dark); font-weight: 600; margin-bottom: 0.15rem; }
.consent__row input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; flex: none; accent-color: #fff; cursor: pointer; }
.consent__row input:disabled { cursor: not-allowed; opacity: 0.6; }

/* Reject, customise and accept sit side by side with equal weight: the
   Garante asks that saying no is as easy as saying yes. */
.consent__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-5); }
.consent__actions [hidden] { display: none !important; }
.consent__actions .btn { width: 100%; white-space: normal; }
.consent .btn--outline { --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, 0.5); }
.consent .btn--outline:hover { --btn-bg: #fff; --btn-fg: #000; }
@media (max-width: 479px) {
  .consent { padding: var(--s-5) var(--s-4) var(--s-4); bottom: var(--s-2); left: var(--s-2); right: var(--s-2); }
  /* Reject and accept side by side, identical; the finer choice below. */
  .consent__actions { grid-template-columns: 1fr 1fr; }
  .consent__actions [data-consent-customize],
  .consent__actions [data-consent-choice="save"] { grid-column: 1 / -1; order: 2; }
}

.footer__link--button { padding: 0; font: inherit; text-align: left; cursor: pointer; background: none; border: 0; }
@media (max-width: 767px) { .footer__link--button { padding-block: 0.3rem; min-height: 2rem; } }

/* The live contact form: no box, just a line under each field. */
.input--line,
.textarea.input--line {
  border: 0;
  border-bottom: 1px solid var(--bone-400);
  border-radius: 0;
  padding-inline: 0.25rem;
  background: transparent;
}
.input--line:hover { border-bottom-color: #000; }
.input--line:focus { box-shadow: 0 1px 0 0 var(--gold-500); border-bottom-color: var(--gold-500); }

/* Discount code */
.coupon-field { display: flex; gap: var(--s-2); }
.coupon-field__input { text-transform: uppercase; letter-spacing: 0.04em; }
.coupon-field__apply { flex: none; min-height: 3rem; }
.coupon-field__status { min-height: 1.25rem; margin-top: var(--s-2); font-size: var(--t-sm); }
.coupon-field__status .is-ok { color: var(--success-ink); font-weight: 700; }
.coupon-field__status .is-error { color: var(--danger); }
.coupon-field__status svg { width: 1rem; height: 1rem; display: inline-block; vertical-align: -0.15em; }
