/* ==========================================================================
   Online Admission Manager — Frontend Styles
   ========================================================================== */

.admission-form-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.admission-form-wrapper * {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Institute header — logo, title, and tagline each carry their OWN
   text-align via inline style (set independently in Settings), so they
   are positioned completely independently of one another.
   -------------------------------------------------------------------------- */
.institute-header {
    margin-bottom: 20px;
}

.institute-logo-row {
    margin-bottom: 8px;
}

.institute-logo-row .institute-logo {
    display: inline-block;
    height: auto;
    max-width: 100%;
}

.institute-header .institute-title {
    margin: 0;
    color: #2c3e50;
    line-height: 1.25;
}

.institute-header .institute-tagline {
    margin: 4px 0 0;
    color: #7f8c8d;
    line-height: 1.3;
}

.admission-status-message {
    text-align: center;
    padding: 20px;
}

/* --------------------------------------------------------------------------
   Honeypot field — invisible to real applicants, present for bots.
   -------------------------------------------------------------------------- */
.adm-mgr-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    height: 0;
    overflow: hidden;
}

.admission-form-wrapper fieldset {
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 25px;
    margin-left: 0;
    margin-right: 0;
    border-radius: 6px;
    background: #fff;
}

.admission-form-wrapper legend {
    font-weight: bold;
    padding: 0 12px;
    font-size: 1.1em;
    color: #2c3e50;
    background: #ecf0f1;
    border-radius: 20px;
}

.admission-form-wrapper label {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 12px;
    font-weight: 500;
    max-width: 100%;
}

.admission-form-wrapper input[type="text"],
.admission-form-wrapper input[type="tel"],
.admission-form-wrapper input[type="email"],
.admission-form-wrapper input[type="date"],
.admission-form-wrapper select,
.admission-form-wrapper textarea {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-left: 8px;
    margin-right: 10px;
    font-size: 14px;
    max-width: 100%;
}

.admission-form-wrapper textarea {
    vertical-align: middle;
    width: 300px;
}

.admission-form-wrapper input[type="file"] {
    margin-left: 8px;
    max-width: 100%;
}

.adm-uppercase {
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Desktop row grouping: related, naturally-short fields sit inline on one
   row. Each .adm-row is a flex container; fields wrap naturally on
   narrower viewports via the mobile override further down.
   -------------------------------------------------------------------------- */
.adm-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0 10px;
}

.adm-row label {
    flex: 0 0 auto;
}

.adm-row label.adm-field-grow {
    flex: 1 1 260px;
}

.adm-input-narrow {
    width: 140px;
}

.adm-field-full {
    width: 100%;
}

/* Name + live photo preview, side by side */
.adm-row-name-photo {
    align-items: flex-start;
    justify-content: space-between;
}

.adm-photo-preview-slot {
    flex: 0 0 auto;
    text-align: center;
    margin-bottom: 12px;
}

.adm-photo-preview-label {
    display: block;
    font-size: 0.75em;
    color: #7f8c8d;
    margin-bottom: 4px;
    font-weight: 500;
}

.adm-photo-preview-box {
    width: 110px;
    height: 130px;
    border: 1px dashed #bbb;
    border-radius: 4px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.adm-photo-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adm-photo-preview-placeholder {
    font-size: 0.7em;
    color: #999;
    text-align: center;
    padding: 0 8px;
}

.adm-mgr-disabled-submit {
    opacity: 0.6;
}

.academic-row {
    background: #fef9e6;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #f1c40f;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.academic-row input,
.academic-row textarea {
    margin: 0;
    flex: 1 1 auto;
}

.academic-row input {
    min-width: 120px;
}

.academic-row textarea {
    width: 180px;
    height: 45px;
}

.remove-row {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.remove-row:hover {
    background: #c0392b;
}

#add-academic-row {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
}

#add-academic-row:hover {
    background: #2ecc71;
}

/* --------------------------------------------------------------------------
   Bottom action bar: Print on the left, Submit on the right.
   -------------------------------------------------------------------------- */
.adm-mgr-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.print-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.print-btn:hover {
    background: #2980b9;
}

.print-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.adm-mgr-bottom-bar input[type="submit"],
.adm-mgr-bottom-bar input[type="button"] {
    margin-left: auto;
    background: #2c3e50;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.adm-mgr-bottom-bar input[type="submit"]:hover {
    background: #1a252f;
}

.admission-message {
    padding: 12px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
}

.admission-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.admission-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.note {
    font-size: 0.85em;
    color: #7f8c8d;
    display: block;
    margin-top: 5px;
}

.adm-mgr-payment-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-bottom: 10px;
}

.adm-mgr-payment-upload {
    flex: 1;
    min-width: 200px;
}

.adm-mgr-payment-qr {
    text-align: center;
}

.adm-mgr-payment-qr img {
    max-width: 120px;
    max-height: 120px;
    border: 1px solid #ddd;
    padding: 5px;
}

.adm-mgr-payment-qr p {
    margin: 5px 0 0;
    font-size: 0.8em;
}

/* ==========================================================================
   Mobile: collapse outer padding/margins so the form uses the full
   available width instead of leaving large empty gutters on each side,
   and stack the inline desktop rows into single-column fields.
   ========================================================================== */
@media (max-width: 768px) {
    .admission-form-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 12px;
        border-radius: 0;
    }

    .admission-form-wrapper fieldset {
        padding: 12px;
        margin-bottom: 16px;
    }

    .admission-form-wrapper label {
        display: block;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .adm-row {
        flex-direction: column;
        gap: 0;
    }

    .adm-input-narrow {
        width: 100%;
    }

    .adm-row-name-photo {
        flex-direction: row;
        align-items: flex-start;
    }

    .adm-row-name-photo label {
        flex: 1 1 auto;
        margin-bottom: 0;
    }

    .academic-row {
        flex-direction: column;
        align-items: stretch;
    }

    .academic-row textarea {
        width: 100%;
    }

    .admission-form-wrapper input[type="text"],
    .admission-form-wrapper input[type="tel"],
    .admission-form-wrapper input[type="email"],
    .admission-form-wrapper input[type="date"],
    .admission-form-wrapper select,
    .admission-form-wrapper textarea {
        display: block;
        margin-left: 0;
        margin-right: 0;
        margin-top: 5px;
        width: 100%;
    }

    .admission-form-wrapper input[type="file"] {
        margin-left: 0;
        display: block;
        margin-top: 5px;
        width: 100%;
    }

    .adm-mgr-payment-row {
        flex-direction: column;
        align-items: stretch;
    }

    .adm-mgr-bottom-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .adm-mgr-bottom-bar input[type="submit"],
    .adm-mgr-bottom-bar input[type="button"] {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .admission-form-wrapper {
        padding: 8px;
    }

    .admission-form-wrapper fieldset {
        padding: 10px;
    }

    .adm-photo-preview-box {
        width: 90px;
        height: 105px;
    }
}
