/* ===== RESET & BASE ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5541D7;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #E17055;
    --info: #74B9FF;
    --bg-primary: #0F0F1A;
    --bg-secondary: #1A1A2E;
    --bg-card: #16213E;
    --bg-card-hover: #1C2A4A;
    --bg-input: #1A1A2E;
    --text-primary: #FFFFFF;
    --text-secondary: #B2BEC3;
    --text-muted: #636E72;
    --text-accent: #DFE6E9;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --radius-full: 50%;
    --nav-height: 72px;
    --header-height: 56px;
    --status-height: 44px;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000;
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}


/* ===== APP CONTAINER ===== */

.app-container {
    position: relative;
    width: 100%;
    max-width: 430px;
    height: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
    overflow: hidden;
}


/* No desktop: simula moldura de celular */

@media (min-width: 431px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
    }
    .app-container {
        max-height: 932px;
        border-radius: 40px;
        border: 3px solid rgba(108, 92, 231, 0.3);
        box-shadow: 0 0 60px rgba(108, 92, 231, 0.15);
    }
}


/* No celular: tela cheia sem moldura */

@media (max-width: 430px) {
    html,
    body {
        background: var(--bg-primary);
    }
    .app-container {
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    /* Esconde status bar falsa no celular real */
    .status-bar {
        display: none !important;
    }
    .screen {
        padding-top: env(safe-area-inset-top, 0px);
    }
}


/* ===== STATUS BAR ===== */

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px 4px;
    height: var(--status-height);
    font-size: 14px;
    font-weight: 600;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 430px;
    margin: 0 auto;
    z-index: 100;
    background: transparent;
}

.status-icons {
    display: flex;
    gap: 6px;
    font-size: 16px;
}


/* ===== SCREENS ===== */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: var(--bg-primary);
    z-index: 1;
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    z-index: 10;
}

.screen.slide-out {
    display: flex;
    opacity: 0;
    transform: translateX(-20px);
    z-index: 5;
    pointer-events: none;
}


/* ===== SCREEN HEADER ===== */

.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: var(--header-height);
    margin-top: var(--status-height);
    flex-shrink: 0;
}

.screen-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.screen-header.transparent-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.spacer {
    width: 40px;
}


/* ===== SCREEN CONTENT (scrollable) ===== */

.screen-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    padding-bottom: 24px;
    -webkit-overflow-scrolling: touch;
}

.screen-content::-webkit-scrollbar {
    display: none;
}


/* ===== BUTTONS ===== */

.btn-back,
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:active,
.btn-icon:active {
    transform: scale(0.92);
    background: var(--bg-card-hover);
}

.btn-back.light,
.btn-icon.light {
    background: rgba(255, 255, 255, 0.15);
    border-color: transparent;
    color: #fff;
    backdrop-filter: blur(10px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-full {
    width: 100%;
}

.btn-half {
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 1.5px solid var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00A381);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #F0B93C);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3);
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-notification {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-notification .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ===== INPUT GROUPS ===== */

.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.input-group:focus-within {
    border-color: var(--primary);
}

.input-group>i {
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.input-group input,
.input-group textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    padding: 14px 0;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-muted);
}

.input-group.large input {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 4px;
    padding: 18px 0;
}

.textarea-group {
    align-items: flex-start;
    padding-top: 14px;
}

.textarea-group textarea {
    resize: none;
}

.toggle-pass {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}


/* ===== SECTION TITLE ===== */

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 12px;
}


/* ===== BOTTOM NAVIGATION ===== */

.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 8px);
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 22px;
}

.nav-item.active {
    color: var(--primary-light);
}

.nav-item.nav-scan {
    padding: 0;
}

.scan-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    margin-top: -20px;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.5);
    transition: transform 0.2s;
}

.scan-btn:active {
    transform: scale(0.92);
}


/* ===== TOAST ===== */

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.hidden {
    display: none;
}

.toast i {
    color: var(--primary-light);
    font-size: 18px;
}


/* ===== SUCCESS OVERLAY ===== */

.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.success-overlay.show {
    opacity: 1;
}

.success-overlay.hidden {
    display: none;
}

.success-content {
    text-align: center;
}

.success-check {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--success), #00A381);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    margin: 0 auto 16px;
    animation: successPulse 0.5s ease;
}

.success-content h3 {
    color: #fff;
    font-size: 20px;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}


/* ===== MODAL ===== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 430px;
    background: var(--bg-secondary);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 16px));
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}


/* ===== BACKGROUNDS ===== */

.bg-blue {
    background: linear-gradient(135deg, #74B9FF, #0984E3);
}

.bg-green {
    background: linear-gradient(135deg, #55EFC4, #00B894);
}

.bg-purple {
    background: linear-gradient(135deg, #A29BFE, #6C5CE7);
}

.bg-orange {
    background: linear-gradient(135deg, #FAB1A0, #E17055);
}

.bg-teal {
    background: linear-gradient(135deg, #81ECEC, #00CEC9);
}

.bg-red {
    background: linear-gradient(135deg, #FD79A8, #E84393);
}

.bg-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}


/* ===== LINK ===== */

.link-forgot {
    display: block;
    text-align: center;
    color: var(--primary-light);
    text-decoration: none;
    font-size: 14px;
    margin-top: 12px;
}


/* ===== DIVIDER ===== */

.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}


/* ===== SCROLLBAR HIDDEN ===== */

::-webkit-scrollbar {
    width: 0;
    display: none;
}


/* ===== UTILITIES ===== */

.hidden {
    display: none !important;
}