/* ===============================================================
   CANDIDATE PROFILE MODAL — Navy / Orange / Beige
   Shared across checkout.html and course-details.html
=============================================================== */

.profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 50, 96, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: profileFadeIn 0.25s ease-out;
}

@keyframes profileFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.profile-modal {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 460px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(26, 50, 96, 0.35);
    animation: profileSlideUp 0.3s ease-out;
}

@keyframes profileSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-modal-accent {
    height: 6px;
    width: 100%;
    background: linear-gradient(90deg, #1a3260 0%, #FF8C00 100%);
}

.profile-modal-header {
    background: #1a3260;
    padding: 28px 32px 24px;
    text-align: center;
    color: #fff;
}

.profile-modal-icon {
    width: 56px;
    height: 56px;
    background: #FF8C00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 140, 0, 0.4);
}

.profile-modal-header h3 {
    margin: 0 0 6px;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
}

.profile-modal-header p {
    margin: 0;
    font-size: 0.88rem;
    color: #cbd5e1;
    font-weight: 400;
}

.profile-modal-body {
    padding: 26px 32px 30px;
    background: #f2ebe0;
}

.profile-field {
    margin-bottom: 16px;
    flex: 1;
}

.profile-field-row {
    display: flex;
    gap: 12px;
}

.profile-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a3260;
    margin-bottom: 6px;
}

.profile-field label i {
    color: #FF8C00;
    font-size: 0.8rem;
    width: 14px;
}

.profile-optional-tag {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.profile-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2d9d0;
    background: #ffffff;
    font-size: 0.92rem;
    font-family: 'DM Sans', sans-serif;
    color: #1a3260;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-field input::placeholder {
    color: #b0a89c;
}

.profile-field input:focus {
    outline: none;
    border-color: #FF8C00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}

.profile-error {
    min-height: 18px;
    color: #E53E3E;
    font-size: 0.82rem;
    font-weight: 500;
    margin: 4px 0 12px;
}

.profile-save-btn {
    width: 100%;
    background: #FF8C00;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 6px 16px rgba(255, 140, 0, 0.3);
}

.profile-save-btn:hover:not(:disabled) {
    background: #e67e00;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.4);
}

.profile-save-btn:disabled {
    background: #d1a366;
    cursor: not-allowed;
    box-shadow: none;
}

.profile-privacy-note {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.profile-privacy-note i {
    color: #1a3260;
    font-size: 0.72rem;
}

/* "Maybe later" skip button — used only on the visit-nudge modal */
.profile-skip-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    padding: 12px 0 0;
    cursor: pointer;
    text-decoration: underline;
}
.profile-skip-btn:hover {
    color: #1a3260;
}

@media (max-width: 480px) {
    .profile-modal-header { padding: 22px 22px 20px; }
    .profile-modal-body   { padding: 22px; }
    .profile-field-row    { flex-direction: column; gap: 0; }
}

/* ===============================================================
   PHONE INPUT GROUP + COUNTRY DROPDOWNS
=============================================================== */

.phone-input-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.phone-input-group .country-code-select {
    flex: 0 0 auto;
    width: auto;
}

.phone-input-group input[type="tel"] {
    flex: 1 1 auto;
    min-width: 0;
}

.country-code-select {
    position: relative;
    flex-shrink: 0;
}

.country-full-select {
    width: 100%;
}

.country-code-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 10px;
    border: 1.5px solid #e2d9d0;
    background: #ffffff;
    font-size: 0.92rem;
    font-family: 'DM Sans', sans-serif;
    color: #1a3260;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.country-full-btn {
    width: 100%;
    justify-content: flex-start;
}

.country-full-btn span:last-of-type {
    margin-left: auto;
}

.country-code-btn:hover {
    border-color: #FF8C00;
}

.country-code-select.open .country-code-btn {
    border-color: #FF8C00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}

.country-code-btn i {
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.2s;
}

.country-code-select.open .country-code-btn i {
    transform: rotate(180deg);
}

#selectedCountryName {
    color: #1a3260;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

#selectedCountryName.placeholder-text {
    color: #b0a89c;
    font-weight: 400;
}

.country-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 260px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(26, 50, 96, 0.22);
    border: 1px solid #e2d9d0;
    z-index: 10001;
    overflow: hidden;
}

.country-full-select .country-dropdown-panel {
    width: 100%;
}

.country-code-select.open .country-dropdown-panel {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.country-dropdown-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: none;
    border-bottom: 1.5px solid #f2ebe0;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    color: #1a3260;
    outline: none;
    background: #fafaf8;
}

.country-dropdown-search::placeholder {
    color: #b0a89c;
}

.country-dropdown-list {
    max-height: 220px;
    overflow-y: auto;
}

.country-dropdown-list::-webkit-scrollbar { width: 6px; }
.country-dropdown-list::-webkit-scrollbar-thumb { background: #e2d9d0; border-radius: 4px; }

.country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #1a3260;
    transition: background 0.12s;
}

.country-option:hover,
.country-option.highlighted {
    background: #FFF3EE;
}

.country-option .flag-emoji { font-size: 1.1rem; flex-shrink: 0; }
.country-option .country-option-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-option .country-option-dial { color: #94a3b8; font-size: 0.8rem; flex-shrink: 0; }

.country-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: #b0a89c;
    font-size: 0.85rem;
}

.field-error-message {
    display: block;
    min-height: 15px;
    color: #e53935;
    font-size: 0.76rem;
    line-height: 1.35;
    margin-top: 4px;
    word-wrap: break-word;
}

.profile-field:has(.field-error-message:not(:empty)) input,
.profile-field:has(.field-error-message:not(:empty)) .country-code-btn {
    border-color: #e53935 !important;
}

@media (max-width: 480px) {
    .phone-input-group .country-code-btn { padding: 10px 8px; font-size: 0.85rem; gap: 4px; }
    .phone-input-group input[type="tel"] { font-size: 0.85rem; padding: 10px 10px; }
}

@media (max-width: 360px) {
    .phone-input-group .country-code-btn i { display: none; }
    .phone-input-group .country-code-btn { padding: 10px 6px; font-size: 0.8rem; }
    .phone-input-group input[type="tel"] { font-size: 0.8rem; padding: 10px 8px; }
}

/* ==========================================================================
   MOBILE RESPONSIVE FIX
   ========================================================================== */
@media (max-width: 600px) {
  .profile-overlay { padding: 0 !important; align-items: flex-end !important; }

  .profile-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    animation: profileSlideUp 0.3s ease-out !important;
  }

  .profile-modal-header { padding: 22px 20px 18px !important; flex-shrink: 0 !important; }
  .profile-modal-icon { width: 48px !important; height: 48px !important; font-size: 1.1rem !important; margin-bottom: 10px !important; }
  .profile-modal-header h3 { font-size: 1.15rem !important; }
  .profile-modal-header p { font-size: 0.82rem !important; }

  .profile-modal-body {
    padding: 20px 18px 26px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 1 auto !important;
    box-sizing: border-box !important;
  }

  .profile-field { margin-bottom: 14px !important; }
  .profile-field label { font-size: 0.8rem !important; }
  .profile-field input, .country-code-btn { padding: 12px 12px !important; font-size: 0.9rem !important; }

  .phone-input-group { flex-direction: column !important; gap: 8px !important; }
  .country-code-select:not(.country-full-select) { width: 100% !important; }
  .country-code-btn:not(.country-full-btn) { width: 100% !important; justify-content: space-between !important; }

  .profile-field-row { flex-direction: column !important; gap: 0 !important; }

  .country-dropdown-panel { width: 100% !important; max-width: calc(100vw - 40px) !important; left: 0 !important; right: 0 !important; }
  .country-dropdown-list { max-height: 180px !important; }

  .profile-save-btn { padding: 13px !important; font-size: 0.92rem !important; }
  .profile-privacy-note { font-size: 0.72rem !important; }
}

@media (max-width: 360px) {
  .profile-modal-body { padding: 16px 14px 22px !important; }
  .profile-field input, .country-code-btn { font-size: 0.85rem !important; padding: 10px 10px !important; }
}
#captchaVerifyOverlay .captcha-box {
    background: #f2ebe0;               /* beige, matches modal body */
    border: 1.5px solid rgba(26, 50, 96, 0.15); /* soft navy border */
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
}

#captchaVerifyOverlay .captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

#captchaVerifyOverlay #skipCaptchaImage {
    height: 48px;
    border-radius: 6px;
    border: 1px solid rgba(26, 50, 96, 0.2);
    background: #fff;
    flex: 1;
    object-fit: contain;
}

#captchaVerifyOverlay #skipCaptchaRefreshBtn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    background: #1a3260;               /* navy */
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#captchaVerifyOverlay #skipCaptchaRefreshBtn:hover {
    background: #142748;
}

#captchaVerifyOverlay #skipCaptchaInput {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid rgba(26, 50, 96, 0.25);
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1a3260;
    background: #fff;
    box-sizing: border-box;
}

#captchaVerifyOverlay #skipCaptchaInput:focus {
    outline: none;
    border-color: #FF8C00;             /* orange focus ring, matches CTA color */
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}

@media (max-width: 480px) {
    #captchaVerifyOverlay .captcha-row {
        flex-wrap: wrap;
    }
    #captchaVerifyOverlay #skipCaptchaImage {
        width: 100%;
        height: 56px;
    }
    #captchaVerifyOverlay #skipCaptchaRefreshBtn {
        width: 100%;
        height: 38px;
    }
}
#captchaVerifyOverlay #skipCaptchaImage {
    height: 48px;
    width: 140px;
    max-width: 140px;
    flex: 0 0 auto;          /* was flex: 1 — stop it stretching */
    border-radius: 6px;
    border: 1px solid rgba(26, 50, 96, 0.2);
    background: #fff;
    object-fit: contain;
}
@media (max-width: 480px) {
    #captchaVerifyOverlay .captcha-row {
        flex-wrap: wrap;
    }
    #captchaVerifyOverlay #skipCaptchaImage {
        width: 120px;
        max-width: 120px;
        height: 44px;
    }
    #captchaVerifyOverlay #skipCaptchaRefreshBtn {
        width: 100%;
        height: 38px;
    }
}
#captchaVerifyOverlay .field-error-message {
    display: block;
    color: #E53E3E;
    font-size: 0.82rem;
    margin-top: 6px;
    min-height: 1.1em;
}
