/* ==================================================== */
/* === STICKER STYLES (Optimizados para VELOCIDAD Móvil) === */
/* ==================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    /* Bordes redondeados más suaves */
    --radius-sm: 8px;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Eliminar highlight gris en móvil */
}

body {
    background-color: var(--bg-light);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    height: 100vh;
    /* Altura total fija */
    overflow-y: auto;
    /* Scroll solo si es estrictamente necesario */
    display: flex;
    flex-direction: column;
}

.container {
    padding: 0.5rem;
    /* Margen mínimo */
    max-width: 600px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- TÍTULOS Y HEADER --- */
.app-header {
    text-align: center;
    margin-bottom: 0.5rem;
    padding-top: 0.5rem;
}

.app-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- TARJETAS DE PASOS --- */
.step-content {
    display: none;
    /* JS controla esto */
    flex: 1;
    flex-direction: column;
}

.step-content.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: white;
    border-radius: var(--radius);
    padding: 0.8rem;
    /* Padding reducido */
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
    flex: 1;
    /* Ocupar espacio disponible */
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1rem;
    /* Título más compacto */
    font-weight: 700;
    margin: 0 0 0.2rem 0;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

/* --- CÁMARA (Full Integrada) --- */
#videoContainer {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 120%;
    /* Aspect ratio vertical para móvil */
    background: black;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.5rem;
    flex: 1;
}

#cameraVideo,
#cameraCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Llenar todo el espacio */
}

/* Botón Captura Flotante (Overlay) */
.btn-capture-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: transform 0.1s;
}

.btn-capture-overlay:active {
    transform: translateX(-50%) scale(0.9);
}

.btn-capture-inner {
    width: 54px;
    height: 54px;
    background: var(--primary);
    border-radius: 50%;
}

/* --- RESÚMENES COMPACTOS --- */
.prev-step-summary {
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.prev-step-icon {
    display: none;
    /* Ocultar icono para ahorrar espacio */
}

.prev-step-content {
    flex: 1;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
}

.summary-item {
    line-height: 1.1;
}

.summary-item strong {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.summary-item span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}


/* --- GRID DE OPCIONES (Soporte, etc.) --- */
.options-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow-y: auto;
    /* Scroll interno si es necesario */
}

.option-btn {
    padding: 0.6rem 0.5rem;
    /* Muy compacto */
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
}

.option-btn:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
    font-weight: 700;
}

.check-icon {
    font-size: 0.8rem;
    display: none;
}

.option-btn:has(input:checked) .check-icon {
    display: block;
}


/* --- LISTAS SELECCIONABLES (Arm, Tech) --- */
.scroll-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    padding-bottom: 5px;
}

.arm-option,
.tech-option {
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    background: white;
    font-size: 0.9rem;
}

.arm-option:has(input:checked),
.tech-option:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
}

.arm-number {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    margin-right: 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tech-content {
    flex: 1;
}

.tech-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0;
}

.tech-desc {
    display: none;
    /* Ocultar descripciones largas en modo compacto */
}


/* --- WATTS GRID (Muy compacto) --- */
.watts-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5 cols para aprovechar ancho */
    gap: 6px;
}

.watt-btn {
    aspect-ratio: 1.2;
    /* Un poco más rectangular */
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
}

.watt-btn:has(input:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}


/* --- PASO FINAL (Estado y Medición) --- */
.final-step-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.final-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 0.4rem 0 0.2rem 0;
}

/* Condición (Pills horizontales) */
.condition-grid {
    display: flex;
    gap: 8px;
}

.pill-option {
    flex: 1;
    padding: 0.6rem;
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.pill-option:has(input:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Status (Tarjetas grandes pero cortas) */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.status-card {
    padding: 0.8rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.status-card i {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.status-card:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
}

.status-card:has(input:checked) i {
    color: var(--primary);
}

.status-card span {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Medición (Grid 2x2) */
.measurement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex: 1;
    /* Ocupar espacio restante vertical */
}

.measurement-card {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.measurement-card:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
}

.measure-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.measure-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}


/* --- BOTONES DE CONTROL (MEJORADOS) --- */
.btn-container {
    display: flex;
    gap: 12px;
    padding-top: 10px;
    margin-top: auto;
    /* Empujar al fondo si sobra espacio */
}

.btn {
    padding: 0.9rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botón Volver */
.btn-secondary,
.btn-prev {
    background: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid #cbd5e1;
    min-width: 60px;
    /* Ancho cómodo para el dedo */
    font-size: 0.9rem;
}

.btn-secondary:active,
.btn-prev:active {
    background: #e2e8f0;
    transform: scale(0.96);
}

/* Botón Guardar Principal */
.btn-final-submit {
    flex: 1;
    /* Ocupar todo el espacio restante */
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    /* Gradiente Verde */
    color: white;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.4), 0 2px 4px -1px rgba(22, 163, 74, 0.2);
    border: none;
}

.btn-final-submit:active {
    transform: scale(0.98) translateY(2px);
    box-shadow: 0 2px 4px -1px rgba(22, 163, 74, 0.4);
}

.btn-final-submit i {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Utility: Ocultar inputs radio/checkbox reales */
input[type="radio"],
input[type="checkbox"] {
    display: none;
}