/* ==========================================================================
   The appointment
   --------------------------------------------------------------------------
   A white stage on the warm page: the stepper on top (a step reached is a
   tick you can press to go back), one step at a time, the bar under it
   (sticky under the thumb on a phone), and the ticket beside it that fills
   as the patient chooses — the thing they will read out to the call centre.
   ========================================================================== */
.phead--appt { padding-bottom: clamp(1.4rem, 1rem + 1.5vw, 2.4rem); }
.trust { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; list-style: none; margin: 0.6rem 0 0; padding: 0; color: var(--ink-2); font-size: 0.93rem; }
.trust li { display: inline-flex; align-items: center; gap: 0.55rem; }
.trust .icon { width: 1.05rem; height: 1.05rem; color: var(--teal-700); }

.appt { display: grid; grid-template-columns: minmax(0, 1fr) 22.5rem; gap: clamp(1.5rem, 1rem + 2.5vw, 3rem); align-items: start; }
.stage { --sp: clamp(1.1rem, 0.6rem + 1.8vw, 2.3rem); min-width: 0; padding: var(--sp); border-radius: var(--r-xl); background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line), 0 50px 90px -70px rgba(11, 57, 54, 0.45); }

/* ---- the stepper ---- */
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; margin: 0 0 clamp(1.5rem, 1rem + 1.6vw, 2.4rem); padding: 0; }
.stepper li { position: relative; }
.stepper li + li::before { content: ""; position: absolute; top: 1.15rem; left: calc(-50% + 1.6rem); right: calc(50% + 1.6rem); height: 2px; border-radius: 2px; background: var(--line);
  background-image: linear-gradient(90deg, var(--teal), var(--teal)); background-repeat: no-repeat; background-size: 0% 100%; transition: background-size 700ms var(--e-out); }
.stepper li.is-done::before, .stepper li.is-now::before { background-size: 100% 100%; }
.stepper__b { width: 100%; display: grid; justify-items: center; gap: 0.55rem; color: var(--ink-3); }
.stepper__b:disabled { cursor: default; }
.stepper__n { position: relative; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); box-shadow: inset 0 0 0 1.5px var(--line-2);
  font: 700 0.9rem/1 var(--f-body); transition: background 400ms, color 400ms, box-shadow 400ms, transform 550ms var(--e-out); }
.stepper__n b { transition: opacity 200ms, transform 400ms var(--e-out); }
.stepper__n .icon { position: absolute; width: 1.05rem; height: 1.05rem; stroke-width: 2.6; opacity: 0; transform: scale(0.4) rotate(-20deg); transition: opacity 300ms, transform 500ms var(--e-out); }
.stepper__t { font: 650 0.8rem/1.2 var(--f-body); text-align: center; }
.stepper .is-now .stepper__b { color: var(--ink); }
.stepper .is-now .stepper__n { background: var(--teal-700); color: var(--white); box-shadow: 0 0 0 6px rgba(0, 160, 152, 0.15); transform: scale(1.08); }
.stepper .is-done .stepper__n { background: var(--mint); color: var(--teal-700); box-shadow: inset 0 0 0 1.5px rgba(0, 160, 152, 0.4); }
.stepper .is-done .stepper__n b { opacity: 0; transform: scale(0.5); }
.stepper .is-done .stepper__n .icon { opacity: 1; transform: none; }
.stepper .is-done .stepper__b { color: var(--teal-800); }
.stepper__b:not(:disabled):hover .stepper__n { box-shadow: inset 0 0 0 2px var(--teal); }
.stepper .is-now .stepper__b:hover .stepper__n { box-shadow: 0 0 0 6px rgba(0, 160, 152, 0.2); }
@media (max-width: 640px) { .stepper__t { font-size: 0.68rem; } .stepper__n { width: 2rem; height: 2rem; font-size: 0.8rem; } .stepper li + li::before { top: 1rem; left: calc(-50% + 1.35rem); right: calc(50% + 1.35rem); } }

