:root {
    --royal-red: #cc0000;
    --royal-red-dark: #a30000;
    --royal-charcoal: #101828;
    --royal-slate: #475467;
    --royal-surface: #ffffff;
    --royal-background: #f7f8fa;
    --royal-border: #e4e7ec;
}

body {
    background: linear-gradient(180deg, #ffffff 0, var(--royal-background) 360px) !important;
    color: var(--royal-charcoal) !important;
}

.hero,
.member-form-card .card-header,
.payment-card .card-header {
    background: linear-gradient(135deg, #101828, #263241) !important;
    box-shadow: 0 16px 34px rgba(16, 24, 40, .16) !important;
}

.hero {
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: var(--royal-red);
}

.card,
.member-form-card,
.payment-card {
    border-color: var(--royal-border) !important;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .07) !important;
}

.btn-primary,
.member-form-card .btn-primary,
.payment-card .btn-primary {
    border-color: var(--royal-red) !important;
    background: linear-gradient(135deg, var(--royal-red), #e43333) !important;
    box-shadow: 0 7px 16px rgba(204, 0, 0, .2) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.member-form-card .btn-primary:hover,
.member-form-card .btn-primary:focus,
.payment-card .btn-primary:hover,
.payment-card .btn-primary:focus {
    border-color: var(--royal-red-dark) !important;
    background: var(--royal-red-dark) !important;
}

.btn-outline-primary {
    border-color: var(--royal-red) !important;
    color: var(--royal-red) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--royal-red) !important;
    color: #fff !important;
}

.text-primary,
.section-title,
.form-section-title,
.member-page-header .eyebrow,
.payment-page-header .eyebrow {
    color: var(--royal-red) !important;
}

.bg-primary {
    background-color: var(--royal-red) !important;
}

.border-primary {
    border-color: rgba(204, 0, 0, .35) !important;
}

.alert-primary,
.location-helper {
    border-color: #f4c7c7 !important;
    background: #fff5f5 !important;
    color: #6f1111 !important;
}

.location-helper {
    padding: .8rem;
    border-width: 1px;
    border-style: solid;
    border-radius: 12px;
}

.location-helper-title {
    color: var(--royal-charcoal);
    font-size: .82rem;
    font-weight: 600;
}

.location-helper-text {
    color: var(--royal-slate);
    font-size: .78rem;
}

.location-recommendation {
    margin-top: .7rem;
    padding-top: .7rem;
    border-top: 1px solid #f1cece;
}

.location-helper.is-resolved {
    padding: .65rem .8rem;
}

.location-helper.is-resolved .location-helper-title,
.location-helper.is-resolved #find-nearest-location {
    display: none !important;
}

.location-helper.is-resolved .location-helper-text {
    margin-bottom: 0 !important;
}

.selected-location-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: .38rem .65rem;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: #fff;
    color: var(--royal-charcoal);
    font-size: .76rem;
    font-weight: 600;
}

.price-display {
    min-height: 50px !important;
    display: flex !important;
    align-items: center;
    font-size: 1.08rem !important;
    font-weight: 700 !important;
}

.confirmation-dialog {
    width: min(92vw, 480px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .28);
}

.confirmation-dialog::backdrop {
    background: rgba(16, 24, 40, .62);
    backdrop-filter: blur(2px);
}

.confirmation-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--royal-border);
    font-size: .82rem;
}

.form-control:focus,
.form-select:focus,
.member-form-card .form-control:focus,
.member-form-card .form-select:focus {
    border-color: #e43333 !important;
    box-shadow: 0 0 0 .22rem rgba(204, 0, 0, .12) !important;
}

.form-section-title i,
.registration-step.active,
.renewal-step.active,
.payment-step.active {
    background: #fff0f0 !important;
    color: var(--royal-red) !important;
}

.member-summary,
.payment-summary {
    border-color: var(--royal-border) !important;
    background: #fbfbfc !important;
}

