/* ==========================================================
   Üye sayfaları: giriş, onay kodu, damga kartı, hesap
   menu.css'teki tema değişkenlerini kullanır.
   ========================================================== */
.member-body { min-height: 100vh; display: flex; flex-direction: column; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.member-top {
    position: sticky; top: 0; z-index: 10;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
    border-bottom: 1px solid var(--line);
}
.member-back {
    justify-self: start; display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 12px 0 8px; border-radius: 12px;
    text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted);
}
.member-back:hover { background: var(--surface-2); color: var(--text); }
.member-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; min-width: 0; }
.member-brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.member-brand img, .member-brand > span {
    width: 30px; height: 30px; border-radius: 9px; object-fit: cover; flex: none;
    display: grid; place-items: center; background: var(--brand); color: var(--brand-contrast); font-weight: 800; font-size: 14px;
}
.member-account {
    justify-self: end; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
    color: var(--muted); text-decoration: none;
}
a.member-account:hover { background: var(--surface-2); color: var(--text); }

.member-main { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 20px 16px 32px; display: grid; gap: 14px; align-content: start; }
.member-footer { text-align: center; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); font-size: 12.5px; }
.member-footer a { color: var(--muted); }

/* Uyarılar (flash) */
.alert { padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 500; }
.alert-success { background: color-mix(in srgb, #16a34a 12%, var(--surface)); color: #15803d; }
.alert-danger { background: color-mix(in srgb, #dc2626 12%, var(--surface)); color: #dc2626; }
.alert-warning, .alert-info { background: color-mix(in srgb, #0284c7 12%, var(--surface)); color: #0369a1; }
[data-theme="dark"] .alert-success { color: #4ade80; }
[data-theme="dark"] .alert-danger { color: #f87171; }
[data-theme="dark"] .alert-info { color: #7dd3fc; }

/* Başlık alanı */
.m-hero { text-align: center; padding: 10px 8px 4px; }
.m-hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.15; }
.m-hero p { margin: 0; color: var(--muted); }
.m-hero a { color: var(--brand-ink); font-weight: 600; }
.m-hero-sm h1 { font-size: 24px; }
.m-hero-icon {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-ink);
}
.m-hero-icon .icon { width: 30px; height: 30px; }

.m-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.m-card h2 { margin: 0 0 12px; font-size: 17px; }
.m-form { display: grid; gap: 14px; }
.m-field { display: grid; gap: 6px; }
.m-field > span:first-child { font-weight: 600; font-size: 14px; }
.m-field small { color: var(--muted); font-weight: 400; }
.m-field input {
    width: 100%; height: 52px; padding: 0 16px; border-radius: 14px;
    border: 1.5px solid var(--line); background: var(--surface-2); color: var(--text);
    font: inherit; font-size: 17px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.m-field input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 16%, transparent); }
.field-error { margin: 0; color: #dc2626; font-size: 13px; font-weight: 500; }
.phone-input { display: flex; align-items: stretch; }
.phone-input .phone-prefix {
    display: grid; place-items: center; padding: 0 12px; flex: none;
    border: 1.5px solid var(--line); border-right: 0; border-radius: 14px 0 0 14px;
    background: var(--surface-2); font-weight: 600; font-size: 15px;
}
.phone-input input { border-radius: 0 14px 14px 0; letter-spacing: .02em; }
.otp-input {
    text-align: center; font-size: 30px !important; height: 64px !important;
    letter-spacing: .5em; font-variant-numeric: tabular-nums; font-weight: 700; padding-left: .5em !important;
}
.m-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.m-note a { color: var(--brand-ink); font-weight: 600; }
.m-check {
    display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
    padding: 13px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; line-height: 1.45;
}
.m-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.m-check a { color: var(--brand-ink); font-weight: 600; }
.m-check small { color: var(--muted); }
.m-check-soft { background: transparent; border: 1px dashed var(--line); }
.m-test-banner {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
    background: color-mix(in srgb, #f59e0b 15%, var(--surface)); color: #b45309; font-size: 14px;
}
.m-test-banner code { font-size: 15px; font-weight: 800; letter-spacing: .1em; background: rgba(255,255,255,.6); padding: 1px 6px; border-radius: 6px; color: #92400e; }
.m-resend { text-align: center; }
.btn-text { background: none; border: 0; color: var(--brand-ink); font-weight: 700; cursor: pointer; padding: 8px; }
.btn-text:disabled { color: var(--muted); cursor: default; }
.btn-danger { background: #dc2626; color: #fff; }
.switch-row small { font-weight: 400; }

/* ---------- Damga kartı ---------- */
.loyalty-card {
    position: relative; overflow: hidden; isolation: isolate;
    border-radius: 28px; padding: 22px; color: var(--brand-contrast);
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in oklab, var(--brand) 55%, #fff), transparent 60%),
        radial-gradient(90% 90% at 100% 100%, color-mix(in oklab, var(--brand) 55%, #000), transparent 65%),
        var(--brand);
    box-shadow: 0 20px 40px -18px color-mix(in oklab, var(--brand) 70%, #000);
}
.loyalty-card::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: radial-gradient(color-mix(in srgb, var(--brand-contrast) 12%, transparent) 1px, transparent 1px);
    background-size: 16px 16px;
    mask-image: linear-gradient(135deg, #000, transparent 70%);
    -webkit-mask-image: linear-gradient(135deg, #000, transparent 70%);
}
.lc-head { display: flex; justify-content: space-between; align-items: flex-start; }
.lc-hello { margin: 0; opacity: .85; font-weight: 600; font-size: 14px; }
.lc-count { margin: 2px 0 0; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.lc-count small { font-size: 20px; opacity: .7; font-weight: 600; }
.lc-badge {
    width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--brand-contrast) 16%, transparent);
}
.lc-badge .icon { width: 24px; height: 24px; }
.stamp-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); gap: 10px; margin: 20px 0 16px; }
.stamp {
    aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
    border: 2px dashed color-mix(in srgb, var(--brand-contrast) 40%, transparent);
    color: transparent; transition: background .3s, border-color .3s, transform .3s;
}
.stamp .icon { width: 50%; height: 50%; stroke-width: 3; }
.stamp.is-filled { background: var(--brand-contrast); border: 2px solid var(--brand-contrast); color: var(--brand); }
.stamp.is-new { animation: stamp-in .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp-in { 0% { transform: scale(.2) rotate(-25deg); } 100% { transform: scale(1) rotate(0); } }
.stamp-reward { border-style: solid; color: color-mix(in srgb, var(--brand-contrast) 55%, transparent); }
.stamp-reward.is-filled { background: #fbbf24; border-color: #fbbf24; color: #78350f; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(251, 191, 36, .25); } }
.lc-status { margin: 0; font-size: 14.5px; line-height: 1.45; }
.loyalty-card.is-ready .lc-status strong { font-size: 16px; }

.qr-card-member { text-align: center; }
.qr-box { position: relative; width: 236px; height: 236px; margin: 4px auto 14px; }
.qr-box-inner { position: absolute; inset: 14px; border-radius: 16px; overflow: hidden; background: #fff; padding: 6px; }
.qr-box-inner svg { width: 100%; height: 100%; display: block; }
.qr-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.qr-ring circle {
    fill: none; stroke: var(--brand); stroke-width: 1.4; stroke-linecap: round;
    stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 100));
}
.qr-ring circle.is-running { animation: ring linear forwards; }
@keyframes ring { from { stroke-dashoffset: calc(100 - var(--p, 100)); } to { stroke-dashoffset: 100; } }

.m-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.m-history li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.m-history li:last-child { border-bottom: 0; }
.m-history li.is-voided { opacity: .45; text-decoration: line-through; }
.mh-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-ink); }
.mh-icon .icon { width: 17px; height: 17px; }
.mh-redeem { background: #fef3c7; color: #b45309; }
.mh-text { flex: 1; display: grid; min-width: 0; }
.mh-text strong { font-size: 14px; }
.mh-text small { color: var(--muted); font-size: 12px; }
.mh-qty { font-weight: 800; font-variant-numeric: tabular-nums; }

.m-links { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.m-links form { margin: 0; }
.m-link {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px;
    background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left;
    font: inherit; font-weight: 600; color: var(--text); text-decoration: none; cursor: pointer;
}
.m-links > :last-child .m-link, .m-links > .m-link:last-child { border-bottom: 0; }
.m-link .icon { color: var(--muted); }
.m-link-arrow { margin-left: auto; width: 16px !important; height: 16px !important; }
.m-danger summary { display: flex; align-items: center; gap: 10px; cursor: pointer; color: #dc2626; font-weight: 700; list-style: none; }
.m-danger summary::-webkit-details-marker { display: none; }
.m-danger[open] summary { margin-bottom: 10px; }
.m-prose { font-size: 14.5px; line-height: 1.65; }
.m-prose h2 { font-size: 17px; }

/* Menüdeki sadakat afişi */
.loyalty-promo {
    display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px;
    border-radius: var(--radius); text-decoration: none; color: var(--text);
    background: var(--brand-soft); border: 1px solid color-mix(in oklab, var(--brand) 18%, transparent);
}
.loyalty-promo strong { display: block; font-size: 15px; }
.loyalty-promo small { color: var(--muted); font-size: 13px; }
.loyalty-promo .icon-arrow { margin-left: auto; color: var(--brand-ink); }
.loyalty-mini { display: inline-flex; gap: 3px; margin-top: 6px; }
.loyalty-mini i { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in oklab, var(--brand) 25%, transparent); }
.loyalty-mini i.on { background: var(--brand); }
.qr-box { width: 220px; height: 220px; }
.qr-box-inner { inset: 0; padding: 10px; border: 1px solid var(--line); }
.qr-timer { width: 220px; height: 4px; margin: 0 auto 14px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.qr-timer span { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: 2px; }
