﻿/* =========================================================
   XCore Online Check-In — WEB (mobil öncelikli)
   Kiosk ile aynı görsel dil: lacivert + altın, açık gri zemin, beyaz kart
   ========================================================= */

:root {
    --navy: #111827;
    --navy-2: #020617;
    --gold: #bfa46f;
    --gold-dark: #8a6d3b;          /* küçük metinde okunabilir altın */
    --gold-soft: rgba(191, 164, 111, .14);
    --gold-ring: rgba(191, 164, 111, .32);
    --bg1: #eef0f3;
    --bg2: #e3e6eb;
    --card: #ffffff;
    --text: #111827;
    --text-2: #374151;
    --muted: #6b7280;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --surface: #f9fafb;
    --danger: #ef4444;
    --danger-text: #b91c1c;
    --danger-soft: #fef2f2;
    --danger-border: #fecaca;
    --success: #22c55e;
    --success-soft: #ecfdf3;
    --warn-text: #92400e;
    --warn-soft: #fffbeb;
    --warn-border: #fde68a;
    --radius-card: 20px;
    --radius-ctl: 12px;
    --shadow-card: 0 1px 2px rgba(17, 24, 39, .04), 0 12px 32px rgba(17, 24, 39, .07);
    --font: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    --gutter: 16px;
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 16px;
    scroll-padding-bottom: 96px;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg1);
    background-image:
        radial-gradient(1100px 420px at 50% -120px, rgba(191, 164, 111, .16), transparent 70%),
        linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; }

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

/* ---------- Üst bar ---------- */
.topbar {
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top);
}

.topbar-inner {
    max-width: 792px;            /* kart sütunu (760) + kenar boşlukları ile hizalı */
    height: 60px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.brand { min-width: 0; display: flex; align-items: center; }

.brand-logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: min(200px, 52vw);
    object-fit: contain;
}

.brand-name {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dil seçici (açılır menü) */
.lang { position: relative; flex: none; }

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.lang-btn:hover { border-color: var(--gold); }
.lang-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--gold-ring); }

.lang-btn img, .lang-menu img {
    width: 22px;
    height: 16px;
    flex: none;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, .1);
}

.lang-btn .chev { color: var(--muted); transition: transform .15s; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 184px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(17, 24, 39, .16);
    z-index: 30;
    animation: pop .14s ease both;
}

.lang-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    background: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.lang-menu button:hover, .lang-menu button:focus-visible { background: #f3f4f6; outline: none; }
.lang-menu button[aria-selected="true"] { background: var(--gold-soft); font-weight: 600; }
.lang-menu button[aria-selected="true"]::after {
    content: "";
    margin-left: auto;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--gold);
}

@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Sayfa gövdesi ---------- */
.app {
    flex: 1 0 auto;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding-top: 18px;
    padding-bottom: 24px;
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.flow { max-width: 760px; margin: 0 auto; }
.flow.narrow { max-width: 480px; }

/* ---------- Adım göstergesi ---------- */
.stepper-wrap { margin: 2px 0 16px; }

.stepper {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    max-width: 560px;
}

.stp {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stp + .stp::before {
    content: "";
    position: absolute;
    top: 15px;
    left: calc(-50% + 22px);
    right: calc(50% + 22px);
    height: 2px;
    border-radius: 2px;
    background: var(--border-strong);
    transition: background .2s;
}

.stp.done::before, .stp.active::before { background: var(--gold); }

.stp-dot {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    border: 2px solid var(--border-strong);
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.stp-ok { display: none; width: 16px; height: 16px; }
.stp.active .stp-dot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 5px var(--gold-soft); }
.stp.done .stp-dot { background: var(--gold); border-color: var(--gold); color: #fff; }
.stp.done .stp-num { display: none; }
.stp.done .stp-ok { display: block; }

.stp-label {
    display: none;
    padding: 0 4px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: var(--muted);
}

.stp.active .stp-label { color: var(--text); }
.stp.done .stp-label { color: var(--gold-dark); }

.stepper-caption {
    margin: 10px 0 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--muted);
}

/* ---------- Kart ---------- */
.card {
    background: var(--card);
    border: 1px solid rgba(229, 231, 235, .8);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px 20px;
    animation: enter .24s ease both;
}

.card:focus { outline: none; }

@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--gold-dark);
    overflow-wrap: anywhere;
}

h1 {
    margin: 0 0 6px;
    font-size: 23px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--text);
}

h1:focus { outline: none; }

.subtitle {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.hero-icon {
    width: 52px;
    height: 52px;
    margin: 0 0 16px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--gold-soft);
    color: var(--gold-dark);
}

