:root {
  --ink: #2c2523;
  --ink-soft: #554842;
  --muted: #7c6b63;
  --rose: #8c4a5f;
  --rose-dark: #6f3549;
  --rose-soft: #f5e6e8;
  --cream: #fbf7f3;
  --line: #eadfd7;
  --gold: #b08a5a;
  --ok: #2e7d5b;
  --err: #a33a3a;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(63, 38, 45, .10);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--rose-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rose); }

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.01em;
  margin: 0 0 .4em;
}

h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.15; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }

p { margin: 0 0 1em; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; word-break: break-all; }

.page { min-height: 100vh; padding: 28px 18px 56px; }
.wrap, .card.narrow { width: 100%; max-width: 640px; margin: 0 auto; }
.wrap.wide { max-width: 1080px; }

.brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
.brand-mark {
  font-family: Georgia, serif;
  font-size: 1.55rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--rose-dark);
}
.brand-sub {
  font-size: .68rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 38px);
  margin: 0 auto;
}

.lead { font-size: 1.02rem; color: var(--ink-soft); }

.eyebrow {
  font-size: .68rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.hero { max-width: 640px; margin: 0 auto 22px; text-align: center; }
.hero p { color: var(--ink-soft); }

/* steps */
.steps { display: flex; gap: 8px; margin-bottom: 26px; }
.steps span {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  transition: background .25s;
}
.steps span.on { background: var(--rose); }

.step { display: none; }
.step.on { display: block; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.step-head h2 { margin: 0; }
.step-head .link-btn { background: none; border: 0; padding: 0; color: var(--rose); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; }

/* professionals */
.pros { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pro {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; cursor: pointer; transition: border-color .2s, background .2s;
}
.pro:hover { border-color: var(--rose); background: #fffdfc; }
.pro[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-soft); }
.pro small { color: var(--muted); display: block; font-size: .78rem; }
.pro .tick { color: var(--rose); opacity: 0; font-size: 1.1rem; }
.pro[aria-pressed="true"] .tick { opacity: 1; }

/* dates */
.dates {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
}
.date-chip {
  flex: 0 0 auto; width: 66px; padding: 10px 4px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  text-align: center; font: inherit; color: var(--ink);
  scroll-snap-align: start;
}
.date-chip b { display: block; font-family: Georgia, serif; font-size: 1.3rem; line-height: 1.2; }
.date-chip small { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.date-chip .n { display: block; font-size: .62rem; color: var(--gold); margin-top: 3px; min-height: 12px; }
.date-chip:hover { border-color: var(--rose); }
.date-chip[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: #fff; }
.date-chip[aria-pressed="true"] small, .date-chip[aria-pressed="true"] .n { color: #f7e9ec; }
.date-chip:disabled { opacity: .38; cursor: not-allowed; }

/* slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
  padding: 12px 6px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font: inherit; cursor: pointer; color: var(--ink);
}
.slot:hover { border-color: var(--rose); }
.slot[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: #fff; }
.slot small { display: block; font-size: .62rem; color: var(--muted); margin-top: 2px; }
.slot[aria-pressed="true"] small { color: #f5dfe4; }

.empty { padding: 22px; text-align: center; color: var(--muted); background: var(--cream); border-radius: 12px; }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea, .admin input, .admin select, .admin textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem;
}
.field input:focus, .field select:focus, .admin input:focus, .admin select:focus {
  outline: 2px solid rgba(140, 74, 95, .22); border-color: var(--rose);
}
.field .hint { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 99px; border: 1px solid var(--rose);
  background: var(--rose); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .2s, transform .1s;
}
.btn:hover { background: var(--rose-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--rose-dark); }
.btn.ghost:hover { background: var(--rose-soft); }
.btn.danger { background: var(--err); border-color: var(--err); }
.btn.small { padding: 8px 14px; font-size: .85rem; }
.btn.block { width: 100%; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: .9rem; margin: 12px 0; display: none; }
.alert.on { display: block; }
.alert.err { background: #fbecec; color: var(--err); border: 1px solid #f0c9c9; }
.alert.ok { background: #e9f5ef; color: var(--ok); border: 1px solid #c4e5d5; }

.consent { display: flex; gap: 9px; align-items: flex-start; font-size: .8rem; color: var(--muted); margin: 10px 0 16px; }
.consent input { width: auto; margin-top: 3px; }

/* otp */
.otp-input {
  width: 100%; padding: 16px; text-align: center; font-size: 2rem;
  letter-spacing: .5em; border-radius: 12px; border: 1px solid var(--line);
  font-family: ui-monospace, monospace; background: #fff;
}
.countdown { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }

/* success */
.success-icon {
  width: 56px; height: 56px; border-radius: 50%; background: #e9f5ef; color: var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin: 0 auto 16px;
}
.summary {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  background: var(--cream); margin: 16px 0;
}
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }

footer.site {
  max-width: 640px; margin: 26px auto 0; text-align: center;
  font-size: .78rem; color: var(--muted); line-height: 1.7;
}

/* sistems portal */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0 28px; }
.sys { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.sys-head { display: flex; align-items: center; justify-content: space-between; }
.sys h3 { margin: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px #e9f5ef; }
.dot.off { background: var(--err); box-shadow: 0 0 0 4px #fbecec; }

/* admin */
.admin { max-width: 1120px; margin: 0 auto; padding: 22px 16px 60px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.admin-head .brand { align-items: flex-start; margin: 0; }
.admin-head .brand-mark { font-size: 1.1rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab {
  padding: 10px 14px; border: 0; background: none; font: inherit; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.on { color: var(--rose-dark); border-bottom-color: var(--rose); font-weight: 600; }
.panel { display: none; }
.panel.on { display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat b { display: block; font-size: 1.5rem; font-family: Georgia, serif; font-weight: 500; }
.stat small { color: var(--muted); }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: .88rem; vertical-align: top; }
.table th { background: var(--cream); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; }
.table .actions button { margin-right: 4px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .7rem; background: var(--cream); border: 1px solid var(--line); color: var(--muted); }
.badge.ok { background: #e9f5ef; color: var(--ok); border-color: #c4e5d5; }
.badge.err { background: #fbecec; color: var(--err); border-color: #f0c9c9; }
.badge.pending { background: #fdf4e6; color: #8a5a12; border-color: #f0dcb8; }

.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.admin-card h3 { margin-bottom: 12px; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.inline-form .field { margin: 0; }
.hours-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 640px) { .hours-row { grid-template-columns: 90px 1fr 1fr; } .hours-row .del { grid-column: 3; } }

.login-box { max-width: 380px; margin: 12vh auto; }
.flash { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: .88rem; display: none; }
.flash.on { display: block; }
.flash.err { background: #fbecec; color: var(--err); }
.flash.ok { background: #e9f5ef; color: var(--ok); }

.pw-box { background: #fdf4e6; border: 1px solid #f0dcb8; padding: 12px 14px; border-radius: 10px; margin: 10px 0; }
.pw-box code { font-size: .95rem; user-select: all; }
