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

:root {
    --bg: #faf8f5;
    --bg-card: #ffffff;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --accent: #8b4513;
    --accent-light: #d4a574;
    --border: #e0dcd7;
    --success: #2d6a4f;
    --warning: #e07c24;
    --danger: #c0392b;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    text-align: center;
    padding: 2rem 0 1rem;
    border-bottom: 2px solid var(--accent-light);
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    color: white;
}

.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.3rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-box {
    text-align: center;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-box .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-box .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Recording */
.recorder {
    text-align: center;
    padding: 2rem;
}

.rec-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--danger);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.rec-btn::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    background: var(--danger);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s;
}

.rec-btn.recording::after {
    width: 30px;
    height: 30px;
    border-radius: 4px;
}

.rec-btn.recording {
    border-color: var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(192, 57, 43, 0); }
}

.timer {
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin: 1rem 0;
    color: var(--text-muted);
}

/* Visualizer */
.visualizer {
    height: 60px;
    margin: 1rem 0;
}

.visualizer canvas {
    width: 100%;
    height: 100%;
}

/* Admin */
.testimony-list {
    list-style: none;
}

.testimony-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.testimony-item:hover { background: var(--bg); }

.testimony-item .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending { background: #ffeaa7; color: #6b5900; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-failed { background: #f8d7da; color: #721c24; }
.badge-transcribing { background: #d1ecf1; color: #0c5460; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 { margin-bottom: 1rem; }

/* Steps */
.steps {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
}

.step {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid var(--border);
}

.step.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.step.done {
    color: var(--success);
    border-bottom-color: var(--success);
}

/* Sections */
.section { display: none; }
.section.active { display: block; }

/* Languages */
.language-tag {
    display: inline-block;
    background: var(--accent-light);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    margin: 0.2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    header h1 { font-size: 1.4rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
