/*  RESET*/
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* FORM CONTAINER */

.form-container {
    max-width: 900px;
    margin: 60px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(30, 58, 138, 0.08);
}

/* Heading */

.form-container h1 {
    text-align: center;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.form-container p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* FIELDSET */

fieldset {
    border: 1px solid #e5e7eb;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

fieldset:hover {
    border-color: #1e3a8a22;
}

legend {
    font-weight: 600;
    color: #1e3a8a;
    padding: 0 12px;
}

/* INPUT GROUP */

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1f2937;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.25s ease;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #1e3a8a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
}

/* GRID LAYOUTS */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* FILE INPUT */

input[type="file"] {
    padding: 6px;
    background: #f9fafb;
}

/* FOOTER NOTE */

.footer-note {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin: 30px 0;
    line-height: 1.6;
}

/* SUBMIT BUTTON */

#submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, #1e3a8a, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.2);
}

/* INVALID FIELD */

.invalid {
    border-color: #dc2626 !important;
}

.ssn-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

/* FIELD DESCRIPTION */

.field-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 14px;
}

/* MOBILE */

@media (max-width: 900px) {
    .form-container {
        padding: 25px;
        margin: 30px 20px;
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    fieldset {
        padding: 18px;
    }

    .form-container {
        padding: 20px;
    }
}

/* overlay */

#form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.overlay-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
}

/* spinner */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: auto;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0)
    }

    100% {
        transform: rotate(360deg)
    }
}

/* toast */

/* TOAST OVERLAY (BLUR BACKGROUND) */
#toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);

    display: none;
    z-index: 9998;
}

/* CENTERED TOAST */
#toast-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background: #2563eb;
    color: white;

    padding: 20px 30px;
    border-radius: 12px;

    font-weight: 600;
    font-size: 16px;

    text-align: center;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);

    display: none;
    z-index: 10000;
}