:root {
  --bg0: #f4f7fb;
  --bg1: #e8eef6;
  --surface: #ffffff;
  --text: #1b262c;
  --muted: #6b7a88;
  --line: #d8e0ea;
  --mint: #5fd98a;
  --mint-soft: #e8faf0;
  --mint-border: #9eecc0;
  --blue: #4d71e7;
  --blue-soft: #e8eefc;
  --busy-bg: #eef1f5;
  --busy-text: #9aa5b1;
  --busy-border: #d5dbe3;
  --past-bg: #f7f8fa;
  --past-text: #b0b8c1;
  --danger: #d64550;
  --ok: #1f9d5c;
  --shadow: 0 10px 30px rgba(27, 38, 44, 0.06);
  --radius: 16px;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dfeaff 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #d8f7e5 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.app {
  max-width: 440px;
  margin: 0 auto;
  padding: 18px 16px 48px;
  min-height: 100vh;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: 4px 0 20px;
  text-align: center;
  gap: 10px;
}
.logo {
  height: 44px;
  width: auto;
  display: block;
}
.page-title {
  margin: 4px 0 0;
  font-size: 1.28rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
}
.page-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}
.lang-switch {
  align-self: flex-end;
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow);
}
.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  min-width: 44px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}
.lang-btn.active {
  background: var(--blue);
  color: #fff;
}
.badge-mock {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: #fff4d6;
  color: #9a6b00;
  border: 1px solid #f0d48a;
  padding: 4px 8px;
  border-radius: 999px;
}

.top {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.top h1,
.top h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.room {
  margin: 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 6px 10px;
  border-radius: 999px;
}

.status {
  background: #fff5f5;
  border: 1px solid #f0c4c8;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--danger);
  font-weight: 500;
}
.status.ok {
  background: var(--mint-soft);
  border-color: var(--mint-border);
  color: var(--ok);
}

.daybar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
}
.daylabel {
  flex: 1;
  text-align: center;
}
.daylabel strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}
.daylabel span {
  font-size: 0.82rem;
  color: var(--muted);
}

.timeline-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 16px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
}
.legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.legend .lg i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid transparent;
}
.legend .lg.available i {
  background: var(--mint-soft);
  border-color: var(--mint-border);
}
.legend .lg.busy i {
  background: var(--busy-bg);
  border-color: var(--busy-border);
}
.legend .lg.selected i {
  background: var(--blue);
  border-color: var(--blue);
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 48vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  scroll-behavior: smooth;
}

