/* Form styling on top of site.css — applies to the CES application form. */

form#ces-form {
    max-width: 860px;
    margin: 0 auto;
}

.form-header { margin-bottom: 1.5rem; }
.form-header h1 { margin: .25rem 0; font-size: 1.7rem; }
.confidential {
    background: #fff3cd; color: #5a3e00;
    border: 1px solid #ffd970; border-radius: 6px;
    padding: .3rem .7rem; display: inline-block;
    font-weight: 600; letter-spacing: .04em;
}

.notice {
    background: #faf5f7;
    border-left: 5px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.55;
}
.notice p { margin: 0 0 .55rem; }
.notice p:last-child { margin-bottom: 0; }
.notice .notice-title { color: var(--accent); font-weight: 600; margin: 0 0 .45rem; }
.notice--safeguarding, .notice--accent { }
.notice ol { margin: .4rem 0 .4rem 1rem; padding: 0; }
.notice li { margin: .35rem 0; }

.form-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}
.form-section > h2 {
    margin: 0 0 .75rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--accent);
    font-size: 1.15rem;
    color: var(--accent);
}
.form-section h3 { margin: 1rem 0 .4rem; font-size: 1rem; }

.field {
    display: flex; flex-direction: column;
    margin-bottom: .85rem;
}
.field label { font-weight: 500; margin-bottom: .25rem; font-size: .95rem; }
.field input[type=text],
.field input[type=email],
.field input[type=date],
.field input[type=tel],
.field input[type=number],
.field input[type=file],
.field select,
.field textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid #c5c5cb;
    border-radius: 6px;
    font: inherit;
    background: #fff;
}
.field textarea { resize: vertical; min-height: 4rem; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}
.field .help { font-size: .85rem; color: var(--muted); margin: .25rem 0 0; }
.field .errorlist {
    list-style: none; margin: .25rem 0 0; padding: 0;
    color: #730000; font-size: .9rem;
}

.checkbox-field { flex-direction: row; align-items: center; gap: .5rem; }
.checkbox-field label { margin: 0; font-weight: 400; }
.checkbox-field input { width: auto; }

.required-consent {
    background: #fffbe8;
    border: 1px dashed #d9b300;
    padding: .55rem .8rem;
    border-radius: 6px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem 1rem;
}
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
}

.formset { display: flex; flex-direction: column; gap: 1rem; margin: .6rem 0; }
.formset-row {
    padding: 1rem;
    background: #fafaf8;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.formset-row .reference-heading { margin: 0 0 .6rem; color: var(--accent); }
.formset-delete {
    display: inline-flex; align-items: center; gap: .35rem;
    margin-top: .5rem; font-size: .9rem; color: var(--muted);
}

.word-counter {
    margin-top: .35rem;
    font-size: .85rem;
    color: var(--muted);
}
.word-counter.over-limit { color: #730000; font-weight: 600; }

.btn {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    padding: .55rem 1.1rem;
    transition: filter .12s ease;
}
.btn:hover { filter: brightness(.92); }
.btn--primary { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn--secondary {
    background: #fff;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    font-weight: 500;
    cursor: pointer;
}
.btn--secondary:hover {
    background: var(--accent);
    color: var(--accent-fg);
}
.btn.is-hidden { display: none; }
.btn--large { padding: .8rem 1.6rem; font-size: 1.05rem; }

.form-actions { text-align: right; margin: 1.5rem 0 3rem; }

.errors {
    background: #ffeaea; color: #730000;
    border: 1px solid #f5b5b5; border-radius: 6px;
    padding: .75rem 1rem; margin: 1rem 0;
}

.conditional { padding-top: .25rem; }
/* Auto-fill context panel — shows the four values the system fills in
   so the applicant can see them but can't edit them. */
.autofill-panel {
    background: #eef4f7;
    border: 1px solid #c8d6df;
    border-radius: 8px;
    padding: .9rem 1.1rem;
    margin: 0 0 1.1rem;
}
.autofill-panel p {
    margin: 0 0 .4rem;
    font-weight: 500;
}
.autofill-panel dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .25rem 1.25rem;
    margin: 0;
}
.autofill-panel dt {
    color: var(--muted);
    font-size: .9rem;
}
.autofill-panel dd {
    margin: 0;
    font-weight: 500;
}
@media (max-width: 540px) {
    .autofill-panel dl { grid-template-columns: 1fr; gap: .1rem 0; }
    .autofill-panel dd { margin-bottom: .35rem; }
}

.autofill-panel p { margin: 0 0 .4rem; }
.autofill-panel .autofill-school { font-size: 1.05rem; margin: .15rem 0 .8rem; }
.autofill-panel ul.autofill-facts { margin: 0; padding-left: 1.2rem; }
.autofill-panel ul.autofill-facts li { margin: .15rem 0; }


/* A Level / Level 3 nested structure */
.alevel-institution {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafaf8;
    padding: 1rem 1.25rem;
    margin: .8rem 0;
}
.alevel-institution.is-hidden { display: none; }
.alevel-institution h4 {
    margin: 0 0 .75rem;
    font-size: 1rem;
    color: var(--accent);
}
.alevel-quals-table {
    width: 100%;
    border-collapse: collapse;
    margin: .5rem 0 .75rem;
    font-size: .95rem;
}
.alevel-quals-table thead th {
    text-align: left;
    padding: .3rem .4rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--muted);
    font-size: .85rem;
}
.alevel-quals-table td {
    padding: .35rem .25rem;
    vertical-align: top;
}
.alevel-quals-table .alevel-qual-row.is-hidden { display: none; }
.alevel-quals-table input,
.alevel-quals-table select { width: 100%; }


/* A Level qualifications table — spread the three columns across full width */
.alevel-quals-table { table-layout: fixed; }
.alevel-quals-table th.col-subject,
.alevel-quals-table td.col-subject { width: 50%; }
.alevel-quals-table th.col-level,
.alevel-quals-table td.col-level { width: 30%; }
.alevel-quals-table th.col-date,
.alevel-quals-table td.col-date { width: 20%; }
.alevel-quals-table input,
.alevel-quals-table select { width: 100%; box-sizing: border-box; }
