.sas-form-wrap {
    max-width: 760px;
}

.sas-form-title {
    margin: 0 0 24px;
    color: #002b5c;
    line-height: 1.15;
}

.sas-form {
    margin: 0;
}

.sas-form-group {
    margin: 0 0 18px;
}

.sas-form-label,
.sas-form label {
    display: block;
    margin: 0 0 6px;
    font-weight: 600;
    color: #4b5563;
}

.sas-form-help {
    display: block;
    margin: 0 0 10px;
    color: #646970;
    font-size: 13px;
}

.sas-form input[type="text"],
.sas-form input[type="email"],
.sas-form input[type="tel"],
.sas-form input[type="password"],
.sas-form textarea,
.sas-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1.5px solid #8699ad;
    border-radius: 6px;
    background: #ffffff;
    color: #1d2327;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sas-form input[type="text"]:focus,
.sas-form input[type="email"]:focus,
.sas-form input[type="tel"]:focus,
.sas-form input[type="password"]:focus,
.sas-form textarea:focus,
.sas-input:focus {
    outline: none;
    border-color: #2868dc;
    box-shadow: 0 0 0 3px rgba(40, 104, 220, 0.16);
    background: #fff;
}

.sas-form textarea {
    min-height: 110px;
    resize: vertical;
}

.sas-students-wrapper {
    margin-top: 10px;
}

.sas-student-row {
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #f6f7f7;
}

.sas-student-row-title {
    margin: 0 0 10px;
    font-weight: 700;
    color: #1d2327;
}

.sas-student-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.sas-student-row-header .sas-student-row-title {
    margin: 0;
}

.sas-remove-student-row {
    border: 1px solid #bdc3cc;
    border-radius: 6px;
    background: #fff;
    color: #a02c2c;
    padding: 6px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.sas-remove-student-row:hover {
    border-color: #a02c2c;
    background: #fff1f1;
    color: #861919;
}

.sas-remove-student-row:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.sas-student-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sas-student-grid .sas-form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Compact, consistent student labels keep the three input boxes level. */
.sas-student-grid .sas-form-group > .sas-form-label {
    margin: 0 0 8px;
    line-height: 1.35;
}

.sas-student-grid .sas-form-group > input {
    min-width: 0;
    margin-top: auto;
}

/* Keep all three input boxes on the same baseline even when a label wraps.
 * The grid stretches each field column to the height of its tallest label;
 * auto top margin pushes every input to the bottom of that shared height.
 * Works for the first card and all dynamically added cards, and on mobile.
 */

.sas-btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #2271b1;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.sas-btn:hover,
.sas-btn:focus {
    background: #135e96;
    color: #fff;
}

.sas-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.sas-btn-secondary {
    background: #2271b1;
}

.sas-btn-submit {
    min-width: 180px;
}

.sas-form-footer {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
}

.sas-alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.sas-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

@media (max-width: 640px) {
    .sas-student-grid {
        grid-template-columns: 1fr;
    }
}

.sas-suggestion {
    display: block;
    margin-bottom: 6px;
}

.sas-score {
    color: #666;
    font-size: 12px;
    margin-left: 6px;
}
