/* ===== Agendamento de Instalação — estilos públicos ===== */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #3451e0;
  --primary-strong: #2638b8;
  --primary-soft: #eef2ff;
  --primary-soft-2: #f5f3ff;
  --primary-border: #dbe1fb;
  --primary-rgb: 52, 81, 224;
  --grad: linear-gradient(135deg, #1e3a8a 0%, #2b4fd8 45%, #6d5df6 100%);
  --success: #15803d;
  --success-soft: #e7f6ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a6700;
  --warn-soft: #fff6dd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -.01em; }
h2 { font-size: 1.125rem; display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); font-weight: 400; }
a { color: var(--primary); }

/* ---------- topo e rodapé ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--border); }
.topbar__inner { max-width: 1080px; margin: 0 auto; padding: .9rem 1rem; display: flex; align-items: center; }
.brand { font-weight: 650; display: inline-flex; align-items: center; gap: .6rem; }
.brand__mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); position: relative; }
.brand__mark::after { content: ""; position: absolute; left: 9px; top: 6px; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.page { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.footer { max-width: 1080px; margin: 0 auto; padding: 0 1rem 2rem; font-size: .875rem; color: var(--muted); text-align: center; }

.intro { max-width: 680px; margin-bottom: 1.5rem; }
.intro p { color: var(--muted); }

/* ---------- layout ---------- */
.layout { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
.layout__col { display: grid; gap: 1.25rem; min-width: 0; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .card--sticky { position: sticky; top: 1rem; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  min-width: 0;
}
@media (max-width: 480px) { .card { padding: 1.1rem; border-radius: 12px; } }
.card--narrow { max-width: 640px; margin: 0 auto; }

.step {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-size: .9rem; font-weight: 700;
}

/* ---------- formulário ---------- */
.field { margin-bottom: 1rem; }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
label { display: block; font-weight: 600; font-size: .925rem; margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: .7rem .85rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18); }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger); }
#licenses { font-size: 1.35rem; font-weight: 650; max-width: 220px; }
.field__hint { font-size: .85rem; color: var(--muted); margin: .35rem 0 0; }
.field__error { font-size: .85rem; color: var(--danger); margin: .3rem 0 0; min-height: 0; }
.field__error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- estimativa ---------- */
.estimate {
  display: grid; gap: .1rem;
  padding: 1rem 1.1rem; margin-bottom: 1rem;
  border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-border);
}
.estimate__label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.estimate__value { font-size: 1.5rem; letter-spacing: -.01em; }
.estimate__sub { font-size: .875rem; color: var(--muted); }
.estimate--warn { background: var(--warn-soft); border-color: #f3dc9b; }
.estimate--warn .estimate__label { color: var(--warn); }

/* ---------- calendário ---------- */
.picker { min-height: 120px; }
.picker__placeholder, .picker__status {
  color: var(--muted); font-size: .95rem; padding: 1rem; margin: 0;
  background: #f8fafc; border: 1px dashed var(--border); border-radius: 12px; text-align: center;
}
.picker__status { margin-top: 1rem; }
.cal.is-loading { opacity: .55; pointer-events: none; }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cal__title { font-weight: 650; }
.cal__title::first-letter { text-transform: uppercase; }
.cal__nav {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text);
}
.cal__nav:disabled { opacity: .35; cursor: default; }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal__wd { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: .25rem 0; }
.cal__day {
  aspect-ratio: 1 / 1; min-height: 38px;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
  font: inherit; font-size: .95rem; color: #94a3b8; cursor: default;
}
.cal__day.is-available { background: var(--primary-soft); color: var(--primary-strong); font-weight: 650; cursor: pointer; }
.cal__day.is-available:hover { border-color: var(--primary); }
.cal__day.is-selected { background: var(--primary); color: #fff; }
.cal__day.is-today { text-decoration: underline; text-underline-offset: 3px; }
.cal__day:focus-visible, .slot:focus-visible, .btn:focus-visible, .cal__nav:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .45); outline-offset: 2px; }

.slots { margin-top: 1.25rem; }
.slots__title { font-size: .95rem; color: var(--muted); font-weight: 600; text-transform: none; }
.slots__title::first-letter { text-transform: uppercase; }
.slots__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; padding: 2px; }
@media (min-width: 900px) { .slots__list { max-height: 320px; overflow-y: auto; } }
.slot {
  display: grid; gap: 0; padding: .55rem .4rem; border-radius: 10px;
  border: 1px solid #cbd5e1; background: #fff; cursor: pointer; font: inherit; color: var(--text);
}
.slot:hover { border-color: var(--primary); }
.slot__start { font-weight: 700; font-size: 1rem; }
.slot__end { font-size: .75rem; color: var(--muted); }
.slot.is-selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot.is-selected .slot__end { color: rgba(255, 255, 255, .8); }

/* ---------- resumo, alertas, botões ---------- */
.summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem;
  margin: 1.25rem 0 1rem; padding: .9rem 1rem; border-radius: 12px; background: #f8fafc; border: 1px solid var(--border);
}
.summary div { display: grid; font-size: .9rem; }
@media (max-width: 480px) { .summary { grid-template-columns: 1fr; } }

.alert { padding: .8rem 1rem; border-radius: 10px; margin: 1rem 0; font-size: .95rem; background: #f1f5f9; }
.alert--error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f7c6c0; }
.alert--success { background: var(--success-soft); color: var(--success); border: 1px solid #b7e2c4; }
.alert--warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f3dc9b; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.2rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn--block { width: 100%; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-strong); }
.btn--primary:disabled { background: var(--primary); opacity: .45; cursor: not-allowed; }
.btn--ghost { background: #fff; border-color: #cbd5e1; color: var(--text); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-ghost { background: #fff; border-color: #f0b8b1; color: var(--danger); }
.btn--link { background: none; color: var(--primary); padding-left: 0; padding-right: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0; }
@media (max-width: 480px) { .actions .btn { flex: 1 1 100%; } }

/* ---------- confirmação ---------- */
.confirmation { text-align: center; }
.confirmation:focus { outline: none; }
.confirmation__icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--success-soft); margin: .5rem auto 1rem; position: relative;
}
.confirmation__icon::after {
  content: ""; position: absolute; left: 24px; top: 14px; width: 14px; height: 26px;
  border: solid var(--success); border-width: 0 4px 4px 0; transform: rotate(45deg);
}
.details { display: grid; gap: 0; margin: 1.25rem 0; text-align: left; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.details > div { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid var(--border); }
.details > div:first-child { border-top: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 420px) { .details > div { grid-template-columns: 1fr; gap: 0; } }
.confirmation .actions { justify-content: center; }
.manage-link { text-align: left; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.manage-link p { margin-bottom: .5rem; font-size: .925rem; }
.copy { display: flex; gap: .5rem; }
.copy input { font-size: .85rem; }

.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; margin-bottom: .75rem; }
.badge--confirmado { background: var(--success-soft); color: var(--success); }
.badge--cancelado { background: var(--danger-soft); color: var(--danger); }
.badge--concluido { background: #eef2f7; color: #334155; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* logo do cliente no topo das páginas */
.brand--logo img { display: block; max-height: 38px; max-width: 220px; width: auto; height: auto; }
body:not(.admin) .topbar { background: var(--grad); border-bottom: 0; color: #fff; }
body:not(.admin) .brand__mark { background: rgba(255, 255, 255, .2); }
.brand--card { background: #fff; padding: .3rem .7rem; border-radius: 10px; }
