/* Animated booking-widget demo (SaaS hero).
   Layered on top of the .widget-mock that landing.css already styles. */

.widget-mock { position: relative; isolation: isolate; }

/* Pending hover state: subtle blue highlight before click locks the range */
.widget-day.range-pending {
  background: #eaf1fc;
  border-color: #c5d6f1;
  color: #1a4ea1;
  font-weight: 600;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

/* Tiny "click ripple" when selection locks in */
.widget-mock.is-clicked .widget-day.range-start::before,
.widget-mock.is-clicked .widget-day.range-end::before {
  content: "";
  position: absolute; inset: -3px;
  border-radius: inherit;
  border: 2px solid var(--ink);
  opacity: 0.45;
  animation: wfo-ripple .35s ease-out forwards;
}
@keyframes wfo-ripple {
  from { transform: scale(0.85); opacity: 0.6; }
  to   { transform: scale(1.18); opacity: 0; }
}

/* ---------- Form overlay ---------- */
.widget-form-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .28s ease, transform .32s cubic-bezier(.2,.8,.2,1);
}
.widget-form-overlay.is-shown {
  opacity: 1;
  transform: none;
}
.widget-form-overlay::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 0;
}

.wfo-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  width: 100%;
  max-width: 420px;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity .25s ease, transform .25s ease;
}
.widget-form-overlay.is-confirmed .wfo-card {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

.wfo-head { display: flex; flex-direction: column; gap: 2px; }
.wfo-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.wfo-period { font-size: 12.5px; color: var(--muted); }

.wfo-rows { display: flex; flex-direction: column; gap: 10px; }
.wfo-row { display: flex; flex-direction: column; gap: 4px; }
.wfo-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wfo-input {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink);
  min-height: 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  transition: border-color .18s ease, background .18s ease;
}
.wfo-row.is-active .wfo-input {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10,10,10,0.05);
}
.wfo-textarea { min-height: 54px; align-items: flex-start; line-height: 1.45; }

.wfo-typed { display: inline; }
.wfo-caret {
  display: inline-block;
  width: 1.5px;
  height: 14px;
  background: currentColor;
  margin-left: 1px;
  vertical-align: middle;
  opacity: 0;
}
.wfo-row.is-active .wfo-caret {
  opacity: 1;
  animation: wfo-blink 1s steps(1) infinite;
}
@keyframes wfo-blink { 50% { opacity: 0; } }

.wfo-submit {
  margin-top: 4px;
  height: 38px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: stretch;
  transition: transform .15s ease, box-shadow .15s ease;
}
.wfo-submit.is-hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 6px 18px -8px rgba(0,0,0,0.5);
}
.wfo-spinner {
  display: none;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.wfo-submit.is-loading .wfo-spinner { display: inline-block; }

/* ---------- Confirmation ---------- */
.wfo-confirm {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  color: var(--accent);
}
.widget-form-overlay.is-confirmed .wfo-confirm {
  opacity: 1;
  transform: none;
}
.wfo-check { color: var(--accent); }
.wfo-check-circle {
  stroke-dasharray: 138;
  stroke-dashoffset: 138;
}
.widget-form-overlay.is-confirmed .wfo-check-circle {
  animation: wfo-draw-circle .55s ease-out forwards;
}
.wfo-check-tick {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
}
.widget-form-overlay.is-confirmed .wfo-check-tick {
  animation: wfo-draw-tick .35s ease-out .35s forwards;
}
@keyframes wfo-draw-circle { to { stroke-dashoffset: 0; } }
@keyframes wfo-draw-tick { to { stroke-dashoffset: 0; } }

.wfo-confirm-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
  margin-top: 4px;
}
.wfo-confirm-sub {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.5;
}

/* ---------- Tighter mobile sizing ---------- */
@media (max-width: 520px) {
  .wfo-card { padding: 14px 14px 12px; max-width: none; }
  .wfo-title { font-size: 14px; }
  .wfo-period { font-size: 12px; }
  .wfo-label { font-size: 10.5px; }
  .wfo-input { font-size: 12.5px; padding: 7px 9px; }
  .wfo-textarea { min-height: 48px; }
  .wfo-confirm-title { font-size: 16px; }
  .wfo-confirm-sub { font-size: 13px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .widget-form-overlay,
  .widget-form-overlay .wfo-card,
  .widget-form-overlay .wfo-confirm,
  .wfo-check-circle,
  .wfo-check-tick,
  .wfo-caret,
  .wfo-submit { transition: none; animation: none; }
}
