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

/* ── Variables ──────────────────────────────────────────────────────── */
:root {
    --bg: #f7f5f2;
    --surface: #ffffff;
    --border: #e4e1dc;
    --border-strong: #c8c4bc;
    --text: #1a1814;
    --text-muted: #6b6760;
    --text-faint: #a8a49f;
    --accent: #2d6a4f;
    --accent-light: #e8f4ee;
    --accent-hover: #235c43;
    --danger: #c0392b;
    --radius: 8px;
    --radius-sm: 5px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --font: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --warning-bg: #fef9ed;
    --warning-border: #f0d070;
}

/* ── Base ───────────────────────────────────────────────────────────── */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Nav ────────────────────────────────────────────────────────────── */
nav {
    background: var(--bg);
    border-bottom: none;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(to bottom, var(--bg), transparent);
    pointer-events: none;
}

.nav-brand {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ── Language switcher ──────────────────────────────────────────────── */
.lang-switcher {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
    gap: 1px;
}

.lang-btn {
    background: none;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.lang-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.nav-user {
    font-size: 13px;
    color: var(--text-muted);
}

.nav-logout {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.nav-logout:hover {
    background: var(--bg);
    color: var(--text);
}

/* ── Layout ─────────────────────────────────────────────────────────── */
main {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary { background: var(--text); color: white; }
.btn-primary:hover { background: #333; }

.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-hover); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Form fields ────────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ── File drop zone ─────────────────────────────────────────────────── */
.file-input-wrapper {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.15s;
    cursor: pointer;
    background: var(--bg);
}

.file-input-wrapper:hover,
.file-input-wrapper.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.file-input-wrapper input[type="file"] { display: none; }

.file-input-label { font-size: 14px; color: var(--text-muted); }
.file-input-label strong { color: var(--accent); cursor: pointer; }

.file-name {
    font-size: 13px;
    color: var(--text);
    margin-top: 8px;
    font-family: var(--font-mono);
}

.file-formats {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-faint);
}

/* ── Radio groups ───────────────────────────────────────────────────── */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.radio-option:hover {
    border-color: var(--border-strong);
    background: var(--bg);
}

.radio-option input[type="radio"] {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.radio-option.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

.radio-label {
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    flex: 1;
}

/* ── Progress ───────────────────────────────────────────────────────── */
.progress-track {
    background: var(--border);
    border-radius: 99px;
    height: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.4s ease;
}

.progress-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.upload-progress {
    display: none;
    margin-top: 16px;
}

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-queued    { background: #f5f0e8; color: #9a7d3a; }
.badge-processing { background: #e8f0fe; color: #2d5ab0; }
.badge-complete  { background: var(--accent-light); color: var(--accent); }
.badge-failed    { background: #fde8e8; color: var(--danger); }

.badge-deleted::before {
    display: none;
}

.badge-deleted {
    background: #f0f0f0;
    color: var(--text-muted);
}

/* ── Jobs table ─────────────────────────────────────────────────────── */
.jobs-table { width: 100%; border-collapse: collapse; }

.jobs-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--border);
}

.jobs-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--bg);
    vertical-align: middle;
}

.jobs-table tr:last-child td { border-bottom: none; }
.jobs-table tr:hover td { background: var(--bg); }

.filename-cell {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Transcript box ─────────────────────────────────────────────────── */
.transcript-box {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    min-height: 200px;
    max-height: 480px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: var(--text);
}

.transcript-placeholder {
    color: var(--text-faint);
    font-style: italic;
    font-family: var(--font);
    font-size: 14px;
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid;
}

.alert-error {
    background: #fde8e8;
    border-color: #f5c0c0;
    color: #8b1a1a;
}

/* ── Login page ─────────────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-card h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.5;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-google:hover { background: var(--bg); border-color: var(--border-strong); }

.login-switch-account {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
 
.login-switch-account:hover {
    color: var(--accent);
    text-decoration: underline;
}

.google-icon { width: 18px; height: 18px; flex-shrink: 0; }

.login-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Dashboard job info ─────────────────────────────────────────────── */
.job-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.job-filename {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-date {
    font-size: 12px;
    color: var(--text-faint);
}

.download-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    nav { padding: 0 16px; }
    main { padding: 20px 16px 48px; }
    .card { padding: 18px; }
    .nav-user { display: none; }
    .jobs-table th:nth-child(2),
    .jobs-table td:nth-child(2) { display: none; }
    .login-card { padding: 32px 24px; }
}