:root {
    --bg-black: #050505;
    --accent-blue: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --warning: #ffcc00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-black);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
}

/* Horizon Glow Effect (Inspired by Reference) */
body::before {
    content: '';
    position: fixed;
    bottom: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 140%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(61, 99, 255, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Subtle Dotted Grid */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 40px 40px;
    z-index: -2;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.glass-container {
    width: 100%;
    max-width: 900px;
    text-align: center;
    position: relative;
    z-index: 10;
    padding: 24px 48px;
    background: transparent;
    border: none;
    border-radius: 32px;
    animation: fadeIn 1s ease-out;
}

header {
    margin-bottom: 20px;
}

.main-logo {
    width: 200px;
    height: auto;
    margin: 0 auto 4px;
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.1));
    animation: fadeIn 1.5s ease;
}

.subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: #1a8fff;
    opacity: 1;
}

/* Glass crystal effect — solo pantallas 2, 3, 4 */
#stepConfirm,
#stepProgress,
#stepResult,
#stepUpdateConfirm {
    background: rgba(20, 80, 180, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(60, 140, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(20, 60, 180, 0.15), inset 0 1px 0 rgba(100, 180, 255, 0.08);
    padding: 20px;
}

/* Pantalla 1: recuadro azul solo en la parte de input/botón */
#stepSearch {
    background: rgba(20, 80, 180, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(60, 140, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(20, 60, 180, 0.15), inset 0 1px 0 rgba(100, 180, 255, 0.08);
    padding: 20px;
}

/* Botones iguales en pantalla Conductor ya Registrado */
#stepUpdateConfirm #updateConfirmBtn,
#stepUpdateConfirm #updateCancelBtn {
    width: 100%;
    max-width: 280px;
    padding: 16px 20px;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    max-width: 320px;
    margin: 22px auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    padding: 18px 26px;
    border-radius: 12px;
    font-size: 1.05rem;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 20px rgba(255, 255, 255, 0.05);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

input:focus {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 30px rgba(255, 255, 255, 0.08);
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-primary, #confirmBtn, #updateConfirmBtn {
    background: rgba(0, 200, 80, 0.12);
    color: #00e55a;
    border: 1px solid rgba(0, 220, 80, 0.35);
    padding: 20px 40px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 200, 80, 0.15), inset 0 0 20px rgba(0, 200, 80, 0.05);
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(0, 220, 80, 0.5);
}

.btn-primary:hover, #confirmBtn:hover, #updateConfirmBtn:hover {
    transform: translateY(-3px);
    background: rgba(0, 200, 80, 0.2);
    border-color: rgba(0, 220, 80, 0.6);
    box-shadow: 0 0 40px rgba(0, 200, 80, 0.3), inset 0 0 30px rgba(0, 200, 80, 0.08);
}

/* Boton buscar - Pantalla 1 - Cian */
#searchBtn {
    background: rgba(0, 200, 220, 0.12);
    color: #00e5f5;
    border: 1px solid rgba(0, 210, 230, 0.35);
    padding: 20px 40px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 200, 220, 0.15), inset 0 0 20px rgba(0, 200, 220, 0.05);
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(0, 220, 240, 0.5);
}

#searchBtn:hover {
    transform: translateY(-3px);
    background: rgba(0, 200, 220, 0.22);
    border-color: rgba(0, 220, 240, 0.6);
    box-shadow: 0 0 40px rgba(0, 200, 220, 0.3), inset 0 0 30px rgba(0, 200, 220, 0.08);
}

.btn-secondary, #backBtn, #updateCancelBtn {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 16px 30px;
    border-radius: 100px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover, #backBtn:hover, #updateCancelBtn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Info Section (Confirmation Step) */
.driver-info {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 30px;
    padding: 25px;
    border: 1px solid var(--glass-border);
    max-width: 550px;
    margin: 0 auto;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.info-row:last-child { border: none; }
.info-row span { color: var(--text-secondary); font-size: 0.9rem; }
.info-row strong { font-weight: 600; color: #fff; }

/* Progress & Console */
.log-console {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    height: 220px;
    overflow-y: auto;
    text-align: left;
    margin-top: 20px;
}

.log-line {
    margin-bottom: 8px;
    opacity: 0.9;
}

/* ── Premium Checkbox Group ── */
.checkbox-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.premium-checkbox {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkbox-box svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

/* Hover State */
.premium-checkbox:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Checked State */
.premium-checkbox input[type="checkbox"]:checked ~ .checkbox-box {
    background: rgba(0, 200, 220, 0.4);
    border-color: #00e5f5;
    box-shadow: 0 0 15px rgba(0, 220, 240, 0.6), inset 0 0 10px rgba(0, 200, 220, 0.2);
}

.premium-checkbox input[type="checkbox"]:checked ~ .checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

.premium-checkbox input[type="checkbox"]:checked ~ .checkbox-label {
    color: var(--text-primary);
    font-weight: 600;
}

.premium-checkbox input[type="checkbox"]:checked ~ .premium-checkbox {
    background: rgba(0, 200, 220, 0.1);
    border-color: rgba(0, 210, 230, 0.3);
}

/* SSE Log Enhancements */
.log-line.system { color: #818cf8; font-weight: 600; }
.log-line.success { color: #34d399; }
.log-line.warn { color: #fbbf24; }
.log-line.error { color: #f87171; }
.log-line.info { color: #e2e8f0; }

.progress-bar-container {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 30px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Utils */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.6s ease-out; }

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast (Refined Glass) */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 18px 30px;
    border-radius: 100px;
    color: #fff;
    z-index: 10000;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error { border-color: rgba(248, 113, 113, 0.3); }
.toast.success { border-color: rgba(74, 222, 128, 0.3); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Estilos Premium Especiales para Modo Prueba ── */
#chkModoPrueba:checked ~ .checkbox-box {
    background: rgba(245, 158, 11, 0.4) !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6), inset 0 0 10px rgba(245, 158, 11, 0.2) !important;
}

#chkModoPrueba:checked ~ .checkbox-box svg,
#chkModoPrueba:checked ~ .checkbox-box i {
    opacity: 1 !important;
    transform: scale(1) !important;
    color: #ffffff !important;
}

#chkModoPrueba:checked ~ .checkbox-label {
    color: #fbbf24 !important;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}