/* ---- a step ---- */
.steps-view { position: relative; }
.step { animation: none; gap: 1.25rem; }
.step__head { display: grid; gap: 0.55rem; }
.step__k { font: 700 0.72rem/1 var(--f-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal-700); }
.step h2:focus { outline: none; }
.step__sub { margin-top: 0.4rem; font: 650 0.98rem/1.3 var(--f-body); color: var(--ink); }
.appt__find { box-shadow: 0 0 0 1.5px var(--line-2); }
.appt__find:focus-within { box-shadow: 0 0 0 2px var(--teal), 0 18px 40px -26px rgba(11, 57, 54, 0.5); }
.appt__er { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.86rem; line-height: 1.5; color: var(--ink-3); }
.appt__er .icon { width: 1.05rem; height: 1.05rem; color: var(--red); margin-top: 0.15rem; }
.appt__er a { color: var(--red); font-weight: 700; }
.pick__empty { grid-column: 1 / -1; padding: 1.4rem; border-radius: var(--r-md); background: var(--paper); color: var(--ink-2); text-align: center; }
.pick__empty a { color: var(--teal-700); text-decoration: underline; }

/* options: departments, times, "the earliest day" */
.pick--dept { grid-template-columns: repeat(2, minmax(0, 1fr)); }          /* two to a row (Bünyamin 17.10) */
@media (max-width: 560px) { .pick--dept { grid-template-columns: minmax(0, 1fr); } }
.opt { min-height: 4.4rem; }
.opt__t { display: grid; gap: 0.15rem; min-width: 0; }
.opt--dept .opt__t small { display: flex; align-items: center; gap: 0.45rem; }
.opt__faces { display: inline-flex; }
.opt .opt__faces img { width: 1.35rem; height: 1.35rem; border-radius: 50%; object-fit: cover; object-position: top; background: var(--mint-2); box-shadow: 0 0 0 1.5px var(--white); }
.opt .opt__faces img + img { margin-inline-start: -0.4rem; }
.opt--dept b { padding-inline-end: 1.4rem; }
.opt[aria-pressed="true"]::after, .pcard[aria-pressed="true"]::after { animation: pop 450ms var(--e-out); }
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.2); } }
.is-picked { animation: picked 700ms var(--e-out); }
@keyframes picked { from { box-shadow: inset 0 0 0 2px var(--teal-700), 0 0 0 0 rgba(0, 160, 152, 0.45); } to { box-shadow: inset 0 0 0 2px var(--teal-700), 0 0 0 16px rgba(0, 160, 152, 0); } }
.opt .di { transition: background 300ms, color 300ms, transform 500ms var(--e-out); }
.opt[aria-pressed="true"] .di { background: var(--teal-700); color: var(--white); }
.soon { width: 100%; }
.opt--slot .di .icon { width: 1.3rem; height: 1.3rem; }

/* doctors: portrait cards */
.pick--doc { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.8rem; }
.pcard { position: relative; display: grid; gap: 0.75rem; align-content: start; padding: 0.55rem 0.55rem 0.95rem; border-radius: var(--r-lg); background: var(--white); text-align: start;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow 300ms, transform 500ms var(--e-out), background 300ms; }
.pcard:hover { box-shadow: inset 0 0 0 1.5px var(--teal), 0 24px 40px -28px rgba(11, 57, 54, 0.5); transform: translateY(-3px); }
.pcard__pic { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 4.4; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, var(--mint) 0%, var(--mint-2) 100%); color: var(--teal-700); }
.pcard__pic img { position: absolute; inset: auto 0 0; width: 100%; height: 96%; object-fit: cover; object-position: top center; transition: transform 800ms var(--e-out); }
.pcard:hover .pcard__pic img { transform: scale(1.05); }
.pcard__pic .icon { width: 2.4rem; height: 2.4rem; stroke-width: 1.3; }
.pcard__t { display: grid; gap: 0.3rem; padding: 0 0.35rem; }
.pcard__t small { font: 700 0.68rem/1 var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-700); }
.pcard__t b { font: 450 1.06rem/1.25 var(--f-display); font-variation-settings: "opsz" 40; color: var(--ink); }
.pcard--any .pcard__pic { background: var(--paper-2); }
.pcard[aria-pressed="true"] { background: var(--mint); box-shadow: inset 0 0 0 2px var(--teal-700); }
.pcard[aria-pressed="true"]::after { content: ""; position: absolute; top: 0.9rem; right: 0.9rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--teal-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 0.95rem no-repeat;
  box-shadow: 0 0 0 3px var(--white); }

/* the calendar */
.cal { padding: clamp(0.9rem, 0.6rem + 1vw, 1.3rem); border-radius: var(--r-lg); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.cal__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.3rem 1rem; margin-bottom: 1rem; }
.cal__head b { font: 450 1.3rem/1.2 var(--f-display); font-variation-settings: "opsz" 48; }
.cal__head span { font-size: 0.82rem; color: var(--ink-3); }
.cal__week, .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.4rem; }
.cal__week span { padding-bottom: 0.55rem; text-align: center; font: 700 0.7rem/1 var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.cal__d { position: relative; display: grid; place-items: center; align-content: center; gap: 0.12rem; height: 3.3rem; border-radius: 14px; background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line); transition: background 250ms, box-shadow 250ms, color 250ms, transform 450ms var(--e-out); }
.cal__d b { font: 450 1.2rem/1 var(--f-display); font-variant-numeric: lining-nums; }
.cal__d small { font: 700 0.58rem/1 var(--f-body); letter-spacing: 0.04em; color: var(--teal-700); text-transform: uppercase; }
.cal__d.is-we:not(:disabled) { background: #fdfcf9; }
.cal__d:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--teal); transform: translateY(-2px); }
.cal__d:disabled { background: transparent; box-shadow: none; color: var(--ink-3); opacity: 0.4; cursor: default; }
.cal__d.is-today:disabled { opacity: 0.85; box-shadow: inset 0 0 0 1.5px dashed var(--line-2); }
.cal__d[aria-pressed="true"]:not(:disabled) { background: var(--teal-700); color: var(--white); box-shadow: 0 14px 24px -14px rgba(11, 102, 96, 0.9); transform: translateY(-2px); }
.cal__d[aria-pressed="true"]:not(:disabled) small { color: rgba(255, 255, 255, 0.8); }
@media (max-width: 520px) { .cal__week, .cal__grid { gap: 0.25rem; } .cal__d { height: 2.8rem; border-radius: 11px; } .cal__d b { font-size: 1.02rem; } }

