/* ==============================================================================
   Electra Videoperitaciones - Estilos Móviles Responsive (Mobile-First)
   ============================================================================== */

:root {
    --electra-primary: #0d6efd;
    --electra-primary-hover: #0b5ed7;
    --electra-dark: #121820;
    --electra-card-bg: rgba(22, 28, 36, 0.92);
    --electra-border: rgba(255, 255, 255, 0.12);
    --electra-success: #198754;
    --electra-danger: #dc3545;
    --electra-warning: #ffc107;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--electra-dark);
    color: #f8f9fa;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Pantalla de Bienvenida / Login */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0d6efd, #0043a8);
    border-radius: 18px;
    color: white;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.35);
    margin-bottom: 12px;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: #adb5bd;
    margin-top: 4px;
}

.auth-card {
    background: var(--electra-card-bg);
    border: 1px solid var(--electra-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ced4da;
    margin-bottom: 6px;
}

.form-control-custom {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--electra-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control-custom:focus {
    border-color: var(--electra-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

.pin-input {
    letter-spacing: 6px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
}

.btn-primary-custom {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.35);
    transition: transform 0.1s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary-custom:active {
    transform: scale(0.98);
}

.btn-secondary-custom {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--electra-border);
    border-radius: 12px;
    color: #e9ecef;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Modal RGPD */
.rgpd-box {
    background: rgba(13, 110, 253, 0.08);
    border: 1px solid rgba(13, 110, 253, 0.25);
    border-radius: 14px;
    padding: 14px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #cfe2ff;
    margin-bottom: 16px;
}

/* ==============================================================================
   Pantalla de Videollamada a Pantalla Completa
   ============================================================================== */
.video-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#localVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#remoteVideoSmall {
    position: absolute;
    top: 70px;
    right: 16px;
    width: 90px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 110;
    background: #212529;
}

/* Canvas del Puntero Láser Virtual */
#laserCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 105;
}

/* Barra Superior Flotante */
.call-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 120;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--electra-warning);
}

.status-dot.active {
    background-color: #20c997;
    box-shadow: 0 0 8px #20c997;
}

/* Barra de Controles Inferior */
.call-controls-overlay {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 120;
}

.control-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s, background-color 0.2s;
}

.control-btn:active {
    transform: scale(0.92);
}

.control-btn.active {
    background: #ffc107;
    color: #212529;
}

.control-btn-danger {
    background: #dc3545;
    width: 60px;
    height: 60px;
}

/* ==============================================================================
   Asistente Fotográfico Asíncrono
   ============================================================================== */
.wizard-card {
    background: var(--electra-card-bg);
    border: 1px solid var(--electra-border);
    border-radius: 20px;
    padding: 20px;
    margin-top: 16px;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
    z-index: 2;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 4px;
}

.step-item.active .step-circle {
    background: var(--electra-primary);
    color: white;
}

.step-item.completed .step-circle {
    background: var(--electra-success);
    color: white;
}

.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 30px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-dropzone:hover {
    border-color: var(--electra-primary);
}

.preview-thumb {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 12px;
    border: 1px solid var(--electra-border);
}
