:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --text: #132238;
    --muted: #64748b;
    --line: #d8e0eb;
    --primary: #0b5cad;
    --primary-dark: #063e7a;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #dc2626;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}
.hero {
    background: linear-gradient(135deg, #052b57, #0b5cad 58%, #1e88e5);
    color: #fff;
    padding: 42px 0 54px;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 360px);
    gap: 28px;
    align-items: center;
}
.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .78rem;
    font-weight: 700;
    color: inherit;
    opacity: .8;
}
h1, h2, h3 { line-height: 1.18; margin-top: 0; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.6rem); margin-bottom: 10px; }
.subtitle { font-size: 1.25rem; margin: 0; opacity: .95; }
.hero-text { max-width: 760px; opacity: .88; }
.hero-card {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.24);
    border-radius: var(--radius);
    padding: 20px;
    backdrop-filter: blur(8px);
}
.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255,255,255,.18);
}
.meta-row:last-child { border-bottom: 0; }
.page-shell { margin-top: -26px; margin-bottom: 50px; }
.card {
    background: var(--card);
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    margin-bottom: 22px;
}
.intro-card { border-top: 5px solid var(--accent); }
.section-title { margin-bottom: 18px; }
.section-title span {
    display: inline-block;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 7px;
    text-transform: uppercase;
    font-size: .82rem;
    letter-spacing: .08em;
}
.section-title h2 { margin-bottom: 6px; }
.section-title p { margin: 0; color: var(--muted); }
.scale-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 18px;
}
.scale-grid div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}
.scale-grid strong {
    display: block;
    color: var(--primary);
    font-size: 1.45rem;
}
.scale-grid span { color: var(--muted); font-size: .9rem; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.compact-grid { margin-top: 18px; }
.full-width { grid-column: 1 / -1; }
label, legend {
    display: block;
    font-weight: 700;
    color: #22324a;
}
input[type="text"], input[type="date"], input[type="password"], select, textarea {
    width: 100%;
    margin-top: 7px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
    color: var(--text);
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(11, 92, 173, .18);
    border-color: var(--primary);
}
.required { color: var(--danger); }
.project-box {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}
.project-box legend { padding: 0 8px; }
.project-box label, .consent-box { font-weight: 600; }
.hidden { display: none !important; }
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.table-wrap { overflow-x: auto; }
.rating-table, .admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1040px;
}
.rating-table th, .rating-table td, .admin-table th, .admin-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    vertical-align: top;
    text-align: left;
}
.rating-table thead th, .admin-table thead th {
    background: #eef5ff;
    color: #17365f;
    font-size: .92rem;
}
.col-no { width: 54px; }
.col-note { width: 210px; }
.rating-table td:nth-child(n+3):nth-child(-n+7), .rating-table th:nth-child(n+3):nth-child(-n+7) {
    text-align: center;
    width: 54px;
}
.rating-cell label {
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}
.rating-cell input { position: absolute; opacity: 0; }
.rating-cell span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #b6c4d8;
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    background: #fff;
    color: #334155;
}
.rating-cell input:checked + span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.textarea-list {
    display: grid;
    gap: 16px;
}
.consent-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.consent-box input { margin-top: 4px; }
.score-grid, .metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.score-card, .metric-card {
    border: 1px solid var(--line);
    background: #f8fafc;
    border-radius: 15px;
    padding: 16px;
}
.score-card span, .metric-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    font-size: .9rem;
}
.score-card strong, .metric-card strong {
    display: block;
    margin: 7px 0 3px;
    color: var(--primary-dark);
    font-size: 1.55rem;
}
.score-card small { color: var(--muted); }
.score-card.highlight {
    background: #ecfdf5;
    border-color: #9ee7c5;
}
.action-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px;
    background: rgba(243, 246, 251, .88);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    z-index: 5;
}
.btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 20px;
    font-weight: 800;
    font-size: .96rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-dark); }
.secondary { background: #e7f1ff; color: var(--primary-dark); }
.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.full-btn { width: 100%; }
.footer {
    padding: 28px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
}
.footer .container {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.simple-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 0;
}
.thanks-card, .error-card { max-width: 720px; margin: 0 auto; text-align: center; }
.success-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #dcfce7;
    color: #166534;
    font-size: 2rem;
    font-weight: 900;
}
.ref-box {
    display: inline-block;
    background: #eef5ff;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
}
.notice {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 14px 0;
}
.notice.success { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }
.notice.warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.login-shell { width: min(460px, calc(100% - 32px)); margin: 0 auto; }
.login-card { margin: 0; }
.login-form { display: grid; gap: 14px; }
.small-text { font-size: .9rem; color: var(--muted); }
.admin-header {
    background: #0f2d52;
    color: #fff;
    padding: 26px 0;
}
.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
.admin-nav nav { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-main { padding: 26px 0 50px; }
.badge, .pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .85rem;
    background: #eef5ff;
    color: #17365f;
    font-weight: 800;
}
.badge.good { background: #dcfce7; color: #166534; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 900px) {
    .hero-grid, .form-grid, .score-grid, .metric-grid { grid-template-columns: 1fr; }
    .scale-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-nav { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 620px) {
    .container { width: min(100% - 20px, 1180px); }
    .card { padding: 18px; border-radius: 14px; }
    .action-bar { flex-direction: column; }
    .btn { width: 100%; }
    .scale-grid { grid-template-columns: 1fr; }
}
@media print {
    .hero, .footer, .action-bar { display: none; }
    body { background: #fff; }
    .page-shell { margin: 0; width: 100%; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
