* {
    font-family: "Montserrat", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

main {
    background: #F8FAFC;

}

.application-header h2 {
    color: #111827;
    text-align: center;
    padding: 2rem 0;
    font-size: 2.5rem;
}

#header-description {
    color: #6B7280;
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 4rem;
}

.application-form {
    display: flex;
    margin: 0 auto;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    max-width: 1400px;
    border-radius: 1.5rem;
    padding: 3rem 4rem;
    margin-bottom: 4rem;


}

.form-section {
    padding-bottom: 2rem;
}

.form-section h2 {
    color: #1E3A8A;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 2.5rem;
}

.form-section label {
    color: #374151;
    font-weight: 500;
}

.form-section input {
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: .6rem;
    padding: .4rem .8rem;

}

.form-section input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;

}

.form-section input[type="text"] {
    color: #111827;
}

.form-section select {
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: .6rem;
    padding: .4rem .8rem;
}

.form-section select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;

}

.form-section textarea {
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: .6rem;
    padding: .4rem .8rem;
    resize: vertical;
}


.form-section textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;

}


.form-group {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 1rem;
}

.academic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 3rem;
}

.accommodation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
}

.gender-group {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.gender-options {
    display: flex;
    flex-direction: row;
    gap: .5rem;
    align-items: center;
}

#room-heading {
    margin-bottom: 3rem;
}

.fee-options {
    display: flex;
    gap: .7rem;
    margin-bottom: 1rem;
}

.input-error {
    display: none;
    color: #DC2626;
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.input-invalid {
    border-color: #DC2626 !important;
}

.application-summary {
    display: none;
}

.success-message {
    display: none;
    width: 100%;
    max-width: 550px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 1.2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    animation: successSlideIn 0.4s ease;
}

.success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    background: #DCFCE7;
    color: #16A34A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.success-message h3 {
    margin-bottom: 0.6rem;
    font-size: 1.4rem;
    color: #111827;
}

.success-message>p {
    color: #6B7280;
    font-size: 0.95rem;
}

.application-id {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 0.8rem;
}

.application-id span {
    display: block;
    margin-bottom: 0.4rem;
    color: #6B7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.application-id strong {
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    color: #111827;
}

.success-note {
    font-size: 0.85rem !important;
    color: #6B7280;
}

@keyframes successSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.duplicate-error {
    display: none;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    margin-bottom: 20px;
    border: 1px solid #f5c2c7;
    border-radius: 10px;
    background-color: #f8d7da;
    color: #842029;
    position: relative;
    animation: errorSlide 0.3s ease;
}

.duplicate-error .error-icon {
    font-size: 20px;
}

.duplicate-error strong {
    display: block;
    margin-bottom: 4px;
}

.duplicate-error p {
    margin: 0;
    font-size: 14px;
}

#close-error {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #842029;
    font-size: 22px;
    cursor: pointer;
}

@keyframes errorSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}





/* ============================
   TABLET (max-width: 1024px)
============================ */
@media (max-width: 1024px) {

    .application-form {
        max-width: 90%;
        padding: 2.5rem 2.5rem;
    }

    .application-header h2 {
        font-size: 2.1rem;
    }

    #header-description {
        font-size: 1.15rem;
        padding: 0 1rem;
    }

    .academic-grid,
    .accommodation-grid {
        gap: 1.5rem 2rem;
    }
}

/* ============================
   MOBILE / SMALL TABLET (max-width: 768px)
============================ */
@media (max-width: 768px) {
    
    .application-form {
        width: 92%;
        max-width: 100%;
        padding: 2rem 1.5rem;
        border-radius: 1rem;
    }

    .application-header h2 {
        font-size: 1.8rem;
        padding: 1.5rem 1rem 0.5rem;
    }

    #header-description {
        font-size: 1rem;
        margin-bottom: 2.5rem;
        padding: 0 1rem;
    }

    .form-section h2 {
        font-size: 1.3rem;
        padding-bottom: 0.8rem;
        margin-bottom: 1.8rem;
    }

    /* Stack academic & accommodation grids */
    .academic-grid,
    .accommodation-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gender-options {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .fee-options {
        flex-direction: column;
        gap: 0.8rem;
    }

    .duplicate-error {
        flex-wrap: wrap;
    }

    .success-message {
        width: 92%;
        padding: 2rem 1.5rem;
    }
}

/* ============================
   MOBILE (max-width: 600px)
============================ */
@media (max-width: 600px) {

    .application-header h2 {
        font-size: 1.5rem;
    }

    #header-description {
        font-size: 0.9rem;
    }

    .application-form {
        padding: 1.5rem 1.2rem;
    }

    .form-section h2 {
        font-size: 1.15rem;
    }

    .form-section label {
        font-size: 0.9rem;
    }

    .declaration label {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }

    .application-id strong {
        font-size: 1.1rem;
        word-break: break-all;
    }
}