/*
 * train-rtae.into3.ai — research mode theming.
 *
 * Deliberately distinct from production RTAE: cooler palette,
 * "RESEARCH MODE" badge, larger type, less production polish.
 * Visual signal that this is a research instrument, not a product.
 */

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

:root {
    --bg: #0f1419;
    --surface: #1a212b;
    --surface-2: #232c38;
    --accent: #4ade80;
    --accent-dim: #2d8e54;
    --text: #e6edf3;
    --text-dim: #8b96a6;
    --border: #2c3744;
    --error: #f87171;
    --warning: #fbbf24;
    --radius: 12px;
    --radius-sm: 6px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Persistent top bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.research-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--accent-dim);
    color: white;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.research-badge::before {
    content: '●';
    color: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.lang-toggle {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.lang-toggle:hover { background: var(--surface-2); }

/* Main column */
.container {
    flex: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 32px 0 16px;
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 32px;
}

.lede {
    background: var(--surface);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 15px;
}

ul.what-we-record, ul.privacy-notes {
    list-style: none;
    padding: 0;
}

ul.what-we-record li, ul.privacy-notes li {
    padding: 10px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

ul.what-we-record li::before {
    content: '●';
    color: var(--accent);
    font-size: 8px;
    margin-top: 8px;
}

ul.privacy-notes li::before {
    content: '✓';
    color: var(--accent);
    font-weight: 700;
    margin-top: 1px;
}

button.primary, .button.primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: var(--accent);
    color: #0f1419;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.05s;
    width: 100%;
    margin-top: 24px;
}

button.primary:hover, .button.primary:hover {
    background: #5ee990;
}

button.primary:active, .button.primary:active {
    transform: scale(0.99);
}

button.primary:disabled {
    background: var(--surface-2);
    color: var(--text-dim);
    cursor: not-allowed;
}

button.secondary, .button.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    margin-top: 12px;
}

button.secondary:hover, .button.secondary:hover {
    background: var(--surface);
}

input[type="text"] {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 16px 18px;
    border-radius: var(--radius);
    font-size: 24px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    text-align: center;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 16px 0;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

label.check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 10px;
    cursor: pointer;
}

label.check input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.error-msg {
    color: var(--error);
    background: rgba(248, 113, 113, 0.1);
    border-left: 3px solid var(--error);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    display: none;
}

.error-msg.show { display: block; }

.muted {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 16px;
    text-align: center;
}

.muted a {
    color: var(--text);
    text-decoration: underline;
}

/* Camera preview (M2.2) */
.preview-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 16px 0 8px;
}

.preview-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);  /* mirror so it feels natural */
}

/* Audio level meter */
.meter-wrap {
    position: relative;
    width: 100%;
    height: 14px;
    background: var(--surface);
    border-radius: 999px;
    margin: 16px 0 8px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    transition: width 0.08s linear;
}

/* Quality yes/no question rows */
.quality-q {
    margin: 24px 0;
}

.q-label {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text);
}

.q-buttons {
    display: flex;
    gap: 12px;
}

.qbtn {
    flex: 1;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 0;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
}

.qbtn:hover { background: var(--surface-2); }

.qbtn.selected {
    background: var(--accent);
    color: #0f1419;
    border-color: var(--accent);
}

/* Self-report sliders */
.slider-row {
    margin: 24px 0;
}

.slider-label {
    display: block;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

.slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--surface);
    border-radius: 999px;
    outline: none;
    margin: 8px 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 3px solid var(--bg);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 3px solid var(--bg);
}

.slider-ends {
    display: flex;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 4px;
}

/* Session recording UI (M2.3a) */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rec-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    background: rgba(248, 113, 113, 0.12);
    padding: 4px 12px;
    border-radius: 999px;
}

.rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: rec-pulse 1.4s ease-in-out infinite;
}

@keyframes rec-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.rec-timer {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-left: 4px;
}

.session-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 900px;
}

.session-camera {
    width: 240px;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    align-self: flex-end;
}

.session-camera video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.study-area {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim);
    font-size: 15px;
}

button.primary.danger {
    background: #ef4444;
    color: white;
}

button.primary.danger:hover {
    background: #f87171;
}

@media (max-width: 600px) {
    .session-camera {
        width: 140px;
        align-self: center;
    }
    .study-area {
        padding: 20px;
        min-height: 240px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 26px; }
    .container { padding: 24px 16px; }
    input[type="text"] { font-size: 20px; }
}
