/* ============================================================
   VoltIQ — Main Stylesheet
   File: assets/css/app.css
   Design: Premium 2026 Mobile-First Fintech
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables — Light Theme ─────────────────────────── */
:root {
    /* Brand */
    --primary:          #1A6FE8;
    --primary-dark:     #1459C2;
    --primary-light:    #EBF2FF;
    --primary-glow:     rgba(26, 111, 232, 0.15);

    /* Backgrounds */
    --bg-app:           #F4F7FF;
    --bg-card:          #FFFFFF;
    --bg-input:         #F8FAFF;
    --bg-nav:           #FFFFFF;

    /* Text */
    --text-primary:     #0D1B3E;
    --text-secondary:   #5A6A8A;
    --text-muted:       #9AA5BE;
    --text-white:       #FFFFFF;

    /* Borders */
    --border:           #E4EAF5;
    --border-focus:     #1A6FE8;

    /* Status */
    --success:          #00C896;
    --success-light:    #E6FBF5;
    --warning:          #F5A623;
    --warning-light:    #FEF5E7;
    --danger:           #F04438;
    --danger-light:     #FEF0EE;
    --info:             #1A6FE8;
    --info-light:       #EBF2FF;

    /* Shadows */
    --shadow-sm:        0 1px 4px rgba(13, 27, 62, 0.06);
    --shadow-md:        0 4px 16px rgba(13, 27, 62, 0.10);
    --shadow-lg:        0 8px 32px rgba(13, 27, 62, 0.14);
    --shadow-card:      0 2px 12px rgba(26, 111, 232, 0.08);

    /* Layout */
    --header-height:    60px;
    --nav-height:       72px;
    --border-radius:    16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 24px;

    /* Transitions */
    --transition:       all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Dark Theme Variables ─────────────────────────────────── */
.dark-theme {
    --primary:          #00E676;
    --primary-dark:     #00C962;
    --primary-light:    #0A1F14;
    --primary-glow:     rgba(0, 230, 118, 0.15);

    --bg-app:           #0A0E1A;
    --bg-card:          #111827;
    --bg-input:         #1A2235;
    --bg-nav:           #111827;

    --text-primary:     #F0F4FF;
    --text-secondary:   #8899BB;
    --text-muted:       #4A5568;

    --border:           #1E2D4A;
    --border-focus:     #00E676;

    --shadow-sm:        0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-md:        0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg:        0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-card:      0 2px 12px rgba(0, 230, 118, 0.06);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover { opacity: 0.85; }

img { max-width: 100%; display: block; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
}

/* ── App Layout ───────────────────────────────────────────── */
.app-body {
    padding-top: var(--header-height);
    padding-bottom: var(--nav-height);
    background: var(--bg-app);
    min-height: 100vh;
}

.app-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
}

/* ── App Header ───────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.5px;
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text-secondary);
    position: relative;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-app);
    color: var(--primary);
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.btn-back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text-primary);
    transition: var(--transition);
}

.btn-back:hover { background: var(--bg-app); }

/* ── Bottom Navigation ────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(13, 27, 62, 0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    border-radius: 12px;
}

.nav-item svg { transition: var(--transition); }

.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg {
    stroke: var(--primary);
}

.nav-center {
    flex: 1.2;
}

.nav-center-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--primary-glow);
    transition: var(--transition);
    margin-bottom: -4px;
}

.nav-center-btn svg { stroke: #fff; }

.nav-center-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

.card-sm { padding: 16px; border-radius: var(--border-radius-sm); }
.card-lg { padding: 24px; border-radius: var(--border-radius-lg); }

/* ── Auth Layout ──────────────────────────────────────────── */
.auth-body {
    background: var(--bg-app);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: var(--bg-card);
    padding: 40px 24px 40px;
    display: flex;
    flex-direction: column;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.auth-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-back {
    margin-bottom: 16px;
}

.btn-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ── Forms ────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.label-optional {
    font-weight: 400;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.form-input {
    width: 100%;
    height: 52px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--border-radius-sm);
    padding: 0 44px 0 44px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
    border-color: var(--border-focus);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-eye {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    transition: var(--transition);
}

.input-eye:hover { color: var(--primary); }

.form-forgot {
    text-align: right;
    margin-top: 6px;
}

.form-forgot a {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
}

.form-terms {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
}

.form-terms a { font-weight: 500; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    height: 54px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: var(--transition);
    box-shadow: 0 4px 16px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-full { width: 100%; }

.btn-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-white);
    text-align: center;
    padding: 8px;
    transition: var(--transition);
}

.btn-text:hover { color: var(--primary); }

.btn-submit {
    margin-top: 8px;
}

/* ── Spinner ──────────────────────────────────────────────── */
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alert Box ────────────────────────────────────────────── */
.alert-box {
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 4px;
}

.alert-success {
    background: var(--success-light);
    color: #00A37A;
    border: 1px solid rgba(0, 200, 150, 0.3);
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(240, 68, 56, 0.3);
}

.alert-warning {
    background: var(--warning-light);
    color: #D48800;
    border: 1px solid rgba(245, 166, 35, 0.3);
}

.alert-info {
    background: var(--info-light);
    color: var(--primary);
    border: 1px solid rgba(26, 111, 232, 0.3);
}

/* ── Flash Message ────────────────────────────────────────── */
.flash-message {
    margin: 8px 16px 0;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
}

/* ── Auth Footer ──────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    font-weight: 600;
    color: var(--primary);
}

/* ── Onboarding ───────────────────────────────────────────── */
.onboarding-body {
    background: var(--bg-card);
    min-height: 100vh;
}

.onboarding-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 40px 0 0;
}

.onboarding-slides {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.onboarding-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.onboarding-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.slide-illustration {
    margin-bottom: 40px;
}

.illus-circle {
    width: 140px;
    height: 140px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.illus-blue    { background: linear-gradient(135deg, #1A6FE8, #0F4DC7); box-shadow: 0 16px 48px rgba(26,111,232,0.3); }
.illus-indigo  { background: linear-gradient(135deg, #5B5BD6, #3D3DB8); box-shadow: 0 16px 48px rgba(91,91,214,0.3); }
.illus-green   { background: linear-gradient(135deg, #00C896, #00A07A); box-shadow: 0 16px 48px rgba(0,200,150,0.3); }

.slide-content { text-align: center; }

.slide-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.slide-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 320px;
    margin: 0 auto;
}

.onboarding-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 0 16px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dot.active {
    width: 24px;
    background: var(--primary);
}

.onboarding-actions {
    padding: 16px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Illustration circles in forgot password ──────────────── */
.auth-header .illus-circle {
    width: 72px;
    height: 72px;
    border-radius: 22px;
}

/* ── Utility ──────────────────────────────────────────────── */
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-primary  { color: var(--text-primary); }
.text-secondary{ color: var(--text-secondary); }
.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.d-flex  { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }

/* ── Safe Area (iPhone notch) ─────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    }
    .app-body {
        padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
    }
}

/* ── Responsive Desktop View ──────────────────────────────── */
@media (min-width: 480px) {
    .auth-wrapper,
    .onboarding-container {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        min-height: 100vh;
    }

    .app-header,
    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}