:root {
    --bg-deep: #e2e8f0; 
    --glass-bg: rgba(255, 255, 255, 0.75); 
    --glass-border: #0284c7; 
    --text-main: #0f172a; 
    --text-muted: #475569; 
    --accent: #0284c7; 
    --accent-glow: rgba(2, 132, 199, 0.25); 
    --bg-pattern: radial-gradient(rgba(2, 132, 199, 0.15) 1px, transparent 1px);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.10);
}

body.dark-mode {
    --bg-deep: #020617; 
    --glass-bg: rgba(15, 23, 42, 0.8); 
    --glass-border: rgba(56, 189, 248, 0.4); 
    --text-main: #f0f9ff; 
    --text-muted: #94a3b8; 
    --accent: #0ea5e9; 
    --accent-glow: rgba(14, 165, 233, 0.4);
    --bg-pattern: transparent;
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 5px; z-index: 2000; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

body {
    margin: 0; font-family: 'Inter', sans-serif;
    background-color: var(--bg-deep); background-image: var(--bg-pattern);
    background-size: 25px 25px; color: var(--text-main);
    overflow-x: hidden; scroll-behavior: smooth;
    transition: background-color 0.5s ease;
}

.ambient-glow {
    position: fixed; top: 30%; left: 40%; transform: translate(-50%, -50%);
    width: 60vw; height: 60vh; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: -2; filter: blur(90px); transition: all 0.5s ease;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1.5px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
}

.navbar {
    position: fixed; top: 10px; left: 10px; right: 10px; height: 80px;
    border-radius: 16px; z-index: 1000; display: flex;
    justify-content: space-between; align-items: center; padding: 0 30px; box-sizing: border-box;
}

.nav-left { display: flex; align-items: center; gap: 15px; }
.nav-brand-title { display: flex; flex-direction: column; line-height: 1; border-left: 2px solid var(--accent); padding-left: 15px; }
.nav-brand-title .main-title { font-size: 1.2rem; font-weight: 900; letter-spacing: 1px; color: var(--text-main); }
.nav-brand-title .highlight { color: var(--accent); }
.nav-brand-title .sub-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-top: 4px; }
.logo-img { height: 100px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
.nav-menu { display: flex; gap: 20px; align-items: center; }
.nav-link { color: var(--text-main); text-decoration: none; font-weight: 600; font-size: 0.85rem; transition: 0.3s; }
.nav-link:hover { color: var(--accent); }

.btn-theme {
    background: transparent; border: 1.5px solid var(--glass-border); color: var(--text-main);
    padding: 8px 18px; border-radius: 50px; cursor: pointer; font-weight: 600; transition: all 0.2s;
}
.btn-theme:hover { background: var(--accent); color: white; border-color: var(--accent); }

.btn-action {
    background: transparent; border: 1.5px solid var(--accent); color: var(--accent);
    padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
    transition: all 0.3s;
}
.btn-action:hover { background: rgba(2, 132, 199, 0.1); }

.btn-action.primary {
    background: var(--accent); color: #ffffff; padding: 15px 35px; border: none;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2); cursor: pointer;
}
.btn-action.primary:hover { background: var(--text-main); transform: translateY(-2px); }

.mobile-menu-btn { display: none; font-size: 2rem; color: var(--accent); cursor: pointer; }

.footer {
    position: fixed; bottom: 10px; left: 10px; right: 10px; height: 60px;
    border-radius: 16px; z-index: 1000; display: flex; justify-content: center; align-items: center;
}

/* --- FORMULARIO Y SECCIONES --- */
.main-content { min-height: 100vh; padding: 120px 5% 90px; display: flex; justify-content: center; align-items: flex-start; }
.form-container { width: 100%; max-width: 1000px; padding: 40px; border-radius: 20px; margin: 0 auto; }
.form-title { font-size: 2rem; margin-bottom: 25px; text-align: center; }

.section-card {
    background: rgba(2, 132, 199, 0.04); border: 1.5px solid var(--glass-border);
    padding: 25px; border-radius: 15px; margin-bottom: 20px;
}
.section-card-title { font-size: 1.2rem; font-weight: 800; color: var(--accent); margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 10px; }
.input-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 5px; }

.glass-input {
    width: 100%; padding: 12px 15px; border-radius: 10px;
    background: rgba(255, 255, 255, 0.1); border: 1px solid var(--glass-border);
    color: var(--text-main); font-family: 'Inter', sans-serif; font-size: 1rem;
    box-sizing: border-box; outline: none; transition: 0.3s; margin-bottom: 12px;
}
.glass-input:focus { border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
body.dark-mode .glass-input { background: rgba(0, 0, 0, 0.2); color: var(--text-main); }

.quotation-block {
    background: rgba(255, 255, 255, 0.5); border: 2px dashed var(--accent);
    padding: 20px; border-radius: 12px; margin-bottom: 20px; position: relative;
}
body.dark-mode .quotation-block { background: rgba(0, 0, 0, 0.3); }

.quotation-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; border-bottom: 1px solid var(--glass-border); padding-bottom: 8px; }
.quotation-block-title { font-weight: 800; color: var(--accent); }

