/* =============================================================================
   Espaço Andrea de Paula — Agenda Online
   1. Tokens        4. Layout         7. Agenda pública   10. Diálogos
   2. Reset         5. Botões         8. Grade/Calendário 11. Toast
   3. Tipografia    6. Cabeçalho      9. Painéis          12. Responsivo
   ========================================================================== */

/* ------------------------------------------------------------- 1. TOKENS  */
:root {
  color-scheme: light;

  --paper: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee7;
  --surface-3: #ebe4da;

  --ink: #191621;
  --ink-2: #4a4453;
  --muted: #6e6878;

  --line: #e7e0d7;
  --line-strong: #d6ccbf;

  --brand: #6b3fa0;
  --brand-hover: #58318a;
  --brand-ink: #ffffff;
  --brand-soft: #f1eafa;
  --brand-ring: rgba(107, 63, 160, 0.2);

  --ok: #3c6a43;
  --ok-bg: #e8f1e6;
  --ok-line: #cfe1cc;

  --warn: #8a6416;
  --warn-bg: #fbf1da;
  --warn-line: #ecdcb6;

  --danger: #a32c2c;
  --danger-bg: #fbe7e4;
  --danger-line: #f0cdc8;

  --busy-bg: #efeae2;
  --busy-ink: #8b8479;

  --hero-scrim: linear-gradient(100deg, rgba(24, 12, 38, 0.82) 0%, rgba(24, 12, 38, 0.5) 52%, rgba(24, 12, 38, 0.22) 100%);
  --header-bg: rgba(250, 247, 242, 0.82);

  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(25, 22, 33, 0.05), 0 2px 8px rgba(25, 22, 33, 0.04);
  --shadow: 0 2px 4px rgba(25, 22, 33, 0.05), 0 12px 32px rgba(25, 22, 33, 0.07);
  --shadow-lg: 0 24px 70px rgba(25, 22, 33, 0.24);

  --shell: 1160px;
  --gutter: clamp(16px, 4vw, 32px);

  --t-fast: 130ms;
  --t-base: 180ms;
  --t-slow: 260ms;
  --ease: cubic-bezier(0.2, 0.8, 0.3, 1);
  --ease-io: cubic-bezier(0.4, 0, 0.2, 1);

  --font-ui: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Playfair Display", Georgia, serif;
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper: #121016;
  --surface: #1a1721;
  --surface-2: #23202d;
  --surface-3: #2c2838;

  --ink: #f4f0f8;
  --ink-2: #cfc8da;
  --muted: #9b92ab;

  --line: #2c2838;
  --line-strong: #3d3653;

  --brand: #a981e6;
  --brand-hover: #bd9bf1;
  --brand-ink: #16101f;
  --brand-soft: #291f38;
  --brand-ring: rgba(169, 129, 230, 0.28);

  --ok: #a7d69b;
  --ok-bg: #1d2b1c;
  --ok-line: #2d4029;

  --warn: #e0bd72;
  --warn-bg: #2e2617;
  --warn-line: #423723;

  --danger: #f0a6a6;
  --danger-bg: #3a2027;
  --danger-line: #4e2a31;

  --busy-bg: #262231;
  --busy-ink: #7e7690;

  --hero-scrim: linear-gradient(100deg, rgba(9, 6, 14, 0.9) 0%, rgba(9, 6, 14, 0.65) 52%, rgba(9, 6, 14, 0.35) 100%);
  --header-bg: rgba(18, 16, 22, 0.84);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 14px 34px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.65);
}

/* -------------------------------------------------------------- 2. RESET  */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t-base) var(--ease-io), color var(--t-base) var(--ease-io);
}

img { display: block; max-width: 100%; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; }

.svg-sprite { display: none; }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--t-base) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

.progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 0;
  z-index: 900;
  background: linear-gradient(90deg, var(--brand), var(--brand-hover));
  opacity: 0;
  pointer-events: none;
  transition: width var(--t-slow) var(--ease), opacity var(--t-fast) linear;
}
.progress.is-active { opacity: 1; }

/* --------------------------------------------------------- 3. TIPOGRAFIA  */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}

h1 { font-size: clamp(28px, 4.2vw, 40px); }
h2 { font-size: clamp(22px, 3vw, 29px); }
h3 { font-size: 19px; }

.eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

/* ------------------------------------------------------------- 4. LAYOUT  */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.view { display: none; }
body[data-view="agenda"] .view[data-view="agenda"],
body[data-view="admin"] .view[data-view="admin"],
body[data-view="pro"] .view[data-view="pro"] { display: block; }
body[data-view="login"] .view[data-view="login"] { display: grid; }

.view { animation: view-in var(--t-base) var(--ease) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

body[data-view="login"] [data-hide-on~="login"] { display: none; }

[data-show-on] { display: none !important; }
body[data-view="agenda"] [data-show-on~="agenda"],
body[data-view="admin"] [data-show-on~="admin"],
body[data-view="pro"] [data-show-on~="pro"],
body[data-view="login"] [data-show-on~="login"] { display: inline-flex !important; }

.page-body { padding-block: clamp(28px, 5vw, 52px) clamp(48px, 8vw, 88px); }

.section + .section { margin-top: clamp(32px, 5vw, 52px); }
.section { scroll-margin-top: 96px; }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.section__head--tight { margin-bottom: 14px; align-items: center; }

.section__sub {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--muted);
}

.section__hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------- 5. BOTÕES  */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io),
    border-color var(--t-fast) var(--ease-io), transform var(--t-fast) var(--ease-io),
    box-shadow var(--t-fast) var(--ease-io);
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 6px 18px var(--brand-ring);
}
.btn--primary:hover:not(:disabled) { background: var(--brand-hover); }

.btn--quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn--quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }

.btn--danger-soft {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
}
.btn--danger-soft:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn--full { width: 100%; }

.btn.is-loading {
  color: transparent !important;
  position: relative;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: var(--brand-ink);
  opacity: 0.9;
  animation: spin 0.65s linear infinite;
}
.btn--primary.is-loading::after { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--ink-2);
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io);
}
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn--outline { border-color: var(--line); background: var(--surface); }
.icon-btn--outline:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }

.icon--sun { display: none; }
[data-theme="dark"] .icon--moon { display: none; }
[data-theme="dark"] .icon--sun { display: block; }

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 0;
  margin-bottom: 10px;
  transition: color var(--t-fast) var(--ease-io);
}
.link-back:hover { color: var(--brand); }
.link-back .icon { width: 16px; height: 16px; }

/* --------------------------------------------------------- 6. CABEÇALHO   */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  min-width: 0;
}
.brand:hover { text-decoration: none; }

.brand__mark {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  object-fit: contain;
  background: #5b2c8a;
  padding: 3px;
  flex: none;
}

.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__text strong {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__text span {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__actions { display: flex; align-items: center; gap: 8px; }

/* ----------------------------------------------------- 7. AGENDA PÚBLICA  */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(320px, 46vw, 440px);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: #34205a;
  background-image: var(--hero-scrim),
    url("../assets/hero.jpg");
  background-size: cover;
  background-position: center 38%;
}

.hero__content { color: #fff; padding-block: clamp(40px, 6vw, 64px); }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7cdb6a;
  box-shadow: 0 0 0 0 rgba(124, 219, 106, 0.7);
  animation: pulse 2.4s var(--ease-io) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 219, 106, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(124, 219, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 219, 106, 0); }
}

.hero h1 {
  font-size: clamp(32px, 5.6vw, 56px);
  font-weight: 400;
  max-width: 15ch;
  color: #fff;
}
.hero h1 em { font-style: italic; font-weight: 500; }

.hero__lead {
  margin-top: 16px;
  max-width: 44ch;
  font-size: clamp(15px, 1.6vw, 17px);
  color: rgba(255, 255, 255, 0.86);
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}
.hero__facts li { display: inline-flex; align-items: center; gap: 8px; }

/* Stepper */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: clamp(24px, 4vw, 36px);
}
.stepper__item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--t-base) var(--ease-io);
}
.stepper__dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.stepper__item.is-current {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.stepper__item.is-current .stepper__dot { background: var(--brand); color: var(--brand-ink); }
.stepper__item.is-done { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.stepper__item.is-done .stepper__dot { background: var(--ok); color: var(--surface); }

/* Cards de profissional */
.pro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.pro-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 24px 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease-io),
    box-shadow var(--t-base) var(--ease);
  animation: item-in var(--t-base) var(--ease) both;
}
.pro-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.pro-card:active { transform: translateY(-1px) scale(0.99); }