.hero-icon svg { width: 28px; height: 28px; }
.hero-icon.danger { background: var(--danger-soft); color: var(--danger-text); }

/* ---------- Form ---------- */
.form { margin: 0; }

.field {
    min-width: 0;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
}

.label {
    display: block;
    margin: 0 0 6px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
}

.req { color: var(--danger); margin-left: 3px; }

.input {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 14px;
    font-size: 17px;             /* ≥16px: iOS odakta yakınlaştırmasın */
    line-height: 1.2;
    color: var(--text);
    background-color: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-ctl);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s, box-shadow .15s;
}

.input::placeholder { color: #9ca3af; opacity: 1; }
.input:hover { border-color: #9ca3af; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-ring); }

.input-lg {
    height: 58px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: .08em;
    font-variant-numeric: tabular-nums;
}

.input-lg::placeholder { font-weight: 400; letter-spacing: .08em; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.input.upper { text-transform: uppercase; }
.input[data-prefilled="1"] { color: var(--muted); letter-spacing: .14em; }   /* kayıtlı (maskeli) kimlik no */
.input.upper::placeholder { text-transform: none; }

select.input {
    padding: 0 24px 0 10px;
    font-size: 16px;
    cursor: pointer;
    text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

select.input:invalid, select.input.empty { color: #6b7280; }

.field.invalid .input { border-color: var(--danger); }
.field.invalid .input:focus { box-shadow: 0 0 0 4px rgba(239, 68, 68, .16); }

.hint {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--muted);
}

.field-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 7px 0 0;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--danger-text);
}

.field-error::before {
    content: "!";
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 16px; }

.dob {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1.1fr);
    gap: 8px;
}

/* T.C. / Pasaport seçici */
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.seg { position: relative; display: block; cursor: pointer; }

.seg input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.seg span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: #4b5563;
    transition: background .15s, color .15s, box-shadow .15s;
}

.seg svg { width: 20px; height: 20px; flex: none; }
.seg input:checked + span { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(17, 24, 39, .08), 0 3px 10px rgba(17, 24, 39, .07); }
.seg input:checked + span svg { color: var(--gold-dark); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--gold-ring); }

/* ---------- Butonlar ---------- */
.actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 10px;
    margin-top: 24px;
}

.actions.single { grid-template-columns: minmax(0, 1fr); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .01em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform .12s, box-shadow .15s, filter .15s, border-color .15s, opacity .15s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: #fff;
    box-shadow: 0 8px 22px rgba(2, 6, 23, .22), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.btn-primary:hover { filter: brightness(1.15); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--gold); }

.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--gold-ring); }
.btn:disabled { cursor: default; }
.btn:disabled:not(.loading) { opacity: .5; }
.btn.loading { filter: none; }

.spinner {
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: spin .8s linear infinite;
}

.btn-secondary .spinner { border-color: rgba(17, 24, 39, .18); border-top-color: var(--navy); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Uyarılar ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14.5px;
    line-height: 1.45;
    background: var(--surface);
    color: var(--text-2);
}

.alert::before {
    content: "!";
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    background: var(--muted);
    color: #fff;
}