.item-row { 
    display: flex; gap: 10px; margin-bottom: 10px; align-items: center; 
    background: rgba(255,255,255,0.6); padding: 10px; border-radius: 10px; flex-wrap: wrap;
    border: 1px solid rgba(2, 132, 199, 0.2);
}
body.dark-mode .item-row { background: rgba(0,0,0,0.2); }
.item-row .desc { flex: 2; min-width: 180px; }
.item-row .qty { flex: 0.6; min-width: 60px; }
.item-row .price { flex: 1; min-width: 80px; }
.item-row .img-url { flex: 1.5; min-width: 130px; }

.item-preview-img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; display: none; border: 1px solid var(--accent); }
.btn-remove { background: #ef4444; color: white; border: none; padding: 10px 12px; border-radius: 8px; cursor: pointer; display:flex; align-items:center; justify-content:center; }
.btn-remove:hover { background: #dc2626; }

.block-total { text-align: right; font-weight: bold; margin-top: 10px; font-size: 1.1rem; color: var(--accent); }
.global-actions { margin-top: 25px; border-top: 2px solid var(--accent); padding-top: 20px; }

/* ==========================================================================
   DISEÑO DE IMPRESIÓN DE ALTO IMPACTO (EFECTO WOW - FERCITODEV)
   ========================================================================== */

.pdf-page {
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding: 38px 42px;
    width: 816px;
    height: 1040px;
    box-sizing: border-box;
    font-size: 10.5px;
    line-height: 1.45;
    overflow: hidden;
    position: relative;
    page-break-after: always;
    break-after: page;
    margin: 0;
}

/* Franja superior tricolor corporativa */
.pdf-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #0284c7 0%, #0369a1 50%, #38bdf8 100%);
}

/* Encabezado Corporativo */
.pdf-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 14px; 
    margin-bottom: 18px; 
}

.pdf-logo { 
    max-height: 48px; 
    display: block; 
}

.pdf-company-info { 
    font-size: 9px; 
    color: #64748b; 
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 4px; 
    text-transform: uppercase;
}

.pdf-info { 
    text-align: right; 
}

.pdf-title { 
    font-size: 14px; 
    color: #0284c7; 
    font-weight: 800; 
    letter-spacing: 0.8px; 
    text-transform: uppercase;
}

.pdf-meta-grid {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.pdf-meta { 
    font-size: 9.5px; 
    color: #475569; 
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.pdf-meta strong {
    color: #0f172a;
}

/* Tarjetas de Secciones */
.pdf-section { 
    margin-bottom: 14px; 
    background: #f8fafc; 
    padding: 10px 14px; 
    border-radius: 8px; 
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0284c7; 
}

.pdf-section-title { 
    font-size: 10.5px; 
    color: #0284c7; 
    font-weight: 800; 
    margin-bottom: 4px; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-section-desc { 
    font-size: 10px; 
    color: #334155; 
    margin: 0; 
    white-space: pre-line;
    line-height: 1.5;
}

/* Tabla Estilo Ejecutivo */
.pdf-table { 
    width: 100%; 
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px; 
    margin-bottom: 14px; 
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.pdf-table th { 
    background: linear-gradient(135deg, #0284c7, #0369a1); 
    color: #ffffff; 
    text-align: left; 
    padding: 8px 12px; 
    font-size: 9.5px; 
    font-weight: 700; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-table td { 
    padding: 8px 12px; 
    border-bottom: 1px solid #f1f5f9; 
    vertical-align: middle; 
    color: #1e293b; 
    font-size: 9.5px; 
}

.pdf-table tr:last-child td {
    border-bottom: none;
}

.pdf-table tr:nth-child(even) { 
    background-color: #f8fafc; 
}

.pdf-table img { 
    width: 32px; 
    height: 32px; 
    object-fit: contain; 
    border-radius: 6px; 
    border: 1px solid #cbd5e1; 
    display: block; 
    background: #ffffff; 
    padding: 2px;
}

/* Destacado de Total */
.pdf-total-box { 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    margin-top: 12px; 
}

.pdf-total-text { 
    background: linear-gradient(135deg, #0f172a, #1e293b); 
    color: #ffffff; 
    padding: 8px 18px; 
    border-radius: 8px; 
    font-size: 12px; 
    font-weight: 800; 
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-right: 4px solid #0284c7;
}

/* Pie de página corporativo */
.pdf-footer-note { 
    position: absolute; 
    bottom: 28px; 
    left: 42px; 
    right: 42px; 
    border-top: 1px solid #e2e8f0; 
    padding-top: 10px; 
    text-align: center; 
    color: #64748b; 
    font-size: 9px; 
    line-height: 1.4;
}

.pdf-footer-note strong {
    color: #0f172a;
}