/* Biriko Unified Design System - Neo-Bank Edition */

:root {
    /* Core Palette - Deep Space Blue & Neon */
    --primary: #0A84FF;
    --primary-gradient: linear-gradient(135deg, #0A84FF, #0056D2);
    --accent-gradient: linear-gradient(135deg, #32D74B, #00C957);
    --danger-gradient: linear-gradient(135deg, #FF453A, #FF3B30);

    /* Backgrounds - The "Void" */
    --bg-main: #000000;
    --bg-secondary: #0C0C0E;
    --bg-card: rgba(28, 28, 30, 0.65);
    /* Replaces glass-panel bg in some ctx */
    --bg-glass: rgba(28, 28, 30, 0.65);
    --bg-input: rgba(118, 118, 128, 0.12);

}

/* PREMIUM DISCLAIMER CARD */
.disclaimer-card {
    background: rgba(255, 159, 10, 0.03);
    border: 1px solid rgba(255, 159, 10, 0.1);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.disclaimer-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 159, 10, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 159, 10, 0.15);
}

.disclaimer-icon-box i {
    color: #FF9F0A;
    font-size: 18px;
}

.disclaimer-content {
    flex: 1;
    min-width: 0;
}

.disclaimer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 10px;
}

.disclaimer-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.disclaimer-status {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pending {
    background: rgba(142, 142, 147, 0.1);
    border: 1px solid rgba(142, 142, 147, 0.15);
    color: #8E8E93;
}

.status-active {
    background: rgba(50, 215, 75, 0.08);
    border: 1px solid rgba(50, 215, 75, 0.15);
    color: #32D74B;
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.status-active .status-dot {
    background: #32D74B;
    box-shadow: 0 0 6px #32D74B;
}

.status-pending .status-dot {
    background: #8E8E93;
}

.disclaimer-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

@media (max-width: 480px) {
    .disclaimer-card {
        padding: 12px;
        gap: 12px;
    }

    .disclaimer-header {
        flex-direction: row;
        align-items: center;
    }

    .disclaimer-title {
        font-size: 12px;
    }

    .disclaimer-text {
        font-size: 10.5px;
    }
}

:root {

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-tertiary: #48484A;

    /* Functional */
    --border: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(10, 132, 255, 0.5);
    --success: #32D74B;
    --error: #FF453A;
    --warning: #FF9F0A;

    /* Dimensions */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    /* Dashboard Hero uses 32px */

    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(10, 132, 255, 0.15);
    --backdrop: blur(25px) saturate(180%);
    --ease-ios: cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 120px;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top);
    animation: fadeIn 0.5s var(--ease-ios);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
}

/* --- HEADERS --- */

/* Standard iOS Header (profile.php, debts.php, etc) */
.app-header-ios-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(env(safe-area-inset-top) + 10px) 4px 0 4px;
    margin-bottom: 20px;
}

.ios-page-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-align: center;
    flex: 1;
}

.header-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.08);
    /* Fallback */
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
}

/* Dashboard Header (Custom) */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-top: calc(env(safe-area-inset-top) + 15px);
}

.header-text h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.header-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    text-decoration: none;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.icon-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}


/* --- CARDS & PANELS --- */

/* Standard Glass Panel */
.glass-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.neon-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Dashboard Hero Wealth Card */
.hero-wealth {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.8), rgba(10, 10, 12, 0.9));
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: premiumGlow 4s ease-in-out infinite alternate;
}

@keyframes premiumGlow {
    0% {
        box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.1);
    }

    100% {
        box-shadow: 0 20px 50px -10px rgba(10, 132, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
        border-color: rgba(10, 132, 255, 0.4);
    }
}

.hero-wealth::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.3), transparent 70%);
    filter: blur(50px);
}

.hw-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    position: relative;
}

.hw-balance {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 24px;
    position: relative;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.hw-stats {
    display: flex;
    gap: 12px;
    position: relative;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 700;
}

/* --- FORMS & INPUTS --- */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 4px;
}

.ios-input,
.modern-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 16px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    transition: 0.3s var(--ease-ios);
    outline: none;
}

.ios-input:focus,
.modern-input:focus {
    background: rgba(118, 118, 128, 0.18);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15);
}

.ios-btn {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    font-size: 17px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
}

.ios-btn:active {
    transform: scale(0.98);
}

.ios-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--border);
    box-shadow: none;
}


/* --- LISTS & SETTINGS --- */

.settings-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.s-icon {
    width: 36px;
    height: 36px;
    background: rgba(10, 132, 255, 0.1);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 18px;
}

.s-info {
    flex: 1;
}

.s-title {
    font-size: 16px;
    font-weight: 600;
    display: block;
}

.s-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

.s-arrow {
    color: var(--text-tertiary);
    font-size: 14px;
}


/* --- UTILITIES & ANIMATIONS --- */

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-30 {
    margin-top: 30px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideUpFade 0.6s var(--ease-ios) forwards;
    opacity: 0;
}

@keyframes slideUpFade {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Core Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: flex-end;
    /* Bottom sheet on mobile */
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #1C1C1E;
    width: 100%;
    max-width: 500px;
    border-radius: 24px 24px 0 0;
    /* Bottom sheet */
    padding: 30px 24px;
    border: 1px solid var(--border);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Desktop Modal Tweaks */
@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }

    .modal-content {
        border-radius: 24px;
        width: 90%;
    }
}

/* --- Biriko PWA Splash Screen --- */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.8, 0, 0.2, 1), transform 0.6s cubic-bezier(0.8, 0, 0.2, 1);
    opacity: 1;
    pointer-events: none;
    /* Let clicks pass if needed, though it's removed soon */
}

/* Fallback for when JS takes too long, just in case */
@keyframes splashFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    80% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.05);
        display: none;
        visibility: hidden;
    }
}

.pwa-splash.hide {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.splash-logo-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: splashPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.splash-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(10, 132, 255, 0.4));
}

.splash-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.6) 0%, transparent 60%);
    filter: blur(30px);
    z-index: 1;
    animation: glowBreathe 2s infinite alternate ease-in-out;
}

.splash-text {
    margin-top: 24px;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    animation: textFade 2s infinite alternate ease-in-out;
}

.splash-spinner {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-left-color: rgba(10, 132, 255, 0.4);
    animation: splashSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    z-index: 3;
}

@keyframes splashSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes splashPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes glowBreathe {
    0% {
        opacity: 0.5;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes textFade {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}