.alert.error { background: var(--danger-soft); border-color: var(--danger-border); color: #991b1b; }
.alert.error::before { background: var(--danger); }
.alert.warning { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn-text); }
.alert.warning::before { background: #d97706; }

.note {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid rgba(191, 164, 111, .4);
    border-radius: 12px;
    background: var(--gold-soft);
    color: #5b4826;
    font-size: 14px;
    line-height: 1.5;
}

/* ---------- Misafir sayacı ---------- */
.guest-progress {
    margin: 0 0 20px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.gp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gp-count { font-size: 15px; font-weight: 700; color: var(--text); }

.chip {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eceff3;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.chip-child { background: var(--gold-soft); color: var(--gold-dark); }

.gp-bar { display: flex; gap: 6px; margin-top: 12px; }
.gp-bar span { flex: 1; height: 4px; border-radius: 4px; background: var(--border-strong); transition: background .2s; }
.gp-bar span.done { background: var(--gold); }
.gp-bar span.active { background: var(--navy); }

/* ---------- Özet ---------- */
.rez-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 16px;
}

.rez-meta div {
    min-width: 0;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.rez-meta dt {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.rez-meta dd {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.summary { margin: 0 0 20px; }

/* Mobil: her misafir bir kart */
.summary-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.summary-table thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.summary-table, .summary-table tbody, .summary-table tr, .summary-table td { display: block; }

.summary-table tr {
    position: relative;
    margin: 0 0 10px;
    padding: 14px 16px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.summary-table tr.is-incomplete { border-color: var(--warn-border); background: var(--warn-soft); }

.summary-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #f1f2f4;
}

.summary-table td::before {
    content: attr(data-label);
    flex: none;
    max-width: 48%;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.summary-table td .val { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.summary-table td.c-idx { display: none; }

.summary-table td.c-name {
    display: block;
    padding: 0 96px 10px 0;
    border-top: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.summary-table td.c-name::before, .summary-table td.c-edit::before { display: none; }

.summary-table td.c-edit {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
    border: 0;
}

.nm { overflow-wrap: anywhere; }

.badge-warn {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: var(--warn-text);
    font-size: 11.5px;
    font-weight: 700;
    vertical-align: middle;
}

.id-type {
    display: none;
    margin-right: 6px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #f3f4f6;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    vertical-align: 1px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.link-btn:hover { border-color: var(--gold); color: var(--gold-dark); }
.link-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--gold-ring); }
.link-btn svg { width: 14px; height: 14px; }

/* KVKK onayları */
.consents { display: grid; gap: 10px; }

.check {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-2);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.check:hover { border-color: var(--gold); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }

.check-box {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 0;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1.5px solid #9ca3af;
    border-radius: 6px;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.check-box::after {
    content: "";
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: translate(0, -1px) rotate(45deg);
    opacity: 0;
}

.check input:checked ~ .check-box { background: var(--gold); border-color: var(--gold); }
.check input:checked ~ .check-box::after { opacity: 1; }
.check input:focus-visible ~ .check-box { box-shadow: 0 0 0 4px var(--gold-ring); }
.check:has(input:checked) { border-color: rgba(191, 164, 111, .6); background: #fffdf8; }
.consents.invalid .check.required:not(:has(input:checked)) { border-color: var(--danger-border); background: var(--danger-soft); }
.optional-tag { display: inline-block; margin-left: 2px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.check.optional { border-style: dashed; }
.consents .field-error { margin-top: 0; }

/* KVKK "Aydınlatma Metni" bağlantısı */
.legal-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--gold-dark);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.legal-link:hover { color: var(--navy); }
.legal-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- Pencere (telefonda tam ekran, masaüstünde ortada) ---------- */
html.modal-open, html.modal-open body { overflow: hidden; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .55);
    animation: fade .2s ease both;
}

.modal-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    background: #fff;
    padding-top: env(safe-area-inset-top);
    outline: none;
    animation: sheet .24s ease both;
}

.modal-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
    border-bottom: 1px solid var(--border);
}

.modal-head h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 700; color: var(--text); }

.modal-x {
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-2);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-x:hover { border-color: var(--gold); }
.modal-x:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--gold-ring); }

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 18px max(20px, env(safe-area-inset-right)) 22px max(20px, env(safe-area-inset-left));
}

.modal-body:focus { outline: none; }
.modal-body:focus-visible { box-shadow: inset 0 0 0 3px var(--gold-ring); }

.modal-foot {
    flex: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 10px;
    padding: 12px max(20px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: #fff;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (min-width: 640px) {
    .modal { align-items: center; padding: 32px; }
    .modal-dialog {
        width: min(720px, 100%);
        height: auto;
        max-height: min(86vh, 860px);
        padding-top: 0;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 30px 80px rgba(2, 6, 23, .35);
    }
    .modal-head { padding: 18px 24px; }
    .modal-head h2 { font-size: 20px; }
    .modal-body { padding: 22px 28px 26px; }
    .modal-foot { padding: 14px 24px; }
}

/* Metin içeriği (panelden gelen, temizlenmiş HTML) */
.legal-content { font-size: 15.5px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.legal-content > :first-child { margin-top: 0; }
.legal-content > :last-child { margin-bottom: 0; }
.legal-content h1, .legal-content h2, .legal-content h3,
.legal-content h4, .legal-content h5, .legal-content h6 { margin: 1.3em 0 .5em; line-height: 1.3; color: var(--text); font-weight: 700; }
.legal-content h1 { font-size: 21px; }
.legal-content h2 { font-size: 19px; }
.legal-content h3 { font-size: 17px; }
.legal-content h4, .legal-content h5, .legal-content h6 { font-size: 15.5px; }
.legal-content p { margin: 0 0 .9em; }
.legal-content ul, .legal-content ol { margin: 0 0 1em; padding-left: 1.4em; }
.legal-content li { margin: .3em 0; }
.legal-content a { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 2px; }
.legal-content blockquote { margin: 0 0 1em; padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 0 8px 8px 0; }
.legal-content hr { margin: 1.3em 0; border: 0; border-top: 1px solid var(--border); }
.legal-content table { display: block; max-width: 100%; overflow-x: auto; margin: 0 0 1em; border-collapse: collapse; font-size: 14px; }
.legal-content th, .legal-content td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.legal-content th { background: var(--surface); color: var(--text); font-weight: 600; }

.legal-state { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); }
.legal-state .spinner { border-color: rgba(17, 24, 39, .15); border-top-color: var(--navy); }

/* ---------- Tamamlandı ---------- */
.done-card { text-align: center; padding-top: 32px; }

.done-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--success-soft);
    color: var(--success);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, .07);
}

