:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --border: #e2e8f0;
    --success: #16a34a;
    --error: #dc2626;
    --radius: 10px;
    --shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.topbar .brand { font-weight: 700; color: var(--brand); }

.lang-switch a {
    color: var(--muted);
    text-decoration: none;
    margin-left: .75rem;
    font-size: .875rem;
}
.lang-switch a.active { color: var(--ink); font-weight: 600; }
.lang-switch a:hover { color: var(--brand); }

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
.subheading { color: var(--muted); margin: 0 0 1.5rem; }
.module-name { font-weight: 600; color: var(--ink); }

label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: .375rem;
    color: var(--ink);
}

select, .button {
    width: 100%;
    padding: .65rem .75rem;
    font-size: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
    font-family: inherit;
}

select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.field { margin-bottom: 1rem; }

.button {
    background: var(--brand);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    margin-top: .5rem;
}
.button:hover:not(:disabled) { background: var(--brand-dark); }
.button:disabled { opacity: .6; cursor: progress; }

.button-secondary {
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--border);
}
.button-secondary:hover { background: var(--bg); }

.cf-turnstile { margin: 1rem 0; }

.note { font-size: .8125rem; color: var(--muted); margin-top: 1rem; }

.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .875rem;
}
.alert-error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.cred {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin: .5rem 0;
    font-family: ui-monospace, monospace;
    font-size: .875rem;
}
.cred .k { color: var(--muted); display: inline-block; min-width: 80px; }

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

.module-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.module-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.module-list li:last-child { border-bottom: none; }
.module-list a { color: var(--brand); text-decoration: none; font-weight: 600; }
.module-list a:hover { text-decoration: underline; }

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: .5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