.pro-card__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-bottom: 12px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line);
}
.pro-card__avatar.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.25s var(--ease-io) infinite;
}
[data-theme="dark"] .pro-card__avatar.is-loading::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.pro-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.pro-card__photo.is-loaded { opacity: 1; }

.pro-card__initial {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  color: var(--brand);
}

.pro-card__name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.pro-card__spec { font-size: 13px; color: var(--muted); }

.pro-card__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
}
.tag {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.pro-card__cta {
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pro-card:hover .pro-card__cta { gap: 10px; }
.pro-card__cta { transition: gap var(--t-base) var(--ease); }

@keyframes item-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Skeleton */
.skeleton {
  padding: 24px 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.skeleton__avatar,
.skeleton__line {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-xs);
}
.skeleton__avatar { width: 88px; height: 88px; border-radius: 50%; margin-bottom: 6px; }
.skeleton__line { height: 11px; width: 68%; }
.skeleton__line--sm { width: 44%; }
.skeleton__avatar::after,
.skeleton__line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.25s var(--ease-io) infinite;
}
[data-theme="dark"] .skeleton__avatar::after,
[data-theme="dark"] .skeleton__line::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* -------------------------------------------------- 8. GRADE/CALENDÁRIO   */
.scheduler {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: clamp(16px, 2.4vw, 24px);
  align-items: start;
}

.calendar { padding: 20px; }

.calendar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.calendar__nav h3 {
  font-size: 17px;
  text-align: center;
  flex: 1;
}

.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.calendar__weekdays {
  margin-bottom: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io),
    box-shadow var(--t-fast) var(--ease-io);
}
.day--blank { visibility: hidden; }
.day--off { color: var(--muted); opacity: 0.4; font-weight: 500; cursor: default; }

.day--free { background: var(--surface-2); }
.day--free:hover { background: var(--brand-soft); color: var(--brand); }

.day--tight { background: var(--warn-bg); color: var(--warn); }
.day--tight:hover { filter: brightness(0.97); }

.day--blocked { background: var(--danger-bg); color: var(--danger); }

.day--today:not(.day--selected) { box-shadow: inset 0 0 0 2px var(--brand); }

.day--selected,
.day--selected:hover {
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}

.day__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.day--selected .day__dot { background: var(--brand-ink); opacity: 0.8; }
.day--off .day__dot,
.day--blank .day__dot { display: none; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend__dot { width: 9px; height: 9px; border-radius: 3px; }
.legend__dot--free { background: var(--surface-3); }
.legend__dot--partial { background: var(--warn-line); }
.legend__dot--blocked { background: var(--danger-line); }

/* Painel de horários */
.times { padding: 22px; min-height: 260px; }
.times__head { margin-bottom: 18px; }

.times__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.times__grid .empty-state { grid-column: 1 / -1; }

.slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid transparent;
  text-align: left;
  transition: transform var(--t-fast) var(--ease-io), background var(--t-fast) var(--ease-io),
    border-color var(--t-fast) var(--ease-io);
}
.slot__hour { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.slot__state {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}
.slot__cta { font-size: 12.5px; font-weight: 700; margin-top: 4px; }

.slot--free {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}
.slot--free:hover { transform: translateY(-2px); border-color: var(--ok); }

.slot--busy { background: var(--busy-bg); color: var(--busy-ink); cursor: default; }
.slot--blocked { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); cursor: default; }

.slot__toggle {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.85;
}
.slot__toggle:hover { opacity: 1; }

.times__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--muted);
  text-align: center;
  font-size: 14.5px;
}
.empty-state .icon { width: 26px; height: 26px; opacity: 0.55; }

/* ----------------------------------------------------------- 9. PAINÉIS   */
.field { margin-bottom: 16px; }
.field--inline { margin-bottom: 0; min-width: 240px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--t-fast) var(--ease-io), box-shadow var(--t-fast) var(--ease-io);
}
.field select {
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) calc(50% + 1px), calc(100% - 14px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input::placeholder { color: var(--muted); opacity: 0.75; }

.field__with-action { position: relative; }
.field__action {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 7px 10px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
}
.field__action:hover { background: var(--brand-soft); }
.field__with-action input { padding-right: 84px; }

.field__error,
.form-error {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}
.form-error {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
}

.record-list { display: flex; flex-direction: column; gap: 10px; }

.record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  animation: item-in var(--t-fast) var(--ease) both;
}

