/* Public My Account — aligned with public reserve tokens */
:root {
    --bg-soft: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --success: #15803d;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --warn: #b54708;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 10px 30px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: inherit; font-weight: 700; line-height: 1.3; color: var(--text); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 64px; }
.page-title { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin: 0 0 20px; color: var(--text); }

.acct-stack { display: flex; flex-direction: column; gap: 20px; }
.acct-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
.acct-row:has(> :only-child) {
    grid-template-columns: 1fr;
}
.grid-full { grid-column: 1 / -1; }
@media (max-width: 820px) {
    .acct-row { grid-template-columns: 1fr; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 0;
    font-size: 15px;
    font-weight: 700;
}
.card-head .head-link {
    font-size: 13px;
    font-weight: 650;
    color: var(--brand);
    text-decoration: none;
}
.card-head .head-link:hover { text-decoration: underline; }
.card-body { padding: 18px 22px 22px; }
.card-body.loading,
.card-body.unavailable { color: var(--muted); font-size: 13px; }
.card-body.unavailable { font-style: italic; }
.card-body.is-busy,
.modal-body.is-busy { opacity: .72; pointer-events: none; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label,
.field .flbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field input, .field select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.field input[readonly] { background: var(--bg-soft); color: var(--text); }
.row { display: flex; gap: 14px; }
.row .field { flex: 1; min-width: 0; }
.input-wrap { position: relative; }
.vicon {
    position: absolute; right: 12px; bottom: 0; height: 44px; display: none;
    align-items: center; font-weight: 800; font-size: 15px; pointer-events: none;
}
.vicon.ok { display: flex; color: var(--success); }
.vicon.err { display: flex; color: var(--danger); }
.input-wrap .iti { width: 100%; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    background: var(--brand);
    transition: background .15s, transform .05s, opacity .15s;
}
a.btn { text-decoration: none; }
/* bootstrap .btn:hover/:focus/:active set color #333, outline, and inset shadow at higher specificity */
.btn:hover, .btn:focus, .btn:active { color: #fff; text-decoration: none; box-shadow: none; outline: none; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:hover:not(:disabled) { background: var(--brand-dark); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn.danger {
    border: 1px solid var(--danger-border);
    background: #fff;
    color: var(--danger);
}
.btn.danger:hover, .btn.danger:focus, .btn.danger:active { color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: var(--danger-bg); }
.btn.ghost,
.btn.btn-outline {
    border: 1px solid var(--brand);
    background: #fff;
    color: var(--brand);
}
.btn.ghost:hover, .btn.ghost:focus, .btn.ghost:active,
.btn.btn-outline:hover, .btn.btn-outline:focus, .btn.btn-outline:active { color: var(--brand); }
.btn.ghost:hover:not(:disabled),
.btn.btn-outline:hover:not(:disabled) { background: #eff6ff; }
.btn:disabled { background: #cbd5e1; color: #fff; border-color: #cbd5e1; cursor: not-allowed; opacity: 1; }
.btn.ghost:disabled,
.btn.btn-outline:disabled,
.btn.danger:disabled {
    background: #fff;
    color: #94a3b8;
    border-color: var(--border);
    opacity: .7;
}
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn .spin {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: acct-spin .7s linear infinite;
    display: none;
}
.btn.btn-outline .spin,
.btn.ghost .spin,
.btn.danger .spin {
    border-color: rgba(37, 99, 235, .25);
    border-top-color: var(--brand);
}
.btn.danger .spin {
    border-color: rgba(220, 38, 38, .25);
    border-top-color: var(--danger);
}
.btn.loading .spin { display: inline-block; }
@keyframes acct-spin { to { transform: rotate(360deg); } }
.acct-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.acct-loading .spin {
    width: 22px; height: 22px; flex: 0 0 22px;
    border: 2px solid #d0d5dd; border-top-color: var(--brand);
    border-radius: 50%; animation: acct-spin .7s linear infinite;
}
.btn-text {
    border: 0;
    background: none;
    padding: 0;
    color: var(--brand);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
}
.btn-text:hover { text-decoration: underline; }
.btn-text.danger { color: var(--danger); }

.status { min-height: 0; margin-top: 6px; font-size: 12px; color: var(--muted); }
.status.err { color: var(--danger); }
.status.ok { color: var(--success); }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tbl code { font-size: 12px; background: #f1f5f9; padding: 1px 5px; border-radius: 5px; }

.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 750;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .03em;
    vertical-align: middle;
}
.badge.ok { background: #ecfdf3; color: var(--success); }
.badge.err { background: #fef2f2; color: var(--danger); }
.badge.warn { background: #fffbeb; color: var(--warn); }
.badge.info { background: #eff6ff; color: #1d4ed8; }

.muted { color: var(--muted); font-size: 13px; }
.subhead { font-size: 13px; font-weight: 700; margin: 0 0 8px; }

.identity {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.identity-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.identity-name { font-size: 16px; font-weight: 750; margin: 0; }
.identity-meta { margin: 0; font-size: 13px; color: var(--muted); }

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}
.stat {
    background: transparent;
    border-radius: 0;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
}
.stat:nth-last-child(-n+2) { border-bottom: 0; }
.stat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.stat-value { display: block; margin-top: 1px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.stat-value.stat-membership { font-size: 15px; font-weight: 750; line-height: 1.25; }

.mem-current { display: flex; flex-direction: column; gap: 8px; }
.mem-current-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mem-name { margin: 0; font-size: 16px; font-weight: 750; }
.mem-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.mem-details { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); white-space: pre-wrap; }
.mem-benefits { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--text); }
.mem-benefits li + li { margin-top: 2px; }

.pay-list { display: flex; flex-direction: column; gap: 8px; }
.saved-card { margin-bottom: 4px; display: flex; flex-direction: column; gap: 8px; }
.saved-card-opt,
.pay-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.saved-card-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.saved-card-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.saved-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 600; }
.saved-card-exp { font-size: 12px; color: var(--muted); }
.saved-card-brand { height: 28px; width: auto; max-width: 46px; object-fit: contain; flex: 0 0 auto; }
.saved-card-brand[hidden] { display: none; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; flex-shrink: 0; }
.pay-summary-actions { justify-content: flex-start; margin-top: 12px; }
.pay-more { margin: 8px 0 0; font-size: 12px; }
.card-brand { max-height: 22px; margin-right: 6px; vertical-align: middle; }
#accountCardElement {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    min-height: 44px;
}
#accountCardElement.StripeElement--focus,
#accountCardElement:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.card-error { color: var(--danger); font-size: 12px; margin-top: 6px; min-height: 14px; }
.card-status { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 14px; }
.add-card-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.add-card-panel .field { margin-bottom: 12px; }
.add-card-panel .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; }

.wallet-list { display: flex; flex-direction: column; gap: 0; }
.wallet-item {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.wallet-item:first-child { padding-top: 2px; }
.wallet-item:last-of-type { border-bottom: 0; padding-bottom: 2px; }
.wallet-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.wallet-name {
    font-weight: 750;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text);
}
.wallet-type { margin-top: 1px; font-size: 12px; color: var(--muted); }
.wallet-code { margin-top: 1px; font-size: 12px; color: #94a3b8; letter-spacing: .04em; }
.wallet-bal { font-size: 16px; font-weight: 800; text-align: right; letter-spacing: -.02em; white-space: nowrap; }
.wallet-item.is-depleted .wallet-bal {
    color: var(--warn);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.wallet-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.attach-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.attach-row .field { flex: 1; min-width: 160px; margin-bottom: 0; }

.benefit-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.benefit-row { display: flex; flex-direction: column; gap: 1px; }
.benefit-name { font-weight: 700; font-size: 14px; }
.benefit-val { color: var(--muted); font-size: 12px; }
.benefit-note { margin: 8px 0 0; font-size: 11px; color: #94a3b8; }

#secSurveys.is-warn { border-color: #f3d2a4; background: #fffdf8; }
#secSurveys.is-ok { border-color: var(--border); }
.waiver-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.waiver-title { margin: 0; font-size: 14px; font-weight: 750; }
.waiver-copy { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.acct-disclosure {
    border-top: 1px solid var(--border);
    padding: 8px 0 0;
}
.acct-disclosure:first-child { border-top: 0; padding-top: 0; }
.acct-disclosure + .acct-disclosure { margin-top: 10px; padding-top: 10px; }
.acct-disclosure > summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    list-style: none;
}
.acct-disclosure > summary::-webkit-details-marker { display: none; }
.acct-disclosure > summary::after {
    content: "▸";
    display: inline-block;
    margin-left: 6px;
    color: var(--muted);
    font-size: 11px;
}
.acct-disclosure[open] > summary::after { content: "▾"; }
.acct-disclosure .card-body { padding: 10px 0 0; }

.hidden { display: none !important; }

.modal-overlay { position: fixed; inset: 0; display: none; align-items: flex-start; justify-content: center; padding: 48px 16px; background: rgba(16,24,40,.55); z-index: 2000; overflow: auto; }
.modal-overlay.open { display: flex; }
.modal-box { width: 100%; max-width: 460px; background: #fff; border-radius: 16px; box-shadow: 0 22px 56px rgba(16,24,40,.28); overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.modal-close { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.mem-title { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.mem-sub { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.pay-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.pay-note.warn { color: var(--warn); }
#reservationModal .modal-box,
#paymentMethodsModal .modal-box { max-width: 680px; }
#paymentMethodsModal .modal-body { max-height: min(70vh, 640px); overflow-y: auto; }
.res-detail-hero {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px;
    padding: 16px 18px; margin-bottom: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    border: 1px solid var(--border); border-radius: 14px;
}
.res-detail-conf-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.res-detail-conf-value { margin-top: 4px; font-size: 20px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.res-detail-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.res-detail-badges .badge { font-size: 11px; padding: 5px 11px; }
.res-detail-hero-cancelled { background: linear-gradient(135deg, #fef3f2 0%, #fff1f0 100%); border-color: #fda29b; }
.res-detail-hero-cancelled .res-detail-conf-value { color: var(--danger); }
.res-detail-when {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.res-when-block .detail-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.res-when-block .detail-value { font-size: 15px; font-weight: 700; line-height: 1.35; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-grid.res-detail-meta { margin-bottom: 4px; }
.detail-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; }
.detail-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.detail-value { margin-top: 4px; font-weight: 700; font-size: 15px; }
.modal-status-row { margin-bottom: 14px; }
.detail-section { margin-top: 18px; }
.section-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.price-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.price-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 14px; font-size: 14px; }
.price-list > div + div { border-top: 1px solid var(--border); }
.price-list > div > span:first-child { color: var(--text); flex: 1; min-width: 0; }
.price-list > div > span:last-child { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-list .price-total { background: #f8fafc; font-weight: 800; }
.payment-panel {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc;
}
.payment-panel .payment-status { font-size: 12px; padding: 6px 12px; text-transform: none; letter-spacing: 0; }
.guest-list { display: flex; flex-direction: column; gap: 8px; }
.guest-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff; }
.guest-name { font-weight: 700; }
.notes-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; font-size: 14px; background: #fff; }
#reservationModal .modal-body { max-height: min(78vh, 720px); overflow-y: auto; }
#reservationModal .modal-actions { border-top: 1px solid var(--border); padding-top: 16px; }
@media (max-width: 640px) {
    .detail-grid, .res-detail-when { grid-template-columns: 1fr; }
    .res-detail-hero { flex-direction: column; }
    .res-detail-badges { justify-content: flex-start; }
    .pay-card-row { flex-direction: column; align-items: flex-start; }
    .pay-actions, .wallet-actions { justify-content: flex-start; }
    .waiver-row { align-items: flex-start; flex-direction: column; }
}

.member-hours-entry { min-height: 36px; margin-bottom: 6px; }
.member-hours-entry:last-child { margin-bottom: 0; }
.member-hours-used-inline { white-space: nowrap; }
.member-hours-toggle { font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; margin-left: 6px; }
.member-hours-toggle:hover { text-decoration: underline; }
.member-hours-view-more { font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; }
.member-hours-view-more:hover { text-decoration: underline; }
.hours-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #f0f9ff; color: #0284c7; }
#modal-view-hours-breakdown .loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    animation: hours-spin 2s linear infinite;
    margin: 16px auto;
}
@keyframes hours-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
