/* =========================================================
   Prospen In-House Training – Frontend Styles v2.4
   Mobile-first popup form, consistent with Qualification Manager
========================================================= */

/* ── Trigger Button ──────────────────────────────────────── */
/* .prospen-register-btn is the legacy class used by the old plugin */
.prospen-inhouse-btn,
.prospen-register-btn,
#registerButton {
    display: inline-block;
    padding: 12px 26px;
    background: #D58037;
    background-color: #D58037;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Poppins', Arial, sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.4;
    box-sizing: border-box;
    box-shadow: 0 3px 10px rgba(213, 128, 55, 0.18);
    margin: 10px 0;
}
.prospen-inhouse-btn:hover,
.prospen-register-btn:hover,
#registerButton:hover {
    background-color: #b86b2d;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(213, 128, 55, 0.38);
}
.prospen-inhouse-btn:focus,
.prospen-register-btn:focus,
#registerButton:focus {
    outline: 2px solid #D58037;
    outline-offset: 2px;
}

/* ── Overlay ─────────────────────────────────────────────── */
#prospen-inhouse-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .56);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
#prospen-inhouse-overlay.pih-active {
    display: flex;
    animation: pihFadeIn .28s ease;
}
@keyframes pihFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Box ───────────────────────────────────────────── */
#prospen-inhouse-box {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 48px rgba(0, 0, 0, .24);
    width: 100%;
    max-width: 860px;
    max-height: 93vh;
    overflow-y: auto;
    position: relative;
    animation: pihSlideUp .28s ease;
    font-family: 'Poppins', Arial, sans-serif;
    box-sizing: border-box;
}
@keyframes pihSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Close Button ────────────────────────────────────────── */
#prospen-inhouse-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #bbb;
    z-index: 2;
    transition: color .2s;
    padding: 0;
}
#prospen-inhouse-close:hover { color: #333; }

/* ── Form Wrap ───────────────────────────────────────────── */
#pih-form-wrap {
    padding: 36px 40px 32px;
}

/* ── Header ──────────────────────────────────────────────── */
#pih-header {
    margin-bottom: 22px;
    padding-right: 28px;
}
#pih-title {
    text-align: center;
    color: #1a1a2e;
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}
#pih-course-display {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #D58037;
    background: #fef6ee;
    border: 1px solid #f5d9b8;
    border-radius: 10px;
    padding: 10px 16px;
    min-height: 20px;
}

/* ── Error Banner ────────────────────────────────────────── */
#pih-error-banner {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ── Section Titles ──────────────────────────────────────── */
.pih-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin: 24px 0 16px;
    width: 100%;
}

/* ── Grid ────────────────────────────────────────────────── */
.pih-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.pih-group {
    flex: 1 1 calc(50% - 18px);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.pih-group.pih-full {
    flex: 1 1 100%;
}

/* ── Labels ──────────────────────────────────────────────── */
.pih-group label,
.pih-checkbox-label {
    margin-bottom: 6px;
    font-size: 13px;
    color: #444;
    font-weight: 600;
}
label.pih-required::after {
    content: " *";
    color: #e74c3c;
}

/* ── Inputs ──────────────────────────────────────────────── */
#prospenInhouseForm input:not([type="checkbox"]),
#prospenInhouseForm select,
#prospenInhouseForm textarea {
    padding: 11px 14px;
    border: 1px solid #B8C5D6;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    background: #F5F8FB;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.02);
    transition: border-color .2s, box-shadow .2s, background .2s;
    width: 100%;
    box-sizing: border-box;
}
#prospenInhouseForm input:focus,
#prospenInhouseForm select:focus,
#prospenInhouseForm textarea:focus {
    border-color: #2E6FD6;
    box-shadow: 0 0 0 3px rgba(46,111,214,.25);
    outline: none;
    background: #fff;
}
#prospenInhouseForm textarea {
    resize: none;
}
#prospenInhouseForm input.pih-invalid,
#prospenInhouseForm select.pih-invalid {
    border-color: #e74c3c;
}

/* ── Phone row ───────────────────────────────────────────── */
.pih-phone-row {
    display: flex;
    gap: 8px;
}
#pih_phone_code {
    width: 80px !important;
    flex-shrink: 0;
    background: #e8edf2 !important;
    color: #555;
    cursor: default;
    text-align: center;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
#pih_phone {
    flex: 1 1 auto;
}

/* ── Field-level error ───────────────────────────────────── */
.pih-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* ── Checkbox ────────────────────────────────────────────── */
.pih-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}
.pih-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── Actions row ─────────────────────────────────────────── */
.pih-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
#pih-submit-btn {
    padding: 13px 30px;
    background-color: #D58037;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 500;
    transition: background-color .3s ease;
    white-space: nowrap;
}
#pih-submit-btn:hover  { background-color: #b2602a; }
#pih-submit-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* ── Honeypot ────────────────────────────────────────────── */
.pih-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ── Success Panel ───────────────────────────────────────── */
#pih-success {
    padding: 60px 40px;
    text-align: center;
}
.pih-success-icon {
    width: 64px;
    height: 64px;
    background: #D58037;
    color: #fff;
    border-radius: 50%;
    font-size: 30px;
    line-height: 64px;
    margin: 0 auto 20px;
}
#pih-success h3 {
    color: #1a1a2e;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
}
#pih-success p {
    color: #555;
    font-size: 15px;
    margin: 0 0 24px;
}
#pih-done-btn {
    padding: 12px 30px;
    background-color: #D58037;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 500;
    transition: background-color .3s ease;
}
#pih-done-btn:hover { background-color: #b2602a; }

/* =========================================================
   MOBILE  (≤ 600 px)
========================================================= */
@media (max-width: 600px) {
    #pih-form-wrap {
        padding: 28px 20px 24px;
    }
    #pih-title {
        font-size: 17px;
        padding-right: 24px;
    }
    .pih-group {
        flex: 1 1 100%;
    }
    .pih-phone-row {
        flex-direction: column;
        gap: 6px;
    }
    #pih_phone_code {
        width: 100% !important;
        text-align: left;
    }
    #pih-success {
        padding: 40px 24px;
    }
    .pih-actions {
        flex-direction: column;
        align-items: stretch;
    }
    #pih-submit-btn {
        width: 100%;
        text-align: center;
    }
    #prospen-inhouse-close {
        top: 10px;
        right: 12px;
        font-size: 24px;
    }
}