/* the form */
.form .field { position: relative; }
.field > .ok { position: absolute; right: 0.95rem; top: 2.45rem; width: 1.15rem; height: 1.15rem; color: var(--ok); stroke-width: 2.6; opacity: 0; transform: scale(0.5); transition: opacity 250ms, transform 450ms var(--e-out); pointer-events: none; }
.field.is-ok > .ok { opacity: 1; transform: none; }
.field.is-ok input { box-shadow: inset 0 0 0 1.5px rgba(47, 138, 91, 0.55); }
.form legend small, .field > span small { font-weight: 500; color: var(--ink-3); }
.ins-state { min-height: 1.2em; font-size: 0.84rem; font-weight: 600; }
.ins-state.is-yes { color: var(--ok); }
.ins-state.is-no { color: #93620a; }
.counter { justify-self: end; font-size: 0.76rem; color: var(--ink-3); }
.check--card { padding: 1rem 1.1rem; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.check--card.is-bad { box-shadow: inset 0 0 0 1.5px var(--red); }

/* ---- the bar under the step ---- */
.appt__bar { display: flex; align-items: center; gap: 1rem; margin-top: 1.8rem; padding-top: 1.3rem; box-shadow: inset 0 1px 0 var(--line); }
.appt__bar[hidden] { display: none; }
.appt__mini { flex: 1; min-width: 0; text-align: center; font-size: 0.86rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt__bar [data-next] { min-width: 10rem; }
.appt__bar .btn .icon { width: 1rem; height: 1rem; }
.btn.is-ready { animation: ready 2.6s var(--e-out) infinite; }
@keyframes ready { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 160, 152, 0); } 50% { box-shadow: 0 0 0 7px rgba(0, 160, 152, 0.16); } }
@media (max-width: 760px) {
  .page-appt .dock { display: none; }
  .page-appt .site-foot { padding-bottom: 2rem; }
  .appt__bar { position: sticky; bottom: 0; z-index: 20; margin: 1.3rem calc(-1 * var(--sp)) calc(-1 * var(--sp)); padding: 0.75rem 0.9rem calc(0.75rem + env(safe-area-inset-bottom));
    border-radius: 0 0 var(--r-xl) var(--r-xl); background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 -1px 0 var(--line), 0 -20px 30px -26px rgba(11, 57, 54, 0.45); }
  .appt__bar .btn { min-height: 2.9rem; padding: 0 1.05rem; }
  .appt__bar [data-back] span { display: none; }
  .appt__bar [data-next] { min-width: 0; }
  .appt__mini { font-size: 0.78rem; text-align: start; }
}

/* ---- the last step ---- */
.done__mark { width: 4.4rem; height: 4.4rem; }
.done__mark svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done__mark circle { stroke: var(--teal); stroke-width: 2.5; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 900ms var(--e-out) 150ms forwards; }
.done__mark path { stroke: var(--teal-700); stroke-width: 3.6; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 650ms var(--e-out) 750ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done .way { animation: rise-in 700ms var(--e-out) both; }
.done .way:nth-child(2) { animation-delay: 90ms; } .done .way:nth-child(3) { animation-delay: 180ms; }
.reqbox { padding: 0; background: none; }
.reqbox summary { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font: 650 0.92rem/1 var(--f-body); color: var(--teal-700); list-style: none; }
.reqbox summary::-webkit-details-marker { display: none; }
.reqbox summary::before { content: "+"; display: grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--mint); font-weight: 700; transition: transform 300ms var(--e-out); }
.reqbox[open] summary::before { transform: rotate(45deg); }
.reqbox pre { margin-top: 0.8rem; padding: 1.1rem 1.2rem; border-radius: var(--r-md); background: var(--paper-2); white-space: pre-wrap; font: 500 0.9rem/1.65 var(--f-body); color: var(--ink-2); }
.done__acts { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- the ticket ---- */
.ticket { position: sticky; top: calc(var(--hdr) + 1.2rem); display: grid; border-radius: var(--r-xl); background: var(--teal-900); color: #e6f2ef; overflow: hidden;
  box-shadow: 0 50px 80px -50px rgba(11, 57, 54, 0.75); }
.ticket__top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.3rem 1.4rem 0.3rem; }
.ticket__k { font: 700 0.7rem/1 var(--f-body); letter-spacing: 0.16em; text-transform: uppercase; color: #8fd6cd; }
.ticket__state { padding: 0.38rem 0.7rem; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font: 650 0.74rem/1 var(--f-body); transition: background 400ms, color 400ms; }
.appt.is-done .ticket__state { background: #2fb36b; color: var(--white); }
.ticket__who { display: flex; gap: 0.95rem; align-items: center; padding: 0.9rem 1.4rem; }
.ticket__pic { width: 3.7rem; height: 3.7rem; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: rgba(255, 255, 255, 0.08); color: #8fd6cd; }
.ticket__pic .icon { width: 1.6rem; height: 1.6rem; }
.ticket__pic.has-img { background: linear-gradient(180deg, #e6f3f0, #cfe9e3); }
.ticket__pic img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ticket__name { min-width: 0; }
.ticket__name b { display: block; font: 450 1.18rem/1.25 var(--f-display); color: var(--white); }
.ticket__name small { display: block; margin-top: 0.15rem; font-size: 0.86rem; color: rgba(230, 242, 239, 0.7); }
.ticket .is-empty { color: rgba(230, 242, 239, 0.66) !important; font-weight: 500; }
.ticket__date { display: flex; gap: 0.95rem; align-items: center; margin: 0.1rem 1.4rem 1.1rem; padding: 0.85rem; border-radius: 16px; background: rgba(255, 255, 255, 0.06); }
.ticket__num { width: 3.7rem; height: 3.7rem; border-radius: 13px; flex: none; display: grid; place-items: center; align-content: center; gap: 0.15rem; background: var(--white); color: var(--teal-900); font: 450 1.4rem/1 var(--f-display); }
.ticket__num b { font: 400 1.65rem/1 var(--f-display); font-variant-numeric: lining-nums; }
.ticket__num small { font: 700 0.62rem/1 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-700); }
.ticket__num .icon { width: 1.5rem; height: 1.5rem; color: var(--teal-700); }
.ticket__date > span:last-child b { display: block; font-weight: 650; color: var(--white); }
.ticket__date > span:last-child small { display: block; margin-top: 0.15rem; font-size: 0.86rem; color: rgba(230, 242, 239, 0.7); }
.ticket__tear { position: relative; height: 1.5rem; background: radial-gradient(circle at 0 50%, var(--paper) 0.72rem, transparent 0.75rem), radial-gradient(circle at 100% 50%, var(--paper) 0.72rem, transparent 0.75rem); }
.ticket__tear::after { content: ""; position: absolute; left: 1.4rem; right: 1.4rem; top: 50%; border-top: 1.5px dashed rgba(230, 242, 239, 0.22); }
.ticket__rows { display: grid; margin: 0; padding: 0.3rem 1.4rem 0.4rem; }
.ticket__rows > div { display: grid; grid-template-columns: 4.3rem minmax(0, 1fr) auto; gap: 0.7rem; align-items: baseline; padding: 0.62rem 0; box-shadow: inset 0 -1px 0 rgba(230, 242, 239, 0.1); }
.ticket__rows dt { font: 700 0.68rem/1.6 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(230, 242, 239, 0.68); }
.ticket__rows dd { margin: 0; font-weight: 600; font-size: 0.92rem; color: var(--white); min-width: 0; overflow-wrap: anywhere; }
.ticket__rows button { font: 650 0.76rem/1 var(--f-body); color: #8fd6cd; text-decoration: underline; text-underline-offset: 3px; }
.ticket__rows button:hover { color: var(--white); }
.ticket__prog { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1.4rem 0.4rem; }
.ticket__prog span { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.ticket__prog i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--teal), #7fd3c8); transform-origin: 0 50%; transform: scaleX(0); transition: transform 700ms var(--e-out); }
.ticket__prog small { font-size: 0.76rem; color: rgba(230, 242, 239, 0.6); white-space: nowrap; }
.ticket__er { display: flex; gap: 0.6rem; padding: 0.9rem 1.4rem 1.4rem; font-size: 0.8rem; line-height: 1.5; color: rgba(230, 242, 239, 0.7); }
.ticket__er .icon { width: 1.05rem; height: 1.05rem; margin-top: 0.12rem; color: #ffb4b2; }
.ticket__er a { color: var(--white); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1060px) { .appt { grid-template-columns: 1fr; } .ticket { position: static; display: none; } .appt.is-done .ticket { display: grid; } }

/* ---- printed: the ticket and the request, nothing else ---- */
@media print {
  .hdr, .site-foot, .dock, .phead, .stepper, .appt__bar, .done__ways, .done__acts, .done__mark, .totop, .toasts, .finder, .sheet, .ticket__rows button, .ticket__prog { display: none !important; }
  body, .section { background: #fff !important; padding: 0 !important; }
  .appt { display: block; }
  .stage { box-shadow: none; padding: 0; }
  .ticket { display: grid !important; position: static; margin-top: 1rem; background: #fff; color: #000; box-shadow: none; border: 1px solid #999; }
  .ticket *, .ticket .is-empty { color: #000 !important; }
}
