:root {
    --blue: #004b8d;
    --blue-dark: #003864;
    --green: #228c3b;
    --purple: #7a3fb2;
    --orange: #ef7d00;
    --light: #f5f8fb;
    --border: #c9d6e2;
    --text: #1f2a37;
    --muted: #5f6b7a;
    --danger: #b42318;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #f7fbff 0%, #ffffff 40%);
    color: var(--text);
    line-height: 1.5;
}

.container {
    width: min(980px, 94%);
    margin: 28px auto 48px;
}

.header-card, .card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(23, 42, 70, 0.07);
}

.header-card {
    padding: 24px;
    margin-bottom: 18px;
}

.logo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid #e7edf3;
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.logo-row img {
    max-width: 190px;
    height: auto;
}

.kicker {
    color: var(--blue);
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    font-size: 13px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 28px; color: var(--blue-dark); }
h2 { font-size: 20px; color: var(--blue-dark); }
h3 { font-size: 17px; color: var(--text); }
p { margin: 0 0 12px; }
.small { font-size: 13px; color: var(--muted); }
.notice {
    background: #f0f7ff;
    border-left: 4px solid var(--blue);
    padding: 12px 14px;
    border-radius: 8px;
    margin: 14px 0;
}

.card {
    padding: 20px;
    margin: 18px 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #fff;
    margin: -2px 0 16px;
    font-weight: 700;
}
.section-blue { background: var(--blue); }
.section-green { background: var(--green); }
.section-purple { background: var(--purple); }
.section-orange { background: var(--orange); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field { margin: 14px 0; }
label { font-weight: 700; display: block; margin-bottom: 6px; }
input[type="text"], input[type="tel"], input[type="password"], select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    background: #fff;
}
textarea { min-height: 130px; resize: vertical; }

.radio-row, .checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    margin-top: 6px;
}
.radio-row label, .checkbox-row label {
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.scale-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 10px;
    margin-top: 8px;
}
.scale-table th, .scale-table td {
    border: 1px solid var(--border);
    padding: 10px;
    vertical-align: middle;
}
.scale-table th {
    background: #eef5fb;
    color: var(--blue-dark);
    text-align: center;
}
.scale-table td:first-child { width: 58%; }
.scale-table td:not(:first-child) { text-align: center; }
.scale-note { font-weight: 700; color: var(--blue); margin-bottom: 8px; }

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 9px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-danger { background: var(--danger); color: #fff; }

.home-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.home-option {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    background: #fff;
}
.home-option h2 { color: var(--blue); }
.home-option.teacher h2 { color: var(--green); }

.error-list {
    background: #fff1f0;
    border: 1px solid #ffccc7;
    color: var(--danger);
    border-radius: 8px;
    padding: 12px 14px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}
.admin-table th, .admin-table td {
    border: 1px solid var(--border);
    padding: 8px;
    text-align: left;
    vertical-align: top;
}
.admin-table th { background: #eef5fb; }
.footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 24px;
}

@media (max-width: 760px) {
    .logo-row { flex-direction: column; align-items: flex-start; }
    .form-grid, .home-options { grid-template-columns: 1fr; }
    .scale-table { font-size: 13px; }
    .scale-table th, .scale-table td { padding: 8px 5px; }
}


.required { color: var(--danger); }
.consent-final-card { background: #f9fbfd; }
body.modal-open { overflow: hidden; }
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 31, 61, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.consent-modal {
    width: min(720px, 96vw);
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.24);
    padding: 24px;
}
.consent-modal h2 { color: var(--blue-dark); }
.modal-agree-row {
    background: #f0f7ff;
    border-left: 4px solid var(--blue);
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 14px;
}
.modal-agree-row label {
    font-weight: 700;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.generated-code-box {
    background: #f8fbff;
    border: 1px dashed var(--blue);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
.generated-code-box p { margin-bottom: 6px; }


.robot-check-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
.robot-check-box h3 {
    margin-bottom: 10px;
    color: var(--blue-dark);
}
.robot-line {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: 700;
    margin-bottom: 10px;
}
.robot-math input {
    max-width: 260px;
}
.inline-delete-form {
    display: inline;
    margin: 0;
}
.admin-table .action-col {
    width: 120px;
}
.btn-small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 7px;
}
