/* Main phone field */
#registerform .iti {
    display: block;
    width: 100%;
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

/* Raise the currently opened phone field */
#registerform .iti:focus-within {
    z-index: 99999;
}

#registerform .iti input.input {
    width: 100%;
    direction: ltr;
    text-align: left;
    padding-right: 12px;
}

#registerform .iti--separate-dial-code input.input {
    padding-left: 105px;
}

/* Country button */
#registerform .iti__country-container {
    z-index: 100000;
}

/* Complete dropdown box */
#registerform .iti__dropdown-content {
    position: absolute;
    z-index: 100001 !important;
    width: 100%;
    min-width: 280px;
    max-width: 340px;
    background: #ffffff !important;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.20);
    opacity: 1 !important;
    isolation: isolate;
}

/* Search area */
#registerform .iti__search-input {
    display: block;
    width: 100% !important;
    min-height: 38px;
    margin: 0 !important;
    padding: 7px 10px 7px 32px !important;
    color: #1d2327 !important;
    background-color: #ffffff !important;
    border: 0 !important;
    border-bottom: 1px solid #dcdcde !important;
    border-radius: 0 !important;
    box-sizing: border-box;
    opacity: 1 !important;
}

/* Country list */
#registerform .iti__country-list {
    display: block;
    width: 100%;
    max-height: 245px;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    color: #1d2327 !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    scrollbar-width: thin;
    scrollbar-color: #8c8f94 #f0f0f1;
}

/* Every country row */
#registerform .iti__country {
    width: 100%;
    min-height: 34px;
    margin: 0 !important;
    padding: 7px 10px !important;
    color: #1d2327 !important;
    background-color: #ffffff !important;
    box-sizing: border-box;
    opacity: 1 !important;
}

/* Hover and keyboard selection */
#registerform .iti__country:hover,
#registerform .iti__country.iti__highlight {
    color: #1d2327 !important;
    background-color: #f0f6fc !important;
}

/* Selected active country */
#registerform .iti__country[aria-selected="true"] {
    background-color: #e8f2ff !important;
}

/* Country text and dial code */
#registerform .iti__country-name,
#registerform .iti__dial-code {
    color: #1d2327 !important;
    background: transparent !important;
}

#registerform .iti__dial-code {
    color: #50575e !important;
}

/* WebKit scrollbar: Chrome and Edge */
#registerform .iti__country-list::-webkit-scrollbar {
    width: 10px;
}

#registerform .iti__country-list::-webkit-scrollbar-track {
    background-color: #f0f0f1;
    border-left: 1px solid #dcdcde;
}

#registerform .iti__country-list::-webkit-scrollbar-thumb {
    background-color: #8c8f94;
    border: 2px solid #f0f0f1;
    border-radius: 10px;
}

#registerform .iti__country-list::-webkit-scrollbar-thumb:hover {
    background-color: #646970;
}

/* Invalid phone */
#registerform input.eissa-invalid-phone {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px #d63638 !important;
}

/* Validation message */
#eissa-phone-validation-error {
    border-left: 4px solid #d63638;
    color: #3c434a;
    background: #ffffff;
    padding: 12px;
    margin: 0 0 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Mobile */
@media screen and (max-width: 480px) {
    #registerform .iti__dropdown-content {
        width: 100%;
        min-width: 260px;
        max-width: calc(100vw - 50px);
    }

    #registerform .iti__country-list {
        max-height: 220px;
    }

    #registerform .iti__country {
        min-height: 38px;
        padding-top: 9px !important;
        padding-bottom: 9px !important;
    }
}


/* ==================================================
   EISSA REGISTRATION FORM LAYOUT
   ================================================== */

/* Apply consistent box sizing */
#registerform,
#registerform *,
#registerform *::before,
#registerform *::after {
    box-sizing: border-box;
}

/* Consistent spacing between registration fields */
#registerform > p {
    display: block;
    width: 100%;
    margin: 0 0 18px !important;
    padding: 0;
    clear: both;
}

/* Labels must use the complete form width */
#registerform > p > label {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    color: #1d2327;
    line-height: 1.5;
}

/* Fix School and Grade widths */
#registerform #school,
#registerform #grade {
    display: block;
    width: 100% !important;
    max-width: none !important;
    min-height: 42px;
    margin: 6px 0 0 !important;
    padding: 8px 10px;
}

/* Consistent phone field height */
#registerform #student_mobile,
#registerform #father_mobile,
#registerform #mother_mobile {
    width: 100% !important;
    max-width: none !important;
    min-height: 42px;
    margin: 0 !important;
}

/* Description should always appear under its field */
#registerform .description {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    margin: 7px 0 0 !important;
    padding: 0 !important;
    color: #50575e;
    font-size: 12px;
    line-height: 1.5;
    font-style: normal;
}

/* Remove accidental inline positioning */
#registerform label + .description,
#registerform .iti + .description {
    float: none !important;
    position: static !important;
}

/* Phone field wrapper spacing */
#registerform .iti {
    display: block;
    width: 100% !important;
    max-width: none !important;
    margin: 6px 0 0 !important;
}

/* Username and email alignment */
#registerform #user_login,
#registerform #user_email {
    display: block;
    width: 100% !important;
    max-width: none !important;
    min-height: 42px;
    margin: 6px 0 0 !important;
    padding: 8px 10px;
}

/* Password fields alignment */
#registerform .password-field,
#registerform .loginpress-reg-pass-wrap-1,
#registerform .loginpress-reg-pass-wrap-2 {
    display: block;
    position: relative;
    width: 100%;
    clear: both;
}

#registerform #loginpress-reg-pass,
#registerform #loginpress-reg-pass-2 {
    width: 100% !important;
    min-height: 42px;
    padding-right: 65px !important;
}

/* Keep password icons inside the field */
#registerform .show-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    z-index: 5;
    transform: translateY(-50%);
}

/* Registration information message */
#registerform #reg_passmail {
    display: block;
    width: 100%;
    margin: 16px 0 !important;
    color: #50575e;
    font-size: 12px;
    line-height: 1.5;
}

/* Register button */
#registerform #wp-submit {
    width: 100% !important;
    min-height: 44px;
    margin: 8px 0 0 !important;
}

/* Mobile adjustments */
@media screen and (max-width: 480px) {
    #registerform {
        width: 100%;
    }

    #registerform > p {
        margin-bottom: 16px !important;
    }

    #registerform .description {
        font-size: 11px;
    }
}
