/* GLOBAL RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
    height: 100%;
}

body {
    background: radial-gradient(circle at top, #151520 0, #050509 45%, #020206 100%);
    color: #f5f5f5;
}

/* LAYOUT SHELLS */
.auth-body,
.app-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

/* CONTAINER */
.auth-container,
.app-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

/* BRAND HEADER */
.brand-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 20%, #f5d76e, #d4af37 40%, #5a4615 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #050509;
    box-shadow: 0 0 25px rgba(245, 215, 110, 0.4);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: #c0c0c0;
}

/* AUTH LAYOUT (HYBRID) */
.auth-layout {
    flex: 1;
    display: flex;
    gap: 20px;
    align-items: stretch;
}

/* LEFT HERO (DESKTOP) */
.auth-hero {
    flex: 1.1;
    border-radius: 18px;
    padding: 22px;
    background: linear-gradient(145deg, rgba(10,10,18,0.95), rgba(5,5,9,0.98));
    border: 1px solid rgba(255,215,0,0.08);
    box-shadow: 0 18px 45px rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-main-title {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.hero-tagline {
    font-size: 0.9rem;
    color: #d0d0d0;
    max-width: 320px;
}

.hero-buttons {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

.hero-dashboard-preview {
    margin-top: 24px;
    border-radius: 14px;
    padding: 14px;
    background: radial-gradient(circle at top left, rgba(245,215,110,0.12), rgba(10,10,18,0.95));
    border: 1px solid rgba(255,215,0,0.12);
    font-size: 0.8rem;
}

.hero-dashboard-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

.hero-balance {
    font-size: 1.2rem;
    color: #f5d76e;
}

/* RIGHT AUTH CARD */
.auth-card-wrapper {
    flex: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: rgba(10,10,18,0.98);
    border-radius: 18px;
    padding: 22px 20px 18px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.85);
    border: 1px solid rgba(255,215,0,0.12);
}

.auth-card h2 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.auth-card p {
    font-size: 0.8rem;
    color: #c0c0c0;
    margin-bottom: 14px;
}

/* FORMS */
.auth-form label,
.grid-form label,
.card label {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 4px;
    color: #d0d0d0;
}

.auth-form input,
.grid-form input,
.card input {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #050509;
    color: #f5f5f5;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

/* BUTTONS */
.btn-primary {
    background: linear-gradient(135deg, #d4af37, #f5d76e);
    color: #050509;
    border: none;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

.btn-primary.full {
    width: 100%;
}

.btn-secondary {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #d4af37;
    color: #d4af37;
    text-decoration: none;
    font-size: 0.8rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid #444;
    color: #f5f5f5;
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.8rem;
}

/* ALERTS */
.alert {
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 0.78rem;
}

.alert-error {
    background: rgba(179, 38, 30, 0.15);
    border: 1px solid #b3261e;
    color: #ffb4ab;
}

.alert-success {
    background: rgba(31, 139, 76, 0.15);
    border: 1px solid #1f8b4c;
    color: #b8f5c9;
}

/* GRID FORM (REGISTER) */
.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.grid-form .full {
    grid-column: span 2;
}

/* APP HEADER / MAIN */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.app-header h2 {
    font-size: 1.1rem;
}

.app-main {
    flex: 1;
    padding-bottom: 80px;
}

/* CARDS */
.card {
    background: rgba(10,10,18,0.98);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 14px 35px rgba(0,0,0,0.75);
    border: 1px solid rgba(255,215,0,0.08);
}

.cards-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.card.balance-card {
    flex: 1;
}

.balance-amount {
    font-size: 1.3rem;
    margin-top: 8px;
    color: #f5d76e;
}

.card.action-card {
    flex: 1;
    text-decoration: none;
    color: inherit;
}

/* LISTS */
.list {
    list-style: none;
}

.list-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #222;
    font-size: 0.82rem;
}

.list-item:last-child {
    border-bottom: none;
}

.amount.credit {
    color: #b8f5c9;
}

.amount.debit {
    color: #ffb4ab;
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(5,5,9,0.98);
    border-top: 1px solid #222;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 20;
}

.nav-item {
    color: #888;
    text-decoration: none;
    font-size: 0.75rem;
}

.nav-item.active {
    color: #f5d76e;
}

/* FOOTER */
.site-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.72rem;
    color: #a0a0a0;
    line-height: 1.4;
}

/* DESKTOP TWEAKS */
@media (min-width: 900px) {
    .auth-container {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .auth-layout {
        flex-direction: row;
    }

    .bottom-nav {
        max-width: 1200px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* MOBILE: HERO COLLAPSES, LOGIN CENTERED */
@media (max-width: 899px) {
    .auth-layout {
        flex-direction: column;
    }

    .auth-hero {
        display: none;
    }

    .auth-card-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .auth-card {
        max-width: 100%;
    }
}

/* ⭐ GOLD LOADING ANIMATION */
@keyframes pulseGold {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(212,175,55,0.3); }
    50% { transform: scale(1.15); box-shadow: 0 0 25px rgba(212,175,55,0.6); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(212,175,55,0.3); }
}

/* UNIFIED CINEMATIC LOGIN LAYOUT */
.auth-center-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Brand block */
.auth-brand-block {
    margin-bottom: 18px;
}

.auth-brand-block .brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 20%, #f5d76e, #d4af37 40%, #5a4615 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.6rem;
    color: #050509;
    box-shadow: 0 0 30px rgba(245,215,110,0.45);
    margin: 0 auto 10px;
}

.auth-brand-block .brand-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.auth-brand-block .brand-subtitle {
    font-size: 0.85rem;
    color: #c0c0c0;
}

/* Hero text */
.auth-hero-text {
    margin-bottom: 22px;
    max-width: 360px;
}

.auth-hero-text h1 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: #f5d76e;
}

.auth-hero-text p {
    font-size: 0.85rem;
    color: #d0d0d0;
}

/* Unified login card */
.unified-card {
    width: 100%;
    margin-bottom: 22px;
}

/* Footer */
.auth-footer {
    margin-top: 20px;
    font-size: 0.75rem;
    color: #a0a0a0;
    line-height: 1.4;
    text-align: center;
}

/* ---------------------------------------------------------
   CINEMATIC ENHANCEMENTS FOR LOGIN SCREEN
--------------------------------------------------------- */

/* Background: gold horizon + subtle vignette */
.auth-body {
    background: radial-gradient(circle at center, rgba(245,215,110,0.08), rgba(5,5,9,1) 70%);
    position: relative;
    overflow: hidden;
}

/* Soft gold glow behind the center block */
.auth-center-wrapper::before {
    content: "";
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(245,215,110,0.18), transparent 70%);
    filter: blur(40px);
    z-index: -1;
}

/* Vault shadow behind hero text */
.auth-hero-text::before {
    content: "";
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(0,0,0,0.45), transparent 70%);
    z-index: -1;
    border-radius: 50%;
}

/* Glass-blur login card */
.unified-card {
    background: rgba(10,10,18,0.65);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,215,0,0.12);
    box-shadow: 0 12px 40px rgba(0,0,0,0.65);
}

