@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

:root {
    /* Brand */
    --blue: #4285F4;
    --blue-dark: #0943a3;
    --blue-soft: #e8f0fe;
    --gold: #F6BE00;
    --gold-soft: #fff8e1;
    --danger: #e02424;
    --danger-soft: rgba(224, 36, 36, 0.08);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.12);

    /* Surfaces */
    --bg: #f5f7fb;
    --surface: #ffffff;
    --border: #e3e8f0;
    --border-strong: #d5deeb;

    /* Text */
    --text: #1f2937;
    --muted: #6b7280;

    /* Brand gradient (single source of truth) */
    --grad-brand: linear-gradient(135deg, var(--blue), var(--blue-dark));

    /* Radius scale */
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 16px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 10px 34px rgba(16, 24, 40, 0.14);
    --ring: 0 0 0 3px var(--blue-soft);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    --dur-fast: 0.15s;
    --dur-base: 0.25s;
    --dur-slow: 0.45s;

    /* Safe areas (inert unless viewport-fit=cover) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
    letter-spacing: 0.1px;
}

button {
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

a {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

.goldPlan,
.silverPlan,
.bronzePlan {
    border-radius: var(--radius-pill);
    text-align: center;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.goldPlan {
    background-color: var(--gold);
    color: #5c4700;
}

.silverPlan {
    background-color: silver;
    color: #3d3d3d;
}

.bronzePlan {
    background-color: #cd7f32;
    color: #ffffff;
}

/* Bottom navigation — shared by index, wallet and plans (markup in assets/php/nav.php) */
footer {
    width: 100%;
}

.nav {
    width: 100%;
    padding: 12px 18px calc(12px + var(--safe-bottom)) 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    z-index: 10;
    border-top: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 -1px 0 rgba(16, 24, 40, 0.03), 0 -8px 24px rgba(16, 24, 40, 0.05);
}

.nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    text-decoration: none;
    color: #9aa4b2;
    font-size: calc(20 / 16 * 1rem);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    transition: color var(--dur-base) var(--ease-out),
                background-color var(--dur-base) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.nav a:active {
    transform: scale(0.9);
}

.nav a.active {
    color: var(--blue);
    background-color: var(--blue-soft);
}

/* Central raised star action */
.nav .star-icon {
    min-width: 52px;
    min-height: 52px;
    margin-top: -6px;
    background: var(--gold-soft);
    box-shadow: 0 6px 16px rgba(246, 190, 0, 0.35);
    transition: transform var(--dur-base) var(--ease-spring),
                box-shadow var(--dur-base) var(--ease-out);
}

.nav .star-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(246, 190, 0, 0.45);
}

.nav .star-icon:active {
    transform: scale(0.92);
}

.nav .star-icon.active {
    background: var(--gold-soft);
}

.star-icon i {
    color: var(--gold);
}

/* Logout confirmation popup (markup in assets/php/nav.php) */
.logout-confirm {
    width: 100%;
    height: 100vh;
    padding: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(16, 24, 40, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 30;
    animation: overlayIn var(--dur-base) var(--ease-out);
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.logout-confirm.open {
    display: flex;
}

.logout-confirm__card {
    width: 100%;
    max-width: 340px;
    padding: 28px 24px;
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: confirmIn var(--dur-base) var(--ease-spring);
}

@keyframes confirmIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.logout-confirm__card > i {
    font-size: calc(30 / 16 * 1rem);
    color: var(--blue);
    margin-bottom: 12px;
}

.logout-confirm__card h2 {
    font-size: calc(20 / 16 * 1rem);
    font-weight: 600;
    margin-bottom: 20px;
}

.logout-confirm__actions {
    display: flex;
    gap: 10px;
}

.logout-confirm__actions button,
.logout-confirm__actions a {
    flex: 1;
    padding: 11px;
    border-radius: 10px;
    font-size: calc(16 / 16 * 1rem);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
}

.logout-confirm__actions button {
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text);
    transition: border-color var(--dur-base) var(--ease-out),
                background-color var(--dur-base) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.logout-confirm__actions button:hover {
    border-color: var(--muted);
    background-color: var(--bg);
}

.logout-confirm__actions button:active {
    transform: scale(0.97);
}

.logout-confirm__actions a {
    border: none;
    color: #ffffff;
    background: var(--grad-brand);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.35);
    transition: transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.logout-confirm__actions a:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.45);
}

.logout-confirm__actions a:active {
    transform: scale(0.97);
}
