:root {
    --primary-color: #4de8ff;
    --primary-hover: #1bbbd6;
    --secondary-color: #9fb8c8;
    --success-color: #2ee6a6;
    --danger-color: #ff6b7a;
    --warning-color: #f8d66d;
    --accent-color: #f8d66d;
    --text-primary: #f4fbff;
    --text-secondary: #b9cfdb;
    --bg-primary: #071827;
    --bg-secondary: rgba(7, 24, 39, 0.72);
    --card-bg: rgba(8, 24, 38, 0.78);
    --border-color: rgba(107, 233, 255, 0.28);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.36);
    --radius: 8px;
    --radius-lg: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: #03111f;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
    background-color: #03111f !important;
    background-image:
        linear-gradient(180deg, rgba(2, 10, 20, 0.28), rgba(2, 10, 20, 0.84)),
        radial-gradient(circle at 18% 16%, rgba(77, 232, 255, 0.18), transparent 34%),
        radial-gradient(circle at 78% 26%, rgba(248, 214, 109, 0.12), transparent 30%),
        url("/Guardian_Wallet_Background.png") !important;
    background-position: center top, center top, center top, center top !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-attachment: fixed !important;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(3, 17, 31, 0.56), rgba(3, 17, 31, 0.12), rgba(3, 17, 31, 0.58)),
        linear-gradient(180deg, rgba(3, 17, 31, 0.08), rgba(3, 17, 31, 0.76));
    z-index: -1;
}

a {
    color: var(--primary-color);
}

.dashboard-header,
.card,
.login-container,
.terms-content,
.wallet-card,
.stat-card,
.subscription-card,
.search-controls,
.modal-content,
.marketing-box {
    background: linear-gradient(145deg, rgba(5, 18, 32, 0.84), rgba(7, 31, 46, 0.72)) !important;
    border: 1px solid rgba(107, 233, 255, 0.22) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(18px);
}

.login-container {
    max-width: min(420px, calc(100vw - 32px)) !important;
}

.dashboard-header {
    border-width: 0 0 1px 0 !important;
}

.guardian-logo h1,
.logo,
.login-header h1,
.terms-header h1,
h1,
.modal-header h3 {
    color: var(--text-primary) !important;
    text-shadow: 0 0 24px rgba(77, 232, 255, 0.28);
}

