/* Stylish design: #0E21A0 accent */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --accent: #0E21A0;
    --accent-hover: #1a2fb8;
    --accent-light: #e8eaf6;
    --accent-glow: rgba(14, 33, 160, 0.12);
    --white: #ffffff;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --text: #1e2243;
    --text-muted: #5c5f7a;
    --border: #e4e6ef;
    --border-focus: #0E21A0;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --shadow: 0 2px 8px rgba(14, 33, 160, 0.06);
    --shadow-lg: 0 8px 32px rgba(14, 33, 160, 0.1);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 24px;
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 32px 40px;
    overflow-x: auto;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
    border-radius: 16px 16px 0 0;
}

h1 {
    text-align: center;
    color: var(--text);
    margin-bottom: 24px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h1::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: var(--radius-pill);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 13px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

thead {
    background: var(--accent);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
}

th:first-child {
    min-width: 88px;
    text-align: left;
    padding-left: 16px;
    text-transform: none;
    letter-spacing: 0;
}

td {
    padding: 10px;
    border: none;
    border-bottom: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    transition: background var(--transition);
}

td:first-child {
    background-color: var(--bg-card);
    font-weight: 600;
    color: var(--text);
    text-align: left;
    padding-left: 16px;
    font-size: 12px;
    border-left: 4px solid var(--accent-light);
}

tr.num-options-3 td:nth-child(6),
tr.num-options-3 td:nth-child(7) {
    display: none;
}
tr.num-options-4 td:nth-child(7) {
    display: none;
}

.options-cell {
    background-color: var(--bg-card);
    min-width: 68px;
}

.row-options-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.row-options-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

tbody tr:nth-child(even) {
    background-color: var(--bg-card);
}

tbody tr:hover {
    background-color: var(--accent-glow);
}

.button-group {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.option-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 46px;
}

.option-btn:hover {
    background-color: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.option-btn.selected {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.option-btn.selected.true-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.option-btn.selected.false-btn {
    background: var(--white);
    border-color: var(--border);
    color: var(--text-muted);
}

/* Setup bar */
.setup-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px 22px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.setup-controls label {
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
}

.setup-controls input[type="number"] {
    width: 72px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--white);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.setup-controls input[type="number"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.setup-controls select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    min-width: 52px;
    background: var(--white);
    color: var(--text);
}

.setup-controls button {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition), transform 0.1s ease;
}

.setup-controls button:hover {
    background: var(--accent-hover);
}

.setup-controls button:active {
    transform: scale(0.98);
}

/* Action buttons */
.controls {
    margin-bottom: 24px;
    text-align: center;
}

.controls button {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin: 0 6px;
    transition: all var(--transition);
}

.controls button:hover {
    background: var(--accent-hover);
}

.controls button:active {
    transform: scale(0.98);
}

.controls button:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* PDF / upload pages */
.pdf-container { max-width: 820px; margin: 0 auto; }
.pdf-subtitle { text-align: center; color: var(--text-muted); margin-top: -8px; margin-bottom: 20px; font-size: 0.95em; }
.pdf-controls { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 15px; flex-wrap: wrap; }
.pdf-file {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background var(--transition);
}
.pdf-file:hover { background: var(--accent-hover); }
.pdf-file input { display: none; }
.pdf-controls button {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
}
.pdf-controls button:hover { background: var(--accent-hover); }
.pdf-controls button:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}
.pdf-options { display: flex; justify-content: center; margin-bottom: 12px; }
.pdf-option { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text); }
.pdf-option input {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    min-width: 260px;
    background: var(--white);
    color: var(--text);
}
.pdf-option input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.pdf-status { text-align: center; font-size: 14px; color: var(--text-muted); }
.pdf-status.error { color: var(--accent); font-weight: 600; }
