/* ====== Base Reset & Variables ====== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0f172a;
    --bg-alt: #020617;
    --card-bg: #ffffff;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --accent-dark: #1d4ed8;
    --text-main: #0f172a;
    --text-muted: #6b7280;
    --border-subtle: #e5e7eb;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.25);
    --radius-lg: 1.5rem;
    --radius-pill: 999px;
    --transition-fast: 150ms ease-out;
    --max-width: 900px;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ====== Layout / Body ====== */
html, body {
    height: 100%;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at top, #1e293b 0, #020617 45%, #000 100%);
    color: var(--text-main);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem;
}

/* ====== Container ====== */
.container, main {
    width: 100%;
    max-width: var(--max-width);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2rem 2.25rem;
    margin: 1.5rem auto 3rem;
}

/* ====== Headings ====== */
h1 {
    margin-top: 0;
    font-size: 1.6rem;
    line-height: 1.2;
}

/* ====== Progress bar ====== */
.progress-container {
    background: #ffffff;
    border-bottom: 1px solid #dde1e7;
    padding: 0.75rem 1.5rem;
}
.progress-track {
    width: 100%;
    height: 8px;
    background: #e1e6f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
}
.progress-label {
    font-size: 0.85rem;
    color: #555;
}

/* ====== Form Blocks ====== */
.block {
    border: 1px solid #dde1e7;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    background: #fafbff;
}
.block > legend, .question legend {
    font-weight: 600;
}
.question { margin-bottom: 1rem; }
label { font-size: 0.95rem; }
.inline { margin-left: 0.75rem; }
.indent { margin-left: 1.5rem; }
.sub-question { margin-top: 0.4rem; }
.hint { font-size: 0.8rem; color: #666; margin-left: 0.3rem; }
.small { font-size: 0.85rem; }

.short-input { max-width: 220px; }
.xxshort-input { max-width: 80px; }
.inline-input { max-width: 160px; margin-left: 0.3rem; }

input[type="text"],
input[type="number"],
input[type="month"],
input[type="date"],
select {
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #c7ccd7;
    font-size: 0.95rem;
    background: #fff;
    color: #111;
}
input:disabled {
    background: #eaecef;
}

/* ====== Buttons ====== */
button {
    font: inherit;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-pill);
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-weight: 600;
    transition: background-position var(--transition-fast), transform var(--transition-fast);
    background-size: 150% 150%;
    background-position: 0% 50%;
}
button:hover {
    transform: translateY(-1px);
    background-position: 100% 50%;
}
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ====== Login Button ====== */
#login {
    margin-top: 0.25rem;
    padding: 0.9rem 1.6rem;
    font-size: 0.98rem;
    box-shadow: 0 10px 25px rgba(37,99,235,0.45);
}
#login::after {
    content: "→";
    font-size: 1.05em;
    margin-left: 0.4rem;
    transition: transform var(--transition-fast);
}
#login:hover::after { transform: translateX(3px); }

/* ====== Tables ====== */
.substance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.substance-table th,
.substance-table td {
    border: 1px solid #d0d4de;
    padding: 0.4rem 0.5rem;
}
.substance-table th {
    background: #f1f3f9;
    text-align: left;
}

/* ====== Footer, Notes, Responsive ====== */
.note {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.9rem 1rem;
    border-radius: 0.9rem;
    background: var(--accent-soft);
    border: 1px solid rgba(37, 99, 235, 0.18);
    line-height: 1.5;
}

footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
}
footer small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    body { padding: 1rem; }
    .container, main {
        padding: 1.6rem 1.4rem;
        border-radius: 1.1rem;
    }
    h1 { font-size: 1.35rem; }
    #login { width: 100%; justify-content: center; }
}
