:root {
    --primary: #1a56db;
    --primary-dark: #1040a8;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1f2430;
    --muted: #5b6472;
    --border: #d4d9e0;
    --error: #b42318;
    --success: #067647;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
}

.tagline {
    color: var(--muted);
    margin-left: .75rem;
    font-size: .9rem;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.lang-switch {
    display: inline-flex;
    gap: .25rem;
    font-size: .85rem;
}

.lang-switch a {
    color: var(--muted);
    text-decoration: none;
    padding: .15rem .45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.lang-switch a.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

main { padding: 1.5rem 0 3rem; }

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .85rem;
    padding: 1rem 0;
    background: var(--surface);
}

h1, h2, h3 { line-height: 1.3; }

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

label { display: block; font-weight: 600; margin-bottom: .25rem; }

.hint { color: var(--muted); font-weight: 400; font-size: .9rem; margin: 0 0 .5rem; }

input[type="text"], input[type="email"], input[type="date"], input[type="time"],
textarea, select {
    width: 100%;
    padding: .5rem .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: var(--surface);
    color: var(--text);
}

textarea { min-height: 8rem; resize: vertical; }

input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

button, .btn {
    display: inline-block;
    background: var(--primary);
    border: none;
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: .55rem 1.1rem;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
}

button:hover, .btn:hover { background: var(--primary-dark); color: #fff; }

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

.btn-danger { background: var(--error); }
.btn-danger:hover { background: #8f1b12; color: #fff; }

.error-list {
    background: #fef3f2;
    border: 1px solid #fda29b;
    color: var(--error);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}

.error-list ul { margin: .25rem 0 0; padding-left: 1.25rem; }

.field-error { color: var(--error); font-size: .9rem; margin: .25rem 0 0; }

.notice {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: var(--success);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}

.question { margin-bottom: 1.5rem; }
.question fieldset { border: none; padding: 0; margin: 0; }
.question legend { font-weight: 600; padding: 0; margin-bottom: .5rem; }

.choice { display: flex; align-items: flex-start; gap: .5rem; margin: .35rem 0; }
.choice input[type="radio"], .choice input[type="checkbox"] { margin-top: .35rem; }
.choice input[type="text"] { max-width: 22rem; margin-left: .25rem; }

.scale { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.scale label { display: flex; align-items: center; gap: .25rem; font-weight: 400; margin: 0; }
.scale-labels { color: var(--muted); font-size: .85rem; display: flex; justify-content: space-between; max-width: 320px; }

.rating { display: flex; flex-direction: row-reverse; gap: .15rem; justify-content: flex-end; }
.rating input { position: absolute; opacity: 0; }
.rating label {
    font-size: 1.6rem;
    color: var(--border);
    cursor: pointer;
    margin: 0;
}
.rating label:hover, .rating label:hover ~ label,
.rating input:checked ~ label, .rating input:focus ~ label { color: #f5a623; }

table.grid { width: 100%; border-collapse: collapse; margin: .5rem 0; }
table.grid th, table.grid td { border: 1px solid var(--border); padding: .4rem .6rem; text-align: left; }
table.grid th:first-child, table.grid td:first-child { font-weight: 400; }

.markdown-preview h3 { margin-top: 1.25rem; }
.markdown-preview ul { padding-left: 1.25rem; }

.credential-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: .75rem 0 1.25rem;
    word-break: break-all;
}

.warning-box {
    background: #fffaeb;
    border: 1px solid #fdb022;
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}

.submissions-table { width: 100%; border-collapse: collapse; }
.submissions-table th, .submissions-table td { border-bottom: 1px solid var(--border); padding: .5rem .6rem; text-align: left; font-size: .95rem; }
.submissions-table form { display: inline; }

pre.markdown-output {
    background: #101418;
    color: #e6e9ef;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    white-space: pre-wrap;
}

.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }

@media (max-width: 600px) {
    .scale { gap: .5rem; }
    .choice input[type="text"] { max-width: 100%; }
}
