@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- VARIÁVEIS DO SISTEMA --- */
:root {
    --bg: #030305;
    --card: #0d0d12;
    --border: #1a1a24;
    --primary: #a855f7;
    --secondary: #22d3ee;
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --danger: #ff4e4e;
    --success: #10b981;
    --warning: #facc15;
    --glass: rgba(13, 13, 18, 0.98);
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --shadow-p: 0 10px 30px rgba(168, 85, 247, 0.2);
    --transition-main: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- RESET E ESTILIZAÇÃO DE BASE --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: var(--font-main); 
    -webkit-tap-highlight-color: transparent; 
    outline: none;
    -webkit-font-smoothing: antialiased;
}

html, body {
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    height: 100%;
    width: 100%;
    scroll-behavior: smooth;
}

body { 
    padding-bottom: env(safe-area-inset-bottom, 140px);
    line-height: 1.6;
}

::-webkit-scrollbar { width: 0px; display: none; }

/* --- KEYFRAMES DE ANIMAÇÃO --- */
@keyframes pageIn { 
    from { opacity: 0; transform: translateY(40px) scale(0.98); } 
    to { opacity: 1; transform: translateY(0) scale(1); } 
}

@keyframes pulseAlert { 
    0% { opacity: 1; transform: scale(1); } 
}

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

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

/* --- ALERTAS E NOTIFICAÇÕES GLOBAIS --- */
#critical-alert {
    display: none; 
    background: linear-gradient(90deg, #7f1d1d, var(--danger), #7f1d1d);
    color: white; 
    padding: 18px; 
    text-align: center; 
    font-weight: 800;
    font-size: 0.65rem; 
    position: sticky; 
    top: 0; 
    z-index: 99999;
    animation: pulseAlert 1.5s infinite; 
    letter-spacing: 3px;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(255, 78, 78, 0.3);
}

#toast-container { 
    position: fixed; 
    top: 70px; 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 200000; 
    width: 92%; 
    max-width: 450px; 
    pointer-events: none; 
    display: flex;
    flex-direction: column;
    align-items: center; 
}

.toast { 
    background: var(--glass); 
    border: 1px solid var(--border); 
    padding: 22px; 
    border-radius: 30px; 
    color: white; 
    margin-bottom: 12px; 
    backdrop-filter: blur(40px); 
    border-left: 8px solid var(--primary); 
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: toastSlide 0.5s ease-out forwards; 
    display: flex; 
    align-items: center; 
    gap: 15px;
}

/* --- COMPONENTES DE UI E PÁGINAS --- */
.page { 
    display: none; 
    padding: 30px 20px; 
    padding-bottom: 140px; 
    max-width: 600px; 
    margin: 0 auto; 
    min-height: 100vh; 
}

.page.active { 
    display: block; 
    animation: pageIn 0.7s cubic-bezier(0.19, 1, 0.22, 1); 
}

.page-compact {
    min-height: auto !important;
    padding-bottom: 60px !important; 
}

.card { 
    background: var(--card); 
    border: 1px solid var(--border); 
    border-radius: 40px; 
    padding: 30px; 
    margin-bottom: 22px; 
    transition: var(--transition-main);
    position: relative;
    overflow: hidden;
}

.card:active { 
    transform: scale(0.97); 
    filter: brightness(1.1); 
}

.card-danger { 
    border: 1px solid rgba(255, 78, 78, 0.4); 
    background: rgba(255, 78, 78, 0.02); 
}

.card-problem { 
    border-left: 4px solid var(--danger); 
    background: rgba(255, 78, 78, 0.05); 
}

/* --- HEADER / HERO SECTION --- */
.hero { 
    background: linear-gradient(165deg, #1e1b4b 0%, #4c1d95 50%, #0e7490 100%); 
    padding: 60px 35px; 
    border-radius: 55px; 
    text-align: center; 
    margin-bottom: 45px; 
    box-shadow: 0 40px 80px -20px rgba(76, 29, 149, 0.5); 
    position: relative;
}

.hero h1 { 
    font-size: 5rem; 
    font-weight: 900; 
    letter-spacing: -6px; 
    line-height: 0.8; 
    margin: 15px 0; 
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.3));
}

.hero-lp {
    padding: 60px 20px;
    text-align: center;
    background: radial-gradient(circle at top, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 25px;
    text-align: center;
}

/* --- BOTÕES --- */
.btn { 
    width: 100%; 
    padding: 22px; 
    border-radius: 25px; 
    border: none; 
    font-weight: 800; 
    cursor: pointer; 
    transition: var(--transition-main); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 14px; 
    font-size: 1rem; 
}

.btn-p, .btn-s {
    padding: 14px 20px !important;
    border-radius: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    font-family: var(--font-main) !important;
}

.btn-p {
    background: linear-gradient(135deg, var(--primary), #8b5cf6) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3) !important;
}

.btn-p:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.45) !important;
}

.btn-s {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-dim) !important;
    border: 1px solid var(--border) !important;
}

.btn-s:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.btn-danger { 
    background: #7f1d1d; 
    color: white; 
    border: 1px solid var(--danger); 
}

