/* PAGE BODY */
body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f3e9ff;
    /* Centre content vertically and horizontally on larger screens */
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
}

/* FORM CARD */
form {
    width: 100%;
    max-width: 420px;
    background-color: #ffffff;
    border: 2px solid #6a0dad;
    border-radius: 8px;
    padding: 40px 20px;
}

h2 {
    text-align: center;
    color: #4b0082;
    margin-bottom: 20px;
    font-size: 22px;
}

/* LABELS */
label,
.field-label {
    display: block;
    margin-top: 18px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #4b0082;
    font-size: 14px;
}

/* ALL INPUTS */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"] {
    width: 90%;
    padding: 9px 10px;
    border: 1px solid #999;
    border-radius: 4px;
    font-size: 14px;
    color: #222;
    position: relative;
}

/* :focus styles are CRITICAL for keyboard users.*/
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #6a0dad;
    box-shadow: 0 0 0 3px rgba(106, 13, 173, 0.25);
}

/* Red border on invalid fields (class added by JS) */
input.invalid {
    border-color: #cc0000;
    background-color: #fff5f5;
}

/* STUDENT NUMBER ROW */
.sn-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
}

/* The "S" prefix letter */
.sn-prefix {
    font-weight: bold;
    font-size: 14px;
    color: #4b0082;
    margin-right: 2px;
}

/* Each individual digit box */
.sn {
    width: 30px !important;    /* Override the 100% width from above */
    padding: 9px 4px !important;
    text-align: center;
    font-size: 16px;
    border: 1px solid #999;
    border-radius: 4px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sn:focus {
    outline: none;
    border-color: #6a0dad;
    box-shadow: 0 0 0 3px rgba(106, 13, 173, 0.25);
}

.sn.invalid {
    border-color: #cc0000;
    background-color: #fff5f5;
}

/* ── ADDRESS SUGGESTIONS DROPDOWN ── */
#suggestions {
    position: absolute;
    list-style: none;
    border: 1px solid #ccc;
    border-top: none;
    background: #fff;
    padding: 5px;
    max-height: 180px;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
    z-index: 1;
}

#suggestions:empty { display: none; }

#suggestions li {
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    color: #222;
}

#suggestions li:hover,
#suggestions li[aria-selected="true"] {
    background-color: #e8d5ff;
    color: #4b0082;
}

/* HINT TEXT */
.hint {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* ERROR MESSAGES */
p.error {
    color: #cc0000;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}


/* TERMS CHECKBOX ROW */
.terms-row {
    margin-top: 18px;
}

.terms-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
    color: #222;
    margin-top: 0;
}

input[type="checkbox"] {
    width: auto !important;
    height: 16px;
    cursor: pointer;
    accent-color: #6a0dad;
    flex-shrink: 0;
}

input[type="checkbox"]:focus {
    outline: 2px solid #6a0dad;
    outline-offset: 2px;
}


/* SUBMIT BUTTON */
button[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 12px;
    background-color: #6a0dad;
    color: #ffffff;
    font-size: 15px;
    font-weight: bold;
    font-family: inherit;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    /* Smooth colour change on hover */
    transition: background-color 0.2s ease, transform 0.1s ease;
}

button[type="submit"]:hover {
    background-color: #4b0082;
}

/* Visible focus ring for keyboard users tabbing to the button */
button[type="submit"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 13, 173, 0.4);
}

/* Slight press effect when clicked */
button[type="submit"]:active {
    transform: scale(0.98);
}


/* ── RESPONSIVE — mobile screens ────────────────────────────────────────── */
@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }

    form {
        padding: 20px 15px;
    }

    /* Make the student number boxes slightly smaller on small screens */
    .sn {
        width: 32px !important;
    }
}