/* Base dental clinic theme: dark ink on paper, one accent the owner picks.
   Patient themes override the variables in :root, this file, or whole templates. */

:root {
  --paper: #fff;
  --ink: #16181d;
  --muted: #6a6f7a;
  --line: #e6e7eb;
  --wash: #f4f4f1;
  --accent: #1f6f4a; /* buttons and links; company setting */
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gutter: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: var(--accent);
}

h1,
h2,
h3,
p,
ul,
fieldset {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

fieldset {
  min-width: 0; /* browsers give fieldsets min-content width: chips would not wrap */
  padding: 0;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main.wrap {
  padding-top: 20px;
  padding-bottom: 64px;
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

.heading {
  margin-bottom: 16px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.heading--small {
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.block {
  margin-top: 40px;
}

/* --- header and footer ------------------------------------------------------ */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px var(--gutter);
}

.brand {
  margin-right: auto;
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  height: 36px;
  width: auto;
}

.menu {
  display: flex;
  gap: 14px;
  order: 3;
  width: 100%;
}

.menu a,
.langs a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.langs {
  display: flex;
  gap: 8px;
  font-size: 0.875rem;
}

.langs a {
  color: var(--muted);
}

.langs a[aria-current] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.foot {
  padding: 32px 0 48px;
  background: var(--wash);
  color: var(--muted);
  font-size: 0.9375rem;
}

.foot .brand {
  display: block;
  margin-bottom: 8px;
  font-size: 1.125rem;
}

.foot li + li {
  margin-top: 4px;
}

@media (min-width: 760px) {
  .menu {
    order: 0;
    width: auto;
  }
}

/* --- buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: 600 1rem/1 var(--body);
  text-decoration: none;
  cursor: pointer;
}

.btn--big {
  min-height: 52px;
  padding: 0 28px;
  font-size: 1.0625rem;
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
}

/* --- hero ---------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
}

.hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: 0.6;
}

.hero__text {
  padding: 28px 20px;
}

.hero img + .hero__text {
  position: absolute;
  inset: auto 0 0 0;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero p {
  margin: 8px 0 16px;
  opacity: 0.85;
}

.hero .btn {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}

/* --- services ------------------------------------------------------------------- */
.services__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 14px;
  align-items: center;
  min-height: 56px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.services__name {
  font-weight: 600;
}

.services__name small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.875rem;
}

.services__meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.services__price {
  font-weight: 700;
  white-space: nowrap;
}

.services--pick .services__row {
  grid-template-columns: auto 1fr auto auto;
  cursor: pointer;
}

.services--pick input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

/* --- masters ---------------------------------------------------------------- */
.doctors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.doctor {
  display: grid;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
}

.doctor img,
.doctor__initial {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  background: var(--wash);
}

.doctor__initial {
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--muted);
}

.doctor small {
  color: var(--muted);
}

.doctor em,
.person__specialty {
  color: var(--accent);
  font-size: 0.875rem;
  font-style: normal;
}

.person__specialty {
  margin-bottom: 8px;
}

.chip--off,
.services__row--off {
  opacity: 0.45;
}

.chip small {
  margin-left: 4px;
  color: var(--muted);
}

.person {
  display: grid;
  gap: 20px;
}

.person__photo {
  width: 100%;
  max-width: 320px;
  border-radius: 16px;
}

@media (min-width: 700px) {
  .person {
    grid-template-columns: 280px 1fr;
  }
}

/* --- cards, branches, visit -------------------------------------------------------- */
.cards {
  display: grid;
  gap: 16px;
}

@media (min-width: 700px) {
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.card h3 {
  margin-bottom: 6px;
  font-size: 1.125rem;
}

.card p + p {
  margin-top: 6px;
}

.hours {
  margin: 10px 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.hours th {
  padding: 2px 12px 2px 0;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
}

.visit__status {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--wash);
  font-size: 0.875rem;
  font-weight: 600;
}

.visit--confirmed .visit__status {
  background: var(--accent);
  color: #fff;
}

.visit--cancelled .visit__status,
.visit--no_show .visit__status {
  text-decoration: line-through;
}

.visit__when {
  font-size: 1.125rem;
}

.visit__total {
  margin-top: 10px;
  font-weight: 700;
}

.visit__telegram {
  margin-top: 14px;
}

.text p + p {
  margin-top: 12px;
}

/* --- booking form ------------------------------------------------------------------- */
.book {
  display: grid;
  gap: 28px;
  max-width: 640px;
}

.book legend {
  margin-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8125rem;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips--days {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9375rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip:has(input:checked),
.chip--on {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.slot input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slot:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.field span {
  font-size: 0.875rem;
  color: var(--muted);
}

.field input,
.field textarea {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
}

.error {
  padding: 10px 14px;
  border-radius: 10px;
  background: #fbe9e7;
  color: #a32b1d;
}

.cancel {
  margin-top: 12px;
}
