* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #222;
    overflow-x: hidden;
    position: relative;
}

/* Background fade layer */
.background-layer {
    position: fixed;
    inset: 0;
    background: #ffffff; /* white starting point */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out; /* slow, obvious fade */
    z-index: 0;
}

.background-layer.visible {
    opacity: 1;
}

/* Main container */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.form-container {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px 40px 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Titles */
.title {
    text-align: center;
    font-size: 1.8rem;
    letter-spacing: 0.06em;
    color: #f10101;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.subtitle {
    text-align: center;
    font-size: 1rem;
    margin: 0 0 20px;
    color: #555;
}

.pass-mark {
    font-weight: 600;
    color: #f10101;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

/* Inputs */
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.text-input,
.text-area {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 1rem;
    margin-bottom: 14px;
}

.text-area {
    min-height: 110px;
    resize: vertical;
}

.text-input:focus,
.text-area:focus {
    outline: none;
    border-color: #f10101;
}

/* T/F groups */
.tf-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.tf-group legend {
    font-size: 1rem;
    font-weight: 500;
}

.tf-group label {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    font-size: 1rem;
}

/* Buttons */
.step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.step-actions-split {
    justify-content: space-between;
}

.btn {
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary {
    background: #f10101;
    color: #fff;
}

.btn-primary:hover {
    background: #cc0202;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

/* Hidden steps */
.form-step { display: none; }
.form-step.active { display: block; }

/* Validation messages */
.alert {
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.alert-error {
    background: #fdecea;
    border: 1px solid #f5a097;
    color: #a53024;
}

.input-error { border-color: #f10101 !important; }
.field-error { font-size: 0.85rem; color: #a53024; margin-top: -8px; margin-bottom: 10px; }

.email-required-note {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #f10101;
}

/* --- Admin table styling (restored) --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: center;          /* centre all text */
    vertical-align: middle;
}

.admin-table th {
    background: #f5f5f5;
}

/* let action link wrap instead of stretching column */
.admin-table td a {
    display: inline-block;
    white-space: normal;
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.9rem;
}

/* admin top bar */
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* manage admins / logout links in SCH red */
.admin-menu a {
    margin-left: 10px;
    font-size: 0.9rem;
    color: #f10101;
    text-decoration: underline;
}

/* ---------- Mobile magic ---------- */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 16px 10px;
        align-items: flex-start;
    }

    .form-container {
        padding: 18px 14px 22px;
        max-width: 100%;
        margin: 0;
    }

    .step-actions,
    .step-actions-split {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    html { font-size: 18px; }

    .text-input,
    .text-area,
    .form-label,
    .tf-group label,
    .btn {
        font-size: 1.05rem;
    }
}

