/* BLS Liveness portal — минималистичный mobile-first стиль. */

:root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --text: #1a2233;
    --muted: #6b7280;
    --primary: #1e4fbf;
    --primary-hover: #173d96;
    --danger: #c13434;
    --border: #d7dce5;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    --space: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.4;
}

body {
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    display: flex;
    flex-direction: column;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: calc(var(--space) * 1.25);
    margin: var(--space);
    max-width: 520px;
    width: calc(100% - 32px);
    align-self: center;
}

h1 { margin: 0 0 12px; font-size: 1.35rem; }
.lead { color: var(--muted); margin: 0 0 20px; }

label {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 6px;
}

input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 79, 191, 0.15);
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--primary);
    padding: 10px;
}

button.primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.15s;
}

button.primary:hover { background: var(--primary-hover); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

button.link {
    background: transparent;
    color: var(--primary);
    padding: 8px 12px;
}

.error {
    background: #fdecec;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* ==== Header ==== */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--space);
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
header .client-name { font-weight: 600; }

/* ==== Videos list ==== */
.videos-list { margin-bottom: 20px; }
.video-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fafbfd;
}
.video-card .meta { font-size: 0.9rem; color: var(--muted); }
.video-card .status { font-weight: 600; }
.video-card .status.approved { color: #0a7a36; }
.video-card .status.declined { color: var(--danger); }
.video-card .status.processing { color: #8a6d1a; }
.video-card .status.error { color: var(--danger); }
.video-card .delete { color: var(--danger); }

/* ==== Recorder ==== */
.recorder {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.recorder.hidden { display: none; }

.recorder-stage {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recorder-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* selfie mirror */
}

.oval-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.countdown.hidden { display: none; }

.rec-status {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0,0,0,0.55);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
}

.recorder-controls {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background: #000;
    gap: 12px;
}
.recorder-controls button {
    flex: 1;
    padding: 14px;
    color: #fff;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
}
.recorder-controls #btn-start {
    background: var(--primary);
}

/* ==== Admin ==== */
.page-admin header { flex-direction: column; align-items: flex-start; gap: 6px; }
.metrics { color: var(--muted); font-size: 0.9rem; }
.result { margin-top: 20px; }
.result table { width: 100%; border-collapse: collapse; }
.result th, .result td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
