/* ===== BASE ===== */
body {
    font-family: "Segoe UI", Arial;
    background: #f4f6fb;
    margin: 0;
    padding: 10px;
}
/* ===== FORM CARD ===== */
form {
    max-width: 1000px;
    margin: auto;
    background: #fff;
    padding: 18px 22px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

/* ===== HEADER ===== */
h2 {
    text-align: center;
    background: #1976d2;
    color: white;
    padding: 10px;
    border-radius: 6px;
}

/* ===== CARD ===== */
.card {
    background: white;
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== SECTION TITLE ===== */
.card h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #1976d2;
}

/* ===== GRID ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* MOBILE FIRST */
.col {
    flex: 1 1 100%;
}
.uppercase{
    text-transform: uppercase;
}
/* DESKTOP */
@media (min-width: 768px) {
    .col {
        flex: 1 1 48%;
    }

    .photo-col {
        flex: 0 0 160px;
    }
}

@media (min-width: 768px) {

    .col.third {
        flex: 1 1 32%;
    }

    .col.fourth {
        flex: 1 1 24%;
    }

}
/* ===== INPUTS ===== */
label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
    display: block;
}

input, select, textarea {
    width: 100%;
    padding: 6px 7px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 13px;
}

/* ===== BUTTON ===== */
button {
    padding: 8px;
    border: none;
    background: #1976d2;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

/* DEFAULT (desktop) */
button[type="submit"] {
    background: #2e7d32;
    color: white;
    width: auto;
    min-width: 200px;
    display: block;
    margin: 15px auto;  /* center */
}

/* MOBILE */
@media (max-width: 768px) {
    button[type="submit"] {
        width: 80%;
    }
}

/* ===== PHOTO ===== */
#photoPreviewBox img {
    width: 100%;
    border-radius: 6px;
}

/* ===== ACADEMIC ROW ===== */
.academic-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.academic-row .col {
    flex: 1 1 100%;
}

@media (min-width: 768px) {

    .academic-row .col {
        flex: 1;
    }

    .academic-row .small {
        flex: 0 0 90px;
    }
}


/* ===== FORCE MOBILE STACK ===== */
@media (max-width: 768px) {

    .row {
        flex-direction: column;
    }

    .col,
    .col.third,
    .col.fourth,
    .photo-col {
        flex: 1 1 100% !important;
        width: 100%;
    }

    input, select, textarea {
        font-size: 14px;
    }

    h3 {
        font-size: 15px;
    }

    .card {
        padding: 10px;
    }

    button {
        width: 100%;
    }
}

@media (max-width: 768px) {

    .card {
        margin-bottom: 5px;
        border-radius: 5px;
    }

}
input:invalid, select:invalid {
    border: 1px solid red;
}
input, select {
    height: 32px;
}

.required::after {
    content: " *";
    color: red;
}

.cropper-container {
    max-width: 100% !important;
}
.crop-wrapper {
    width: 100%;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.modal-actions button {
    flex: 1;
}
#cropImage {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;   /* 🔥 IMPORTANT */
    display: block;
}

.modal,
.subject-modal,
.crop-modal{
    display: none;
    position: fixed;
    inset: 0;
    height: 100%;   /* 🔥 ensures full height */
    width: 100%;
    background: rgba(9,9,9,0.6);
    z-index: 9999;
}

.subject-modal.show {
    display: flex;
    align-items: center;      /* vertical */
    justify-content: center;  /* horizontal */
}

.crop-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    padding: 10px;
    border-radius: 8px;
    gap: 5px;
    overflow: hidden;   /* 🔥 prevents overflow */
}
.crop-modal .modal-content {
    background: white;
    border-radius: 5px;
    
    flex-direction: column;
    justify-content: space-between;
    
    width: 80%;
    max-width: 600px;
    
    height: 90vh;
    max-height: 90vh;

    display: flex !important;
    overflow: hidden;
}

.subject-modal .modal-content {
    background: white;
    border-radius: 5px;
    
    flex-direction: column;
    justify-content: space-between;
    
    width: 60%;
    max-width: 400px;
    
    height: 90vh;
    max-height: 90vh;
    
    display: block !important;
    
    overflow-y: auto;
    padding: 5px;
}
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-height: 90vh;
    }
}