.page-footer strong {
    color: var(--royal-charcoal) !important;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.offline-banner {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1100;
    padding: .65rem 1rem;
    background: #7a271a;
    color: #fff;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
}

.offline-banner.is-visible,
.offline-banner.is-restored {
    display: block;
}

.offline-banner.is-restored {
    background: #067647;
}

/* Liquid Glass inspired surfaces, with Royal Parking's brand accent. */
:root {
    --royal-charcoal: #1c1c1e;
    --royal-slate: #54545c;
    --royal-background: #f2f2f7;
    --royal-border: rgba(60, 60, 67, .12);
    --glass-surface: rgba(255, 255, 255, .88);
    --glass-inset: #f5f5fa;
    --glass-field: #f6f6fa;
    --glass-shadow: 0 12px 36px rgba(38, 45, 72, .08), inset 0 1px 0 #fff;
}

html { min-height: 100%; scroll-padding-bottom: 110px; }
body {
    min-height: 100vh;
    padding-bottom: calc(106px + env(safe-area-inset-bottom, 0px)) !important;
    background: radial-gradient(ellipse at 5% 10%, rgba(245, 157, 183, .7) 0, transparent 52%),
                radial-gradient(ellipse at 95% 45%, rgba(139, 175, 242, .75) 0, transparent 55%),
                radial-gradient(ellipse at 15% 95%, rgba(181, 157, 236, .55) 0, transparent 50%),
                linear-gradient(155deg, #f8edf3, #e3ebfa) !important;
    background-attachment: fixed !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

.page-wrap { padding-top: max(1.5rem, env(safe-area-inset-top, 0px)); }
.hero, .member-page-header, .payment-page-header {
    padding: 1.5rem !important;
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 28px !important;
    background: var(--glass-surface) !important;
    color: var(--royal-charcoal) !important;
    box-shadow: var(--glass-shadow) !important;
}
.hero::after { display: none; }
.hero h1, .member-page-header h1, .payment-page-header h1 {
    font-family: inherit !important;
    font-size: clamp(1.6rem, 5vw, 2rem) !important;
    font-weight: 750;
    letter-spacing: -.045em !important;
}
.hero p, .member-page-header p, .payment-page-header p {
    color: var(--royal-slate);
    font-size: .9rem;
    line-height: 1.6;
    opacity: 1;
}
.hero-brand { margin-bottom: 1.3rem; }
.hero-logo { object-fit: contain; object-position: left; }
.hero-brand-fallback { color: var(--royal-red); font-weight: 700; }
.hero > .d-flex > i {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    color: var(--royal-red);
    background: #fce9ed;
}
.card, .member-form-card, .payment-card {
    background: var(--glass-surface) !important;
    border: 1px solid rgba(255, 255, 255, .95) !important;
    border-radius: 26px !important;
    box-shadow: var(--glass-shadow) !important;
}
.card-body { padding: 1.35rem; }
.member-form-card .card-header, .payment-card .card-header {
    background: var(--glass-inset) !important;
    color: var(--royal-charcoal) !important;
    border-bottom: 1px solid var(--royal-border) !important;
    border-radius: 25px 25px 0 0 !important;
    box-shadow: none !important;
    padding: 1.2rem 1.35rem !important;
}
.form-label { color: #3a3a3c; font-size: .85rem; font-weight: 600; }
.form-control, .form-select,
.member-form-card .form-control, .member-form-card .form-select {
    min-height: 50px;
    padding: .75rem 1rem;
    border: 1px solid rgba(60, 60, 67, .15);
    border-radius: 16px;
    background-color: var(--glass-field);
    color: var(--royal-charcoal);
    font-size: 16px;
    box-shadow: inset 0 1px 2px rgba(28, 28, 30, .025);
}
.form-select { padding-right: 2.5rem !important; }
.form-control::placeholder { color: #707079; opacity: 1; }
.form-control:disabled, .form-select:disabled { background-color: #e9e9ef; opacity: .75; }
.btn, .member-form-card .btn, .payment-card .btn {
    min-height: 48px;
    border-radius: 999px;
    padding: .72rem 1.2rem;
    font-size: .9rem;
    font-weight: 600;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary, .member-form-card .btn-primary, .payment-card .btn-primary {
    background: linear-gradient(180deg, #df253b, #bc001d) !important;
    border: 1px solid rgba(170, 0, 20, .2) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px rgba(188, 0, 29, .18) !important;
}
.btn-outline-primary, .btn-outline-secondary { background-color: rgba(255, 255, 255, .8); }
.btn:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 4px;
}
.location-helper, .member-summary, .payment-summary {
    border: 1px solid var(--royal-border) !important;
    border-radius: 20px;
    background: var(--glass-inset) !important;
    color: var(--royal-charcoal) !important;
}
.location-helper { padding: 1rem; }
.location-helper-text, .form-text { line-height: 1.6; }
.registration-steps, .renewal-steps, .payment-steps {
    padding: 5px;
    border-radius: 18px;
    background: #ededf3;
}
.registration-step, .renewal-step, .payment-step { background: transparent; border-radius: 13px; }
.registration-step.active, .renewal-step.active, .payment-step.active {
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(28, 28, 30, .1);
}
.confirmation-dialog { border-radius: 28px; background: #fafafd; }
.confirmation-dialog::backdrop { background: rgba(28, 28, 40, .35); backdrop-filter: blur(8px); }
.alert { border-radius: 18px; }
.selected-location-badge { white-space: normal; overflow-wrap: anywhere; }
.page-footer { line-height: 1.8; }

.glass-tabbar {
    position: fixed;
    z-index: 1030;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: min(440px, calc(100% - 28px));
    padding: 7px;
    border: 1px solid #fff;
    border-radius: 30px;
    background: var(--glass-surface);
    box-shadow: 0 8px 32px rgba(32, 35, 60, .16), inset 0 1px 0 #fff;
}
.glass-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 54px;
    border-radius: 23px;
    color: #54545c;
    text-decoration: none;
    font-size: .68rem;
    font-weight: 600;
}
.glass-tabbar svg { width: 21px; height: 21px; }
.glass-tabbar a:hover { background: #f1f1f7; }
.glass-tabbar a[aria-current="page"] { background: #f9e4e8; color: #b3001b; }
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
    :root {
        --glass-surface: rgba(255, 255, 255, .42);
        --glass-inset: rgba(255, 255, 255, .32);
        --glass-field: rgba(255, 255, 255, .58);
    }
    .hero, .member-page-header, .payment-page-header,
    .card, .member-form-card, .payment-card, .glass-tabbar {
        background: var(--glass-surface) !important;
        -webkit-backdrop-filter: blur(18px) saturate(145%);
        backdrop-filter: blur(18px) saturate(145%);
    }
}
@media (prefers-reduced-transparency: reduce) {
    :root {
        --glass-surface: #fff;
        --glass-inset: #f5f5fa;
        --glass-field: #f6f6fa;
    }
    .hero, .member-page-header, .payment-page-header,
    .card, .member-form-card, .payment-card, .glass-tabbar {
        background: #fff !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}
@media (max-width: 575.98px) {
    .hero, .member-page-header, .payment-page-header { padding: 1.25rem !important; }
    .card-body { padding: 1.15rem; }
}
@media print {
    body { background: #fff !important; padding-bottom: 0 !important; }
    .glass-tabbar { display: none; }
}
.member-page, .payment-page, .payment-page-header { font-family: inherit !important; }

/* App layout: quiet content surfaces, glass reserved for floating controls. */
.card, .member-form-card, .payment-card {
    background: rgba(255, 255, 255, .9) !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.member-home .hero {
    background: transparent !important;
    border: 0;
    box-shadow: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.member-home .hero h1 { font-size: clamp(2rem, 7vw, 2.8rem) !important; }
.member-home .hero > .d-flex > i { display: none; }
.member-home .hero-brand { margin-bottom: 1.6rem; }
.member-home #nopol { font-size: 1.35rem; min-height: 64px; }
.card.wallet-card {
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 100% 0%, #753b58, transparent 65%), linear-gradient(135deg, #22293f, #151927) !important;
    color: #fff;
    border-color: rgba(255, 255, 255, .35) !important;
    box-shadow: 0 18px 36px rgba(25, 30, 51, .2) !important;
}
.wallet-brand { display: flex; justify-content: space-between; gap: 1rem; font-size: .73rem; letter-spacing: .12em; font-weight: 700; margin-bottom: 1.5rem; }
.wallet-brand span { opacity: .7; font-weight: 500; }
.wallet-card .location-context, .wallet-card .result-label { color: #d0d5e3; }
.wallet-card .result-row { border-color: rgba(255, 255, 255, .15); }
.wallet-card .result-value { overflow-wrap: anywhere; }
.wallet-card .wallet-plate { display: block; font-size: clamp(1.7rem, 7vw, 2.5rem); letter-spacing: .08em; }
.wallet-card .text-success { color: #a1efc0 !important; }
.wallet-card .text-warning-emphasis { color: #ffe0a1 !important; }
.wallet-card .status-icon { color: #155a34 !important; }
.wallet-card .status-icon.text-warning-emphasis { color: #694900 !important; }
.wallet-card .btn-primary { background: #fff !important; color: #252538; border-color: #fff !important; }
.sheet-trigger {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; min-height: 54px; padding: .9rem 1rem;
    border: 1px solid var(--royal-border); border-radius: 16px;
    background: #f3f3f8; color: #24242a; text-align: left; font: inherit;
}
.sheet-trigger:disabled { opacity: .6; }
.sheet-trigger:focus-visible, .sheet-option:focus-visible, .sheet-close:focus-visible { outline: 3px solid #0066cc; outline-offset: 3px; }
.sheet-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; clip-path: inset(50%); overflow: hidden; }
.selection-sheet {
    position: fixed; inset: auto 0 0; margin: 0 auto;
    width: min(100%, 600px); max-width: 100%;
    max-height: min(85vh, 800px); max-height: min(85dvh, 800px);
    overflow-y: auto; overscroll-behavior: contain;
    padding: 10px 22px max(24px, env(safe-area-inset-bottom));
    border: 1px solid rgba(255, 255, 255, .85); border-bottom: 0;
    border-radius: 30px 30px 0 0; background: #f5f5fa; color: #24242a;
    box-shadow: 0 -16px 70px rgba(25, 30, 51, .2);
}
.selection-sheet::backdrop { background: rgba(20, 23, 38, .3); }
.selection-sheet[open] { animation: sheet-arrive .22s ease-out; }
.sheet-handle { width: 36px; height: 5px; border-radius: 10px; background: #b1b1bb; margin: 0 auto 20px; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 20px; }
.sheet-header h2 { font-size: 1.35rem; letter-spacing: -.03em; font-weight: 700; margin: 0; }
.sheet-close { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: #e7e7ef; color: #45454d; }
.sheet-options { display: grid; gap: 8px; }
.sheet-option { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; min-height: 56px; padding: 14px 16px; border: 1px solid transparent; border-radius: 16px; background: rgba(255, 255, 255, .8); color: #282832; text-align: left; }
.sheet-option[aria-pressed="true"] { border-color: #bd1933; background: #fff0f2; }
.sheet-option[aria-pressed="true"] span::after { content: ' ✓'; color: #b3001b; }
.sheet-option small, .sheet-count { color: #595966; font-size: .8rem; }
.sheet-option:hover { background: #fff; }
.wizard-legend { font-size: 1.25rem; letter-spacing: -.02em; font-weight: 700; margin-bottom: 1.25rem; }
.wizard-enabled [data-registration-step] > .form-section-title, .wizard-enabled [data-registration-step] > hr { display: none; }
.wizard-enabled [data-registration-step]:not([hidden]) { animation: content-arrive .2s ease-out; }
.member-form-card .registration-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wizard-controls { display: flex; gap: 12px; margin-top: 12px; }
.wizard-controls .btn { flex: 1; }
.wizard-progress { margin-top: 18px; color: #62626c; font-size: .8rem; }
[hidden] { display: none !important; }
.form-status { animation: content-arrive .25s ease-out; }
@keyframes sheet-arrive { from { transform: translateY(40px); opacity: .3; } to { transform: translateY(0); opacity: 1; } }
@keyframes content-arrive { from { transform: translateY(8px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
    .selection-sheet { background: rgba(247, 247, 252, .82); -webkit-backdrop-filter: blur(24px) saturate(145%); backdrop-filter: blur(24px) saturate(145%); }
}
@media (prefers-reduced-transparency: reduce) {
    .selection-sheet, .card, .member-form-card, .payment-card { background-color: #fff !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
