/* Rightway Cleaning Services — shared tokens and primitives (customer site + admin). */
:root {
  --black: #000;
  --white: #fff;
  --ink: #1d1d1f;
  --steel: #6e6e73;
  --line: #d2d2d7;
  --mist: #f5f5f7;
  --danger: #b3261e;
  --ok: #1e6b3a;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r-sm: 8px;
  --r-md: 14px;
  --gutter: 20px;
  --tap: 52px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }

:focus-visible { outline: 3px solid #0a64d6; outline-offset: 2px; border-radius: 4px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px;
  border-radius: var(--r-md); border: 1.5px solid transparent;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform .15s var(--ease), background-color .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: #2a2a2c; }
.btn-light { background: var(--white); color: var(--black); }
.btn-outline { background: transparent; border-color: currentColor; }
.btn-quiet { background: var(--mist); color: var(--ink); }
.btn-text { background: none; border: 0; padding: 0 4px; min-height: 44px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-block { width: 100%; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }

/* Forms */
.field { display: block; margin-bottom: 22px; }
.field > .label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.field > .help { display: block; font-size: 14px; color: var(--steel); margin: -4px 0 8px; }
.input, .textarea, .select {
  width: 100%; min-height: var(--tap); padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white);
  font-size: 17px; transition: border-color .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.4; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.field.invalid .input, .field.invalid .textarea { border-color: var(--danger); }
.error-text { display: block; color: var(--danger); font-size: 14px; font-weight: 500; margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Choice rows (checkbox / radio styled as large rows) */
.choice {
  position: relative; display: flex; align-items: center; gap: 14px;
  min-height: 58px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .tick {
  flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--line);
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.choice.radio .tick { border-radius: 50%; }
.choice .tick svg { width: 15px; height: 15px; stroke: var(--white); opacity: 0; transition: opacity .12s; }
.choice input:checked + .tick { background: var(--black); border-color: var(--black); }
.choice input:checked + .tick svg { opacity: 1; }
.choice input:focus-visible + .tick { outline: 3px solid #0a64d6; outline-offset: 2px; }
.choice .text { font-size: 17px; font-weight: 500; }
.choice .sub { display: block; font-size: 14px; color: var(--steel); font-weight: 400; }

/* Calendar (shared) */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.cal-nav { display: flex; gap: 4px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mist);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn[disabled] { opacity: .3; cursor: not-allowed; }
.icon-btn svg { width: 18px; height: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 12px; font-weight: 600; color: var(--steel); text-align: center; padding: 4px 0 6px; }
.day {
  position: relative; aspect-ratio: 1 / 1.08; min-height: 44px;
  border: 0; border-radius: 10px; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 17px; font-weight: 500; color: #b5b5ba; cursor: default; padding: 0;
}
.day .marks { display: flex; gap: 3px; height: 6px; }
.day .mk { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.day .mk.off { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; opacity: .5; }
.day.available { color: var(--black); font-weight: 700; cursor: pointer; background: var(--mist); }
.day.available:hover { background: #e8e8ed; }
.day.full { color: var(--steel); }
.day.full .num { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.day.blocked { color: #8e8e93; background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0,0,0,.07) 5px 6px); }
.day.today .num { text-decoration: underline; text-underline-offset: 4px; }
.day.selected { background: var(--black) !important; color: var(--white) !important; }
.day.empty { visibility: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 14px; color: var(--steel); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 20px; height: 20px; border-radius: 6px; font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.legend .lg-av { background: var(--mist); color: var(--black); }
.legend .lg-full { color: var(--steel); text-decoration: line-through; }
.legend .lg-off { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(0,0,0,.12) 4px 5px); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--black); color: var(--white); padding: 12px 18px; border-radius: 12px;
  font-size: 15px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
  z-index: 100; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.error { background: var(--danger); }

.spinner { width: 20px; height: 20px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--mist), #ececf0, var(--mist)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Utilities (no inline styles: the CSP forbids them) */
.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
.mt-8 { margin-top: 8px; } .mt-10 { margin-top: 10px; } .mt-22 { margin-top: 22px; }
.opt { font-weight: 400; color: var(--steel); }
.sk-row { height: 56px; } .sk-cal { height: 330px; } .sk-lg { height: 120px; margin-top: 20px; }
.err-banner { padding: 14px 16px; border-radius: var(--r-md); background: #fdecea; color: var(--danger); font-weight: 500; font-size: 15px; margin: 16px 0; }
.btn svg { width: 20px; height: 20px; flex: none; }