.btn-sm { 
    padding: 14px 22px; 
    font-size: 0.75rem; 
    width: auto; 
    border-radius: 18px; 
}

#btn-logout {
    background: rgba(255, 78, 78, 0.1);
    color: white;
    border: 1px solid rgba(255, 78, 78, 0.2);
    padding: 15px;
    border-radius: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#btn-logout:hover {
    background: #ff4e4e;
    color: white;
    box-shadow: 0 10px 20px rgba(255, 78, 78, 0.2);
}

.card-actions, .modal-footer {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-top: 15px !important;
}

/* --- FORMULÁRIOS --- */
input, select, textarea { 
    width: 100%; 
    padding: 22px; 
    background: rgba(255,255,255,0.02); 
    border: 1px solid var(--border); 
    border-radius: 25px; 
    color: white; 
    margin: 14px 0; 
    font-size: 1rem; 
    transition: var(--transition-main);
}

input:focus, textarea:focus { 
    border-color: var(--primary); 
    background: rgba(168, 85, 247, 0.04); 
}

select {
    appearance: none; 
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 18px;
    cursor: pointer;
}

select option {
    background-color: var(--card); 
    color: var(--text);
    padding: 15px;
}

.input-group-zenith {
    background: rgba(0,0,0,0.2);
    border-radius: 25px;
    padding: 5px 20px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.input-group-zenith label {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.input-group-zenith input {
    margin: 0;
    padding: 10px 0;
    border: none;
    background: transparent;
}

/* --- NAVEGAÇÃO INFERIOR (DOCK) --- */
.dock { 
    position: fixed; 
    bottom: 35px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 92%; 
    max-width: 500px; 
    background: var(--glass); 
    backdrop-filter: blur(40px); 
    border: 1px solid var(--border); 
    border-radius: 45px; 
    display: flex; 
    padding: 16px; 
    z-index: 9999; 
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.dock-item { 
    color: var(--text-dim); 
    cursor: pointer; 
    font-size: 0.7rem; 
    text-align: center; 
    flex: 1; 
    padding: 14px 0; 
    border-radius: 28px; 
    transition: 0.4s; 
    font-weight: 700; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 6px;
}

.dock-item.active { 
    color: var(--primary); 
    background: rgba(168, 85, 247, 0.15); 
}

/* --- SISTEMA DE MODAIS --- */
.modal { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.92); 
    z-index: 100000; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
    backdrop-filter: blur(15px);
}

.modal-content { 
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    position: relative; 
    animation: slideUp 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- PROGRESS BARS E LABELS --- */
.prog-bg { 
    height: 16px; 
    background: rgba(255,255,255,0.04); 
    border-radius: 30px; 
    margin: 20px 0; 
    overflow: hidden; 
    position: relative; 
}

.prog-fill { 
    height: 100%; 
    border-radius: 30px; 
    transition: 2.5s cubic-bezier(0.19, 1, 0.22, 1); 
    width: 0%; 
}

.diag-label { 
    color: var(--primary); 
    font-weight: 800; 
    font-size: 0.6rem; 
    text-transform: uppercase; 
    margin-bottom: 8px; 
    letter-spacing: 2px; 
}

/* --- OVERLAY DE CONFIRMAÇÃO CRÍTICA --- */
#confirm-overlay {
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.85);
    z-index: 300000; 
    align-items: center; 
    justify-content: center; 
    padding: 20px;
}

/* --- ESTILO CUSTOMIZADO PARA MODAL DE PEÇAS --- */
.peca-grid, .peca-grid-select {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.peca-option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.peca-option i, .peca-option span:first-child {
    font-size: 24px;
    color: var(--text-dim);
}

.peca-option small {
    font-size: 13px;
    font-weight: 500;
}

.peca-option.selected {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.peca-option.selected i, .peca-option.selected span:first-child {
    color: var(--primary);
}

#oil-spec-container {
    background: rgba(168, 85, 247, 0.03);
    padding: 20px;
    border-radius: 25px;
    border: 1px dashed rgba(168, 85, 247, 0.3);
    margin-bottom: 25px;
}

#oil-spec-container select {
    border: 1px solid var(--primary);
    background-color: rgba(168, 85, 247, 0.05);
    font-weight: 700;
    color: var(--text);
    padding-right: 50px; 
}

/* --- AUTH OVERLAYS --- */
#auth-overlay-popup .card { max-height: 85vh; overflow-y: auto; }
#auth-overlay .page { display: block !important; position: static !important; padding: 0 !important; }
.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-toggle-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 1.5rem;
    display: block;
    text-align: center;
}

/* --- EXTRAS --- */
.step-number { 
    background: var(--primary); 
    width: 24px; height: 24px; 
    border-radius: 50%; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    margin-right: 10px;
    font-size: 0.8rem;
}

.card-feature {
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}

.card-feature:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.icon-box { font-size: 2rem; margin-bottom: 15px; display: block; }
.footer-link { transition: color 0.3s; cursor: pointer; }
.footer-link:hover { color: var(--primary); }