.record__main { display: flex; align-items: center; gap: 13px; min-width: 0; }

.record__time {
  display: grid;
  place-items: center;
  width: 56px;
  height: 48px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.record__time--blocked { background: var(--danger-bg); color: var(--danger); }

.record__title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.record__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
.record__meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.record__meta a:hover { color: var(--brand); }

.record__action {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--danger-line);
  background: transparent;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  transition: background var(--t-fast) var(--ease-io), color var(--t-fast) var(--ease-io);
}
.record__action:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Login */
.view-login {
  grid-template-columns: 1.05fr 1fr;
  min-height: 100dvh;
}

.login__aside {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 56px);
  color: #fff;
  background-color: #2c1a4a;
  background-image: linear-gradient(180deg, rgba(20, 10, 34, 0.35), rgba(20, 10, 34, 0.85)),
    url("https://images.unsplash.com/photo-1560066984-138dadb4c035?auto=format&fit=crop&w=1200&q=80");
  background-size: cover;
  background-position: center;
}
.login__aside-inner { max-width: 42ch; }
.login__mark {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  object-fit: contain;
  background: #5b2c8a;
  padding: 4px;
  margin-bottom: 22px;
}
.login__aside h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 400; color: #fff; }
.login__aside p { margin-top: 12px; color: rgba(255, 255, 255, 0.82); }

.login__panel {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3vw, 32px) clamp(20px, 4vw, 56px) clamp(32px, 4vw, 48px);
  background: var(--paper);
}
.login__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.login__topbar .link-back { margin-bottom: 0; }

.login__form-wrap {
  width: 100%;
  max-width: 380px;
  margin: auto;
  padding-block: 32px;
}
.login__logo {
  width: 104px;
  height: 104px;
  border-radius: 26px;
  object-fit: contain;
  background: #5b2c8a;
  padding: 8px;
  margin: 0 auto 26px;
  box-shadow: 0 10px 36px var(--brand-ring);
}
.login__form-wrap h1 { margin-bottom: 26px; }
.login__form-wrap .btn { margin-top: 8px; }

/* Rodapé */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: clamp(32px, 5vw, 48px) 28px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: clamp(20px, 3vw, 36px);
}
.site-footer__brand { display: flex; align-items: center; gap: 12px; }
.site-footer__brand img {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  object-fit: contain;
  background: #5b2c8a;
  padding: 3px;
}
.site-footer__brand strong { display: block; font-size: 15px; }
.site-footer__brand span { font-size: 13px; color: var(--muted); }

.site-footer__col h3 {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.site-footer__col a,
.site-footer__col p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
}
.site-footer__col a:hover { color: var(--brand); text-decoration: none; }
.site-footer__col .icon { margin-top: 2px; color: var(--brand); }

.site-footer__note {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

/* --------------------------------------------------------- 10. DIÁLOGOS   */
.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: visible;
}
.dialog::backdrop {
  background: rgba(20, 14, 30, 0.55);
  backdrop-filter: blur(3px);
}
.dialog[open] { animation: dialog-in var(--t-base) var(--ease) both; }
.dialog[open]::backdrop { animation: fade-in var(--t-base) var(--ease-io) both; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.dialog__close-form { position: absolute; top: 12px; right: 12px; }
.dialog__close { width: 34px; height: 34px; color: var(--muted); }

.dialog h2 { font-size: 24px; padding-right: 36px; }
.dialog__subtitle { margin: 6px 0 22px; font-size: 14px; color: var(--muted); }
.dialog__note { margin: 4px 0 20px; font-size: 12.5px; color: var(--muted); }

.dialog__actions { display: flex; gap: 10px; justify-content: flex-end; }
.dialog__actions--center { justify-content: center; }

.dialog--success { text-align: center; }
.success__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 4px auto 18px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  animation: pop var(--t-slow) var(--ease) both;
}
.success__icon .icon { width: 28px; height: 28px; stroke-width: 2.4; }
@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.summary {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 6px 16px;
  margin-bottom: 22px;
}
.summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.summary__row:last-child { border-bottom: 0; }
.summary__row dt { color: var(--muted); flex: none; }
.summary__row dd { font-weight: 700; text-align: right; }

