:root {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --primary-color: #e94560;
    --text-color: #ffffff;
    --text-muted: #a0a0b0;
    --font-family: system-ui, -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    position: relative;
}

/* --- Control de Vistas --- */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.view.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

.view.hidden {
    display: none;
}

/* --- Cámara y Controles --- */
.camera-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #000;
}

video {
    width: 100%;
    display: block;
    transform: scaleX(-1); /* Efecto espejo natural */
}

.controls {
    text-align: center;
    margin-top: 20px;
}

.title { font-size: 2rem; margin-bottom: 5px; }
.subtitle { color: var(--text-muted); margin-bottom: 20px; }

/* --- Botones --- */
button {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:active:not(:disabled) { transform: scale(0.95); }
.btn-secondary { background-color: #333; color: white; margin-top: 20px;}

/* --- Loading --- */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* --- Credencial (Estilo exagerado) --- */
.credential-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    border: 4px solid var(--primary-color);
    padding: 20px;
    width: 100%;
    box-shadow: 0 0 50px rgba(233, 69, 96, 0.4);
    text-align: center;
}

.card-header h2 {
    color: var(--primary-color);
    letter-spacing: 2px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.snapshot-container img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid white;
    margin-bottom: 15px;
    transform: scaleX(-1);
}

.exaggerated-text {
    font-size: 2.5rem;
    text-transform: uppercase;
    color: #ffeb3b;
    text-shadow: 2px 2px 0px #000;
    margin-bottom: 10px;
}

.description { font-size: 1.1rem; margin-bottom: 20px; font-style: italic; }
.stats-box { background: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; text-align: left; }