/* Gold particle drift */
@keyframes goldParticles {
    0% { transform: translateY(0) translateX(0); opacity: 0.15; }
    50% { opacity: 0.35; }
    100% { transform: translateY(-120px) translateX(20px); opacity: 0; }
}

.auth-body::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(245,215,110,0.45);
    top: 80%;
    left: 40%;
    border-radius: 50%;
    animation: goldParticles 6s infinite ease-in-out;
    filter: blur(1px);
}

/* Fade-in animation for entire screen */
.auth-center-wrapper {
    animation: fadeIn 1.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhance brand logo glow */
.auth-brand-block .brand-logo {
    box-shadow: 0 0 40px rgba(245,215,110,0.55);
    animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {
    0% { transform: scale(1); box-shadow: 0 0 30px rgba(245,215,110,0.45); }
    50% { transform: scale(1.05); box-shadow: 0 0 55px rgba(245,215,110,0.75); }
    100% { transform: scale(1); box-shadow: 0 0 30px rgba(245,215,110,0.45); }
}

/* FIX: Allow scrolling on register and long auth pages */
.auth-body:not(.login-page) {
    overflow-y: auto !important;
}

/* GLOBAL GOLD LOADING OVERLAY */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5,5,9,0.95);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
}

/* Gold spinning ring */
.loader-ring {
    width: 70px;
    height: 70px;
    border: 4px solid rgba(245,215,110,0.25);
    border-top-color: #f5d76e;
    border-radius: 50%;
    animation: spinRing 1s linear infinite;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

.loader-text {
    color: #f5d76e;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* ---------------------------------------------------------
   PREMIUM VAULT LOADER
--------------------------------------------------------- */

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5,5,9,0.96);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    animation: fadeInOverlay 0.3s ease-out;
}

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

/* Vault loader container */
.vault-loader {
    position: relative;
    width: 110px;
    height: 110px;
    margin-bottom: 16px;
}

/* Rotating vault ring */
.vault-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(245,215,110,0.25);
    border-top-color: #f5d76e;
    border-radius: 50%;
    animation: vaultSpin 1.4s linear infinite;
}

@keyframes vaultSpin {
    to { transform: rotate(360deg); }
}

/* Pulsing P logo */
.vault-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 800;
    color: #f5d76e;
    text-shadow: 0 0 18px rgba(245,215,110,0.7);
    animation: pulseLogoVault 2s infinite ease-in-out;
}

@keyframes pulseLogoVault {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
}

/* Gold shimmer sweep */
.vault-shimmer {
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(245,215,110,0.35), transparent);
    animation: shimmerSweep 2.2s infinite ease-in-out;
}

@keyframes shimmerSweep {
    0% { left: -150%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

/* Loader text */
.loader-text {
    color: #f5d76e;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

/* ---------------------------------------------------------
   CINEMATIC PAGE TRANSITIONS (GLOBAL)
--------------------------------------------------------- */

.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050509;
    opacity: 0;
    pointer-events: none;
    z-index: 999999;
    transition: opacity 0.5s ease-in-out;
}

.page-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Gold shimmer sweep */
.page-transition-shimmer {
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(245,215,110,0.35), transparent);
    animation: shimmerMove 1.2s ease-in-out forwards;
}

@keyframes shimmerMove {
    0% { left: -150%; }
    100% { left: 150%; }
}