/* ------------------------------------------------------------- 11. TOAST  */
.toast {
  position: fixed;
  z-index: 800;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 18px 13px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.toast.is-leaving { opacity: 0; transform: translateY(10px); }
.toast__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
}
.toast__icon--warn { background: var(--warn-bg); color: var(--warn); }
.toast__icon--error { background: var(--danger-bg); color: var(--danger); }
.toast__body { display: flex; flex-direction: column; min-width: 0; }
.toast__body strong { font-size: 14px; }
.toast__body span { font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------- 12. RESPONSIVO */
@media (max-width: 1000px) {
  .scheduler { grid-template-columns: 1fr; }
  .calendar { max-width: 460px; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .view-login { grid-template-columns: 1fr; }
  .login__aside {
    min-height: 210px;
    align-items: flex-end;
    padding: 24px;
  }
  .login__mark { width: 48px; height: 48px; margin-bottom: 14px; }
  .login__panel { padding-inline: var(--gutter); }
}

@media (max-width: 640px) {
  .brand__text span { display: none; }
  .brand__mark { width: 44px; height: 44px; }
  .site-header__actions .btn span { display: none; }
  .site-header__actions .btn { padding: 11px; }

  .hero { min-height: 340px; }
  .hero h1 { max-width: 100%; }

  .section__head { align-items: flex-start; }
  .field--inline { width: 100%; }

  .pro-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
  .pro-card { padding: 18px 12px 16px; }
  .pro-card__photo { width: 68px; height: 68px; }
  .pro-card__tags { display: none; }

  .calendar { padding: 16px; }
  .times { padding: 18px; }
  .times__grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }

  .site-footer__inner { grid-template-columns: 1fr; }

  .dialog { width: 100%; max-width: none; margin: auto auto 0; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .dialog__actions { flex-direction: column-reverse; }
  .dialog__actions .btn { width: 100%; }

  .toast { left: max(16px, env(safe-area-inset-left)); max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .pro-card:hover { transform: none; }
  .slot--free:hover { transform: none; }
}

@media print {
  .site-header, .hero, .stepper, .times__actions, .toast, .progress, .skip-link { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}


/* Retorno 15 min — só podóloga: verde, caixa menor, só texto "Retorno" */
.slot--return {
  border-style: solid;
  min-height: 0;
  padding: 0.45rem 0.5rem;
  grid-row: auto;
  align-self: center;
  max-width: 7.5rem;
  justify-self: center;
  width: 100%;
}
.slot--return .slot__hour {
  font-size: 0.78rem;
  font-weight: 600;
}
.slot--return .slot__cta {
  font-size: 0.7rem;
}
.slot--return.slot--free {
  background: color-mix(in srgb, #22c55e 16%, transparent);
  border-color: color-mix(in srgb, #22c55e 45%, transparent);
  color: inherit;
}
[data-theme="dark"] .slot--return.slot--free {
  background: color-mix(in srgb, #22c55e 22%, transparent);
  border-color: color-mix(in srgb, #22c55e 50%, transparent);
}


/* Modal centralizado */
.dialog {
  margin: auto;
  position: fixed;
  inset: 0;
  max-height: min(90vh, 640px);
  overflow: auto;
}
.dialog::backdrop {
  background: rgba(20, 10, 30, 0.5);
}
.slot--pending {
  background: color-mix(in srgb, #d97706 18%, transparent);
  border-color: color-mix(in srgb, #d97706 40%, transparent);
  color: inherit;
  cursor: default;
}
.slot--return-busy {
  border-style: dashed;
}

.calendar__day.is-free { background: color-mix(in srgb, #16a34a 22%, transparent); }
.calendar__day.is-few { background: color-mix(in srgb, #d97706 22%, transparent); }
.calendar__day.is-full { background: color-mix(in srgb, #dc2626 18%, transparent); opacity: 0.85; }
.calendar__day.is-disabled { opacity: 0.35; }
.slot--return .slot__hour { color: var(--green, #16a34a); }
