:root {
  --black: #0B0B0D;
  --black-2: #15151a;
  --gold: #B0802F;
  --gold-2: #C6A469;
  --paper: #F4F4F2;
  --ink: #18181B;
  --muted: #6E747C;
  --line: #E7E7E4;
  --line-2: #EFEFEC;
  --ok: #1f7a4d;
  --err: #b00020;
  --radius: 18px;
  --shadow: 0 24px 60px -28px rgba(11, 11, 13, 0.45);
}

* { box-sizing: border-box; }

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

html {
  min-height: 100%;
  background: #EDEEEB;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 12% -8%, #ffffff 0%, rgba(255,255,255,0) 60%),
    linear-gradient(160deg, #ECEDEA 0%, #F6F6F4 45%, #EDEEEB 100%);
  background-color: #EDEEEB;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  gap: 1rem;
}

body[data-step="2"] .shell {
  justify-content: flex-start;
}

.card {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 320px 1fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- Kreisais panelis ---------- */
.side {
  background: linear-gradient(165deg, var(--black) 0%, var(--black-2) 100%);
  color: #fff;
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.side__brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: #fff; }
.mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.side__name { font-weight: 700; letter-spacing: 0.22em; font-size: 1.05rem; }
.side__title { font-size: 1.55rem; margin: 0 0 0.5rem; line-height: 1.2; }
.side__sub { color: #b9bcc2; margin: 0; font-size: 0.95rem; }
.side__meta { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.side__meta li { display: flex; align-items: center; gap: 0.7rem; color: #e7e8ea; font-size: 0.92rem; }
.side__meta .ic { color: var(--gold-2); width: 1.1rem; text-align: center; }
.side__foot { margin: 0; color: #8c9097; font-size: 0.78rem; }
.side__body { flex: 1; }

/* ---------- Labais panelis ---------- */
.panel { padding: clamp(1.4rem, 3vw, 2.2rem); display: flex; flex-direction: column; min-width: 0; }

.steps { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 1.6rem; font-size: 0.8rem; }
.steps__item { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); }
.steps__item b {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: var(--muted); font-size: 0.78rem; font-weight: 700;
  transition: background .2s, color .2s;
}
.steps__item.is-active { color: var(--ink); font-weight: 600; }
.steps__item.is-active b { background: var(--gold); color: #fff; }
.steps__item.is-done b { background: var(--ink); color: #fff; }
.steps__sep { flex: 1; height: 1px; background: var(--line); max-width: 28px; }

.step { display: none; animation: fade .25s ease; }
.step.is-shown { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.step__h { font-size: 1.15rem; margin: 0 0 1rem; }
.muted { color: var(--muted); }

/* ---------- Juristu izvēle ---------- */
.lawyers__label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.6rem; }
.lawyers { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.7rem; }
.lawyer {
  display: flex; align-items: center; gap: 0.7rem;
  border: 1px solid var(--line); background: #fff;
  border-radius: 12px; padding: 0.5rem 0.95rem 0.5rem 0.5rem;
  cursor: pointer; font: inherit; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.lawyer:hover { border-color: var(--gold); }
.lawyer.is-selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 128, 47, 0.15); }
.lawyer--single { cursor: default; }
.lawyer__avatar {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold) 0%, #8f6826 100%);
  color: #fff; font-weight: 700; font-size: 0.9rem;
}
.lawyer__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lawyer__info { display: flex; flex-direction: column; line-height: 1.25; }
.lawyer__info b { font-size: 0.95rem; }
.lawyer__info small { color: var(--muted); font-size: 0.8rem; }

/* ---------- Sloti ---------- */
.slots {
  display: flex; flex-direction: column; gap: 1.3rem;
  height: 52vh; overflow-y: auto; /* fiksēts augstums = nav layout shift, kad sloti ielādējas */
  padding-right: 0.4rem; margin-right: -0.4rem;
}
.slots::-webkit-scrollbar { width: 8px; }
.slots::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.day__label {
  font-weight: 600; font-size: 0.88rem; margin: 0 0 0.6rem;
  text-transform: capitalize; color: var(--ink);
  position: sticky; top: 0; background: #fff; padding: 0.15rem 0; z-index: 1;
}
.day__times { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 0.5rem; }

.slot {
  font: inherit; font-size: 0.92rem;
  border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  padding: 0.55rem 0.4rem; border-radius: 10px;
  cursor: pointer; text-align: center;
  transition: border-color .15s, color .15s, background .15s, transform .05s;
}
.slot:hover { border-color: var(--gold); color: var(--gold); }
.slot:active { transform: translateY(1px); }
.slot.is-selected { background: var(--gold); border-color: var(--gold); color: #fff; }

.slot--taken {
  cursor: not-allowed;
  color: #b6b9be;
  background: var(--line-2);
  border-color: var(--line-2);
  text-decoration: line-through;
}
.slot--taken:hover { border-color: var(--line-2); color: #b6b9be; }

/* Tukšais stāvoklis (visi laiki aizņemti) */
.noslots { text-align: center; padding: 1.5rem 0.5rem; }
.noslots p { margin: 0 0 1rem; }
.mailpill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--black); color: #fff; text-decoration: none;
  padding: 0.65rem 1.1rem; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
  transition: background .15s;
}
.mailpill:hover { background: #25252b; }
.mailpill svg { width: 18px; height: 18px; flex: none; }
.noslots__actions { display: flex; flex-direction: column; align-items: stretch; gap: 0.6rem; width: fit-content; max-width: 100%; margin: 0 auto; }
.noslots__or { color: var(--muted); font-size: 0.95rem; text-align: center; }
.noslots__actions .mailpill, .noslots__actions .btn { justify-content: center; padding: 0.85rem 0.75rem; font-size: 0.85rem; }

/* ---------- Forma ---------- */
.back { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0; font: inherit; margin-bottom: 0.9rem; }
.back:hover { color: var(--gold); }
.chosen {
  display: flex; flex-direction: column; gap: 0.1rem;
  background: #faf7f1; border: 1px solid #efe6d4;
  border-radius: 12px; padding: 0.75rem 0.95rem; margin-bottom: 1.2rem;
}
.chosen__label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); }
.chosen strong { font-size: 1.02rem; text-transform: capitalize; }
.chosen__price { color: var(--muted); font-size: 0.9rem; font-weight: 600; }

form, .payment-step { display: flex; flex-direction: column; gap: 0.95rem; }
form[hidden], .payment-step[hidden], .payment-methods[hidden] { display: none !important; }
.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.86rem; font-weight: 600; }
.field__label { display: inline-flex; align-items: baseline; gap: 0.35rem; flex-wrap: wrap; }
.opt { color: var(--muted); font-size: 0.78rem; font-weight: 400; }
input, textarea, select {
  font: inherit; padding: 0.65rem 0.75rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; cursor: pointer; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,128,47,0.15); }
textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

.btn {
  display: inline-block; text-align: center; text-decoration: none;
  background: var(--gold); color: #fff; border: none;
  padding: 0.8rem 1.3rem; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: #997029; }
.btn:active { transform: translateY(1px); }
.btn--full { width: 100%; margin-top: 0.3rem; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.err { color: var(--err); font-size: 0.88rem; margin: 0; }

.consent { display: flex; flex-direction: row; align-items: flex-start; gap: 0.5rem; font-size: 0.82rem; font-weight: 400; color: var(--muted); }
.consent input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.18rem 0 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--gold);
}
.consent a { color: var(--gold); }

.payment-methods {
  border: 0;
  margin: 0;
  padding: 0;
}
.payment-methods legend {
  padding: 0;
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  font-weight: 600;
}
.payment-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.payment-option {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: center;
  gap: 0;
  min-height: 92px;
  padding: 0.85rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.payment-option:hover {
  border-color: var(--gold);
}
.payment-option.is-selected {
  border-color: var(--gold);
  background: #fffaf2;
  box-shadow: 0 0 0 3px rgba(176, 128, 47, 0.14);
}
.payment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.payment-option__icon {
  width: 98px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
}
.payment-option__icon img {
  display: block;
  max-width: 98px;
  max-height: 52px;
}
.payment-option__icon--empty::before {
  content: "";
  width: 58px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(#fff 0 45%, var(--line-2) 45% 62%, #fff 62%);
}
.payment-option__text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.payment-note { color: var(--muted); font-size: 0.78rem; line-height: 1.45; margin: -0.35rem 0 0; }

.notice { background: #faf7f1; border: 1px solid #efe6d4; border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.9rem; color: var(--ink); margin: 0 0 1.3rem; }

/* ---------- Apstiprinājums ---------- */
.done { text-align: center; padding: 1.5rem 0.5rem; }
.done__check {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(31,122,77,0.12); color: var(--ok); font-size: 2rem;
}
.done__title { margin: 0 0 0.4rem; font-size: 1.4rem; }
.done__when { font-size: 1.05rem; font-weight: 600; text-transform: capitalize; margin: 0 0 0.3rem; }

/* ---------- Kājene ---------- */
.foot { color: var(--muted); font-size: 0.8rem; text-align: center; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--gold); }

/* ---------- Responsīvi ---------- */
@media (max-width: 720px) {
  .card { grid-template-columns: 1fr; }
  .side { flex-direction: column; gap: 1.2rem; padding: 1.5rem; }
  .side__title { font-size: 1.35rem; }
  .slots { height: auto; min-height: 55vh; } /* mobilajā aug pēc satura, bet rezervē vietu */
  .steps { gap: 0.35rem; font-size: 0.74rem; }
  .steps__item { gap: 0.3rem; }
  .steps__item b { width: 20px; height: 20px; font-size: 0.72rem; }
  .steps__sep { max-width: 18px; }
}

@media (max-width: 420px) {
  .payment-options { grid-template-columns: 1fr; }
}