.hour-block {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: start;
}
.hour-label {
  padding-top: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.slot-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.slot {
  appearance: none;
  border: 1.5px solid transparent;
  border-radius: 12px;
  min-height: 48px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.slot .time {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.slot .tag {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.9;
}

.slot.available {
  background: var(--mint-soft);
  border-color: var(--mint-border);
  color: #1a7a45;
  cursor: pointer;
}
.slot.available:active {
  transform: scale(0.97);
}
.slot.busy {
  background: var(--busy-bg);
  border-color: var(--busy-border);
  color: var(--busy-text);
  pointer-events: none;
  position: relative;
}
.slot.busy .time {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.slot.past {
  background: var(--past-bg);
  border-color: #e8ecf1;
  color: var(--past-text);
  pointer-events: none;
}
.slot.selected {
  background: var(--blue);
  border-color: #3b5fd0;
  color: #fff;
  box-shadow: 0 6px 16px rgba(77, 113, 231, 0.35);
  pointer-events: auto;
  cursor: pointer;
}
.slot.selected .tag {
  color: rgba(255, 255, 255, 0.9);
}

.selection-card {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  border: 1px solid #c9d6f8;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.selection-card .sel-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.selection-card .sel-value {
  font-size: 1rem;
  color: var(--blue);
  font-weight: 700;
}
.selection-card.empty .sel-value {
  color: var(--muted);
  font-weight: 500;
}

.form-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.form-title {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
}
.form-wrap label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.form-wrap label.required > span {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.form-wrap label.required > span::before {
  content: "* ";
  color: var(--blue);
  font-weight: 700;
}
.form-wrap input,
.form-wrap textarea {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 13px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fbfcfe;
  color: var(--text);
  outline: none;
}
.form-wrap input {
  min-height: 48px;
}
.form-wrap textarea {
  resize: vertical;
  min-height: 72px;
}
.form-wrap input::placeholder,
.form-wrap textarea::placeholder { color: #aab4bf; }
.form-wrap input:focus,
.form-wrap textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(77, 113, 231, 0.15);
}
.form-wrap input.invalid,
.form-wrap textarea.invalid {
  border-color: var(--danger);
  background: #fff8f8;
  box-shadow: 0 0 0 3px rgba(214, 69, 80, 0.15);
}
.form-wrap input.invalid:focus,
.form-wrap textarea.invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(214, 69, 80, 0.22);
}

.otp-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 14px;
}
.otp-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.otp-wrap label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.otp-wrap input {
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fbfcfe;
  color: var(--text);
  outline: none;
  min-height: 56px;
}
.otp-wrap input.invalid {
  border-color: var(--danger);
  background: #fff8f8;
}
.otp-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77, 113, 231, 0.15);
}
.btn.ghost.full {
  width: 100%;
  background: #f1f4f8;
  color: var(--text);
  margin-top: 4px;
}

.picked-slot {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  border: 1px solid #c9d6f8;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.95rem;
}

#stepSchedule .btn.primary {
  margin-top: 12px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 36, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.modal-overlay[hidden] { display: none !important; }
.modal-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 22px 18px 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.modal-card input[type="text"] {
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fbfcfe;
  color: var(--text);
  outline: none;
  min-height: 56px;
}
.modal-card input.invalid {
  border-color: var(--danger);
  background: #fff8f8;
}
.modal-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77, 113, 231, 0.15);
}
.otp-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--mint-soft);
  color: var(--ok);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
}
.form-msg {
  margin: 0;
  font-size: 0.9rem;
  min-height: 1.2em;
  font-weight: 500;
}
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none !important;
}
.btn.nav {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1.5rem;
  line-height: 1;
}
.btn.nav:disabled {
  background: #f1f4f8;
  color: #b8c0ca;
}
.btn.ghost {
  background: #f1f4f8;
  color: var(--text);
}
.btn.primary {
  background: linear-gradient(180deg, #5b7eef, var(--blue));
  color: #fff;
  padding: 16px;
  font-size: 1.02rem;
  margin-top: 4px;
  box-shadow: 0 8px 18px rgba(77, 113, 231, 0.28);
  width: 100%;
}
.btn.primary:active:not(:disabled) {
  transform: translateY(1px);
}

/* QR kapı ekranı */
.gate {
  margin-top: 8px;
}
.gate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px 24px;
  text-align: center;
}
.gate-icon {
  color: var(--blue);
  margin: 0 auto 14px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  border-radius: 18px;
}
.gate-card h1,
.gate-card h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.gate-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}
.gate-hint {
  margin: 14px 0 0 !important;
  font-size: 0.8rem !important;
  color: var(--muted);
}

/* Kamera tarayıcı overlay */
.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 36, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.scanner-overlay[hidden] { display: none !important; }
.scanner-panel {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px 20px 16px 16px;
  padding: 14px 14px 18px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
}
.scanner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.scanner-head strong {
  font-size: 1rem;
}
#qrReader {
  width: 100%;
  min-height: 280px;
  overflow: hidden;
  border-radius: 14px;
  background: #111;
  position: relative;
}
#qrReader video {
  border-radius: 14px !important;
  width: 100% !important;
  max-width: 100% !important;
  object-fit: cover !important;
  display: block;
}.scanner-msg {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.scanner-msg.err { color: var(--danger); font-weight: 600; }

.slot-row {
  gap: 8px;
}