.guardian-logo h1,
.logo,
.modal-header h3,
.stat-value,
.service-price {
    background: linear-gradient(135deg, #6ef4ff, #f8d66d) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.guardian-logo .logo-icon,
.subscription-icon {
    background: linear-gradient(135deg, rgba(77, 232, 255, 0.95), rgba(248, 214, 109, 0.86)) !important;
    color: #03111f !important;
    box-shadow: 0 0 28px rgba(77, 232, 255, 0.34) !important;
}

p,
.terms-section p,
.terms-section li,
.login-header p,
.signup-link,
.back-link,
.wallet-meta,
.subscription-details p,
.subscription-meta,
.stat-label,
.status-label-sm,
.service-meta,
.form-options {
    color: var(--text-secondary) !important;
}

.feature,
.form-section,
.summary-section,
.service-item,
.modal-header,
.modal-footer,
.modal-select,
.modal-input,
.search-input,
.filter-select,
.form-group .input,
.btn-secondary {
    background: rgba(4, 18, 31, 0.74) !important;
    border-color: rgba(107, 233, 255, 0.24) !important;
    color: var(--text-primary) !important;
}

.modal-select,
.modal-input,
.search-input,
.filter-select,
.form-group .input {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.native-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.guardian-select {
    position: relative;
    width: 100%;
}

.search-controls .guardian-select,
.subscriptions-toolbar .guardian-select {
    width: 180px;
    flex: 0 0 180px;
}

.guardian-select-button {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(107, 233, 255, 0.34);
    background:
        linear-gradient(145deg, rgba(4, 18, 31, 0.92), rgba(8, 34, 52, 0.82)),
        rgba(4, 18, 31, 0.74);
    color: var(--text-primary);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.guardian-select-button::after {
    content: "";
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.guardian-select.open .guardian-select-button,
.guardian-select-button:focus-visible {
    outline: none;
    border-color: rgba(77, 232, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(77, 232, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.guardian-select.open .guardian-select-button::after {
    transform: rotate(225deg) translate(-2px, -2px);
}

.guardian-select-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guardian-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1100;
    display: none;
    max-height: min(360px, 48vh);
    overflow-y: auto;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(107, 233, 255, 0.34);
    background:
        linear-gradient(145deg, rgba(4, 18, 31, 0.98), rgba(8, 33, 50, 0.96)),
        rgba(4, 18, 31, 0.98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.guardian-select.open .guardian-select-menu {
    display: block;
}

.guardian-select-group {
    padding: 10px 12px 5px;
    color: var(--accent-color);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guardian-select-option {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 2px 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.guardian-select-option:hover,
.guardian-select-option:focus-visible {
    outline: none;
    border-color: rgba(77, 232, 255, 0.36);
    background: rgba(77, 232, 255, 0.1);
}

.guardian-select-option.is-selected {
    border-color: rgba(77, 232, 255, 0.68);
    background: linear-gradient(135deg, rgba(77, 232, 255, 0.18), rgba(248, 214, 109, 0.09));
}

.guardian-select-option.is-disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.guardian-select-option-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guardian-select-option-meta {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.guardian-select-empty {
    padding: 14px 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.subscriptions-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
}

body::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.guardian-select-menu::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.guardian-select-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.guardian-select-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(77, 232, 255, 0.76), rgba(248, 214, 109, 0.62));
    border-radius: 999px;
    border: 2px solid rgba(4, 18, 31, 0.96);
}

.modal-select::placeholder,
.modal-input::placeholder,
.search-input::placeholder,
.form-group .input::placeholder {
    color: rgba(185, 207, 219, 0.66);
}

.modal-select:focus,
.modal-input:focus,
.search-input:focus,
.filter-select:focus,
.form-group .input:focus {
    border-color: rgba(77, 232, 255, 0.78) !important;
    box-shadow: 0 0 0 3px rgba(77, 232, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.feature {
    min-height: 100%;
}

.feature h3,
.terms-section h2,
.wallet-info h3,
.subscription-details h3,
.question-group label,
.form-group label {
    color: var(--text-primary) !important;
}

.terms-section h2 {
    border-color: rgba(107, 233, 255, 0.22) !important;
}

.wallet-card::before,
.stat-card::before,
.subscription-card::before {
    background: linear-gradient(90deg, #4de8ff, #f8d66d) !important;
}

.wallet-amount,
.stat-value.success,
.status-active {
    color: var(--success-color) !important;
}

.stat-value.warning {
    color: var(--warning-color) !important;
}

.status-paused {
    color: var(--danger-color) !important;
}

.btn,
.add-subscription-btn {
    border-radius: 8px !important;
    letter-spacing: 0.04em;
}

.btn-primary,
.add-subscription-btn {
    background: linear-gradient(135deg, #4de8ff, #148da1) !important;
    color: #03111f !important;
    box-shadow: 0 12px 34px rgba(77, 232, 255, 0.24) !important;
}

.btn-primary:hover,
.add-subscription-btn:hover {
    box-shadow: 0 18px 42px rgba(77, 232, 255, 0.34) !important;
}

.btn-secondary:hover,
.service-item:hover,
.subscription-card:hover {
    border-color: rgba(77, 232, 255, 0.78) !important;
    background: rgba(9, 36, 55, 0.88) !important;
}

.modal-overlay {
    background: rgba(1, 8, 16, 0.74) !important;
    backdrop-filter: blur(8px);
}

.close-btn {
    color: var(--text-secondary) !important;
}

.close-btn:hover,
.eye-btn:hover {
    background: rgba(77, 232, 255, 0.12) !important;
    color: var(--text-primary) !important;
}

.radio-group label {
    background: rgba(4, 18, 31, 0.74) !important;
    border-color: rgba(107, 233, 255, 0.24) !important;
}

.container {
    position: relative;
}

.terms-container,
.login-container,
.card {
    position: relative;
}

.terms-header,
.login-header {
    color: var(--text-primary);
}

.dashboard-banner-header {
    min-height: clamp(120px, 10vw, 190px);
    padding: 0 !important;
    position: sticky !important;
    overflow: hidden;
    background: #03111f !important;
}

.dashboard-banner-home {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.dashboard-banner-home img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.dashboard-banner-header .container {
    min-height: clamp(120px, 10vw, 190px);
    max-width: min(1200px, calc(100vw - 40px)) !important;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.dashboard-banner-header .guardian-logo {
    display: none !important;
}

.dashboard-banner-header .container > div:last-child {
    margin-left: auto;
    pointer-events: auto;
}

.dashboard-banner-header .profile-btn {
    padding: 11px 22px !important;
    font-size: 14px !important;
    text-transform: uppercase;
    background: rgba(3, 17, 31, 0.72) !important;
    backdrop-filter: blur(10px);
}

.subscription-logo-icon {
    overflow: hidden;
    background: rgba(4, 18, 31, 0.82) !important;
}

.subscription-logo-icon img,
.service-logo,
.guardian-select-option-logo {
    display: block;
    object-fit: contain;
}

.subscription-logo-icon img {
    width: 74%;
    height: 74%;
}

.service-logo {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    padding: 3px;
}

.subscription-cost-line + p {
    display: none !important;
}

.tax-note {
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 800;
}

.subscription-actions {
    align-items: center !important;
}

.status-badge {
    min-width: 96px;
    display: grid;
    gap: 3px;
    justify-items: end;
    text-align: right;
}

.status-value {
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
}

.status-value.is-active {
    color: var(--success-color);
}

.status-value.is-paused {
    color: var(--danger-color);
}

.lithic-status {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    width: 58px;
    height: 30px;
    flex: 0 0 58px;
    align-items: center;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 999px;
    background: rgba(255, 107, 122, 0.24);
    border: 1px solid rgba(255, 107, 122, 0.5);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.toggle-slider-inner {
    position: absolute;
    width: 22px;
    height: 22px;
    left: 4px;
    top: 3px;
    border-radius: 50%;
    background: #f4fbff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.26);
    transition: transform 0.2s ease;
}

.toggle-input:checked + .toggle-slider {
    background: rgba(46, 230, 166, 0.28);
    border-color: rgba(46, 230, 166, 0.72);
    box-shadow: 0 0 22px rgba(46, 230, 166, 0.18);
}

.toggle-input:checked + .toggle-slider .toggle-slider-inner {
    transform: translateX(27px);
}

.toggle-input:focus-visible + .toggle-slider {
    outline: 3px solid rgba(77, 232, 255, 0.2);
    outline-offset: 3px;
}

.guardian-select-option-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guardian-select-option-logo {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    padding: 3px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.profile-grid .form-group:first-child {
    grid-column: 1 / -1;
}

.linked-payment-panel {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid rgba(107, 233, 255, 0.24);
    border-radius: 10px;
    background: rgba(4, 18, 31, 0.74);
}

.linked-payment-panel h4 {
    margin: 0 0 12px;
    color: var(--text-primary);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.linked-payment-list {
    display: grid;
    gap: 10px;
}

.linked-payment-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid rgba(107, 233, 255, 0.18);
    border-radius: 8px;
    background: rgba(3, 17, 31, 0.76);
}

.linked-payment-card strong,
.linked-payment-card span,
.linked-payment-card em {
    display: block;
}

.linked-payment-card span,
.linked-payment-empty {
    color: var(--text-secondary);
    font-size: 13px;
}

.linked-payment-card em {
    color: var(--success-color);
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.stripe-status-panel {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(107, 233, 255, 0.22);
    border-radius: 10px;
    background: rgba(4, 18, 31, 0.72);
}

.stripe-status-panel strong {
    display: block;
    color: var(--accent-color);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stripe-status-panel p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.stripe-card-section {
    border: 1px solid rgba(107, 233, 255, 0.18);
    border-radius: 10px;
    background: rgba(2, 14, 24, 0.55);
}

.stripe-card-element {
    min-height: 48px;
    padding: 14px 16px;
    border: 1px solid rgba(107, 233, 255, 0.34);
    border-radius: 10px;
    background: rgba(2, 17, 29, 0.92);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.stripe-card-errors {
    min-height: 18px;
    margin-top: 8px;
    color: #ff7c8d;
    font-size: 13px;
}

.marketing-image-box {
    padding: 0 !important;
    min-height: 0;
    overflow: hidden;
    background: #03111f !important;
}

.marketing-image-box::before {
    display: none !important;
}

.marketing-image-box img {
    display: block;
    width: 100%;
    height: clamp(250px, 24vw, 380px);
    object-fit: cover;
    object-position: center;
}

@media (max-width: 768px) {
    body {
        background-position: center top !important;
        background-attachment: scroll !important;
    }

    .card,
    .login-container,
    .terms-content {
        padding: 28px !important;
    }

    .form-options {
        align-items: flex-start !important;
        flex-wrap: wrap;
        gap: 12px;
    }

    .subscriptions-toolbar {
        width: 100%;
        align-items: stretch !important;
    }

    .subscriptions-toolbar .search-input,
    .subscriptions-toolbar .guardian-select,
    .subscriptions-toolbar .add-subscription-btn {
        width: 100%;
        flex: 1 1 auto;
    }

    .dashboard-banner-header,
    .dashboard-banner-header .container {
        min-height: 118px;
    }

    .dashboard-banner-header .container {
        max-width: calc(100vw - 24px) !important;
    }

    .dashboard-banner-header .profile-btn {
        padding: 9px 14px !important;
        font-size: 12px !important;
    }

    .marketing-image-box img {
        height: 220px;
        object-position: center;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .linked-payment-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .subscription-actions {
        width: 100%;
        justify-content: space-between;
    }
}
