/* Overlay */
#applyModalOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9998;
}

/* Modal shell */
#applyModal {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    width: 720px;
    max-width: 92vw;
    background: #fff;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    overflow: hidden;
}

    /* Make sizing predictable inside modal (prevents weird shrinking) */
    #applyModal, #applyModal * {
        box-sizing: border-box;
    }

/* Header / Body / Footer */
.apply-hd {
    position: relative;
    display: flex; /* keeps X in same row */
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.apply-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

/* Pin X to top-right so it never drops under title */
.apply-x {
    position: absolute; /* always top-right */
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 6px;
}

.apply-bd {
    padding: 14px 20px 8px 20px;
    max-height: 70vh;
    overflow: auto;
}

.apply-ft {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

/* Form fields */
.apply-row {
    margin: 0 0 10px 0;
}

.apply-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #111827;
}

.req {
    color: #ef4444;
    margin-left: 4px;
}

/* Force full width + consistent input styling (prevents global CSS breaking layout) */
#applyModal input[type="text"],
#applyModal input[type="email"],
#applyModal input[type="url"],
#applyModal input[type="tel"],
#applyModal select,
#applyModal .apply-input {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 34px;
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    outline: none;
    background: #fff;
}

#applyModal input[type="file"] {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 14px;
}

#applyModal input[type="text"]:focus,
#applyModal input[type="email"]:focus,
#applyModal input[type="url"]:focus,
#applyModal input[type="tel"]:focus,
#applyModal select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.apply-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

    /* Prevent grid children from overflowing/shrinking oddly */
    .apply-grid-3 > * {
        min-width: 0;
    }

/* Checkbox text block */
.apply-checkline {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 14px 0 0 0;
}

    .apply-checkline input {
        margin-top: 3px;
    }

.apply-legal {
    font-size: 13px;
    color: #374151;
}

    .apply-legal small {
        display: block;
        color: #6b7280;
        margin-top: 6px;
        line-height: 1.35;
    }

/* Buttons */
.btn-apply {
    min-width: 120px;
    height: 38px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    border: 2px solid transparent;
}

.btn-submit {
    border-color: #2563eb;
    color: #111827;
}

.btn-cancel {
    border-color: #d1d5db;
    color: #111827;
}

/* Applied style */
.is-applied {
    background-color: #6b7280 !important;
    border-color: #6b7280 !important;
    cursor: not-allowed !important;
    opacity: 0.9;
}
/* 2-column row for Email + Phone */
.apply-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Stack to 1 column on small screens */
@media (max-width: 640px) {
    .apply-grid-2 {
        grid-template-columns: 1fr;
    }
}