.done-icon svg { width: 46px; height: 46px; }
.done-card .subtitle { max-width: 440px; margin-left: auto; margin-right: auto; }

.done-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 420px;
    margin: 0 auto 20px;
    text-align: left;
}

.done-box div { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.done-box dt { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.done-box dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.done-info { max-width: 460px; margin: 0 auto 8px; font-size: 15px; color: var(--text-2); }
.done-wish { margin: 0 0 4px; font-weight: 600; color: var(--gold-dark); }
.done-card .actions { max-width: 420px; margin-left: auto; margin-right: auto; }

/* ---------- Alt bilgi ---------- */
.foot {
    flex: none;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px;
    letter-spacing: .04em;
    color: #9ca3af;
}

.foot strong { color: var(--muted); font-weight: 700; }

/* ---------- Toastr (2.1.4) uyumu ---------- */
#toast-container.toast-top-center { top: calc(12px + env(safe-area-inset-top)); }
#toast-container.toast-top-center > div { width: min(360px, calc(100vw - 32px)); }
#toast-container > div {
    padding: 14px 16px 14px 46px;
    border-radius: 12px;
    background-position: 16px center;
    box-shadow: 0 14px 34px rgba(17, 24, 39, .22);
    opacity: .97;
    font-family: var(--font);
    font-size: 14.5px;
}
#toast-container > div:hover { box-shadow: 0 14px 34px rgba(17, 24, 39, .28); opacity: 1; }
#toast-container > .toast-success { background-color: var(--navy); }

/* Çok dar telefonlar: kimlik türü simgeleri gizlenir, metin tek satıra sığar */
@media (max-width: 399px) {
    .seg svg { display: none; }
}

/* ---------- Tablet / masaüstü ---------- */
@media (min-width: 560px) {
    .stp-label { display: block; }
    .stepper-caption { display: none; }
}

@media (min-width: 640px) {
    .topbar-inner { height: 68px; }
    .brand-logo { height: 42px; }
    .app { padding-top: 32px; padding-bottom: 32px; }
    .stepper-wrap { margin-bottom: 22px; }
    .card { padding: 36px 40px; border-radius: 24px; }
    h1 { font-size: 28px; }
    .subtitle { font-size: 16px; margin-bottom: 24px; }
    .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rez-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .done-card { padding-top: 44px; }
}

/* Geniş ekranda özet gerçek tabloya döner */
@media (min-width: 760px) {
    .summary { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
    .summary-table { display: table; table-layout: fixed; }
    .summary-table thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip: auto; }
    .summary-table tbody { display: table-row-group; }
    .summary-table tr { display: table-row; position: static; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
    .summary-table tr.is-incomplete td { background: var(--warn-soft); }
    .summary-table th, .summary-table td { display: table-cell; }
    .summary-table td::before { display: none; }

    .summary-table th {
        padding: 11px 14px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        text-align: left;
        color: var(--muted);
    }

    .summary-table th:nth-child(1) { width: 48px; text-align: center; }
    .summary-table th:nth-child(3) { width: 124px; }
    .summary-table th:nth-child(4) { width: 196px; }
    .summary-table th:nth-child(5) { width: 128px; }

    .summary-table td {
        padding: 14px;
        border-top: 1px solid var(--border);
        vertical-align: middle;
    }

    .summary-table tbody tr:first-child td { border-top: 0; }
    .summary-table td .val { text-align: left; }
    .summary-table td.c-idx { display: table-cell; text-align: center; font-weight: 700; color: var(--muted); }
    .summary-table td.c-name { display: table-cell; padding: 14px; border-top: 1px solid var(--border); font-size: 15px; font-weight: 600; }
    .summary-table td.c-edit { position: static; padding: 10px 14px; border-top: 1px solid var(--border); text-align: right; }
    .summary-table tbody tr:first-child td.c-name, .summary-table tbody tr:first-child td.c-edit { border-top: 0; }
    .summary-table .id-type { display: inline-block; }
}

@media (min-width: 1024px) {
    .app { padding-top: 44px; }
}

/* Hareket azaltma tercihi */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
