
/* ================= MYCDIC OFFICIAL JOIN-US STRUCTURE OVERRIDES =================
   Visual and layout improvements only. No form IDs, field names, submission URL,
   validation logic, or data sending logic are changed here.
============================================================================= */

:root {
    --join-green: #006233;
    --join-green-dark: #004724;
    --join-red: #c1272d;
    --join-gold: #b99a38;
    --join-ink: #25343b;
    --join-muted: #617078;
    --join-soft: #f6f8f6;
    --join-line: rgba(0, 98, 51, 0.14);
    --join-shadow: 0 14px 34px rgba(24, 46, 38, 0.08);
}

body {
    font-family: 'Source Sans 3', 'Poppins', Arial, sans-serif;
    color: var(--join-ink);
    background: #ffffff;
}

.application-hero h1,
.application-page h1,
.application-page h2,
.application-page h3,
.application-page h4,
.sidebar-card h3,
.form-header-pro h2,
.section-heading h3 {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.012em;
}

.application-hero {
    position: relative;
    padding: 78px 0 76px;
    color: #ffffff;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.10), transparent 28%),
        linear-gradient(90deg, rgba(0, 71, 36, 0.97), rgba(0, 98, 51, 0.86)),
        linear-gradient(135deg, #004724, #006233);
    overflow: hidden;
}

.application-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.04) 25%, transparent 25%),
        linear-gradient(225deg, rgba(255,255,255,0.03) 25%, transparent 25%);
    background-size: 42px 42px;
    opacity: 0.42;
    pointer-events: none;
}

.application-hero .hero-pattern {
    display: none;
}

.application-hero-content {
    max-width: 900px;
    margin: 0;
    text-align: left;
    position: relative;
    z-index: 2;
}

.application-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    margin-bottom: 18px;
    font-size: 0.82rem;
    color: #f6e8b5;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-weight: 700;
}

.application-badge::before {
    content: "";
    width: 34px;
    height: 1px;
    background: #f6e8b5;
}

.application-hero h1 {
    max-width: 850px;
    font-size: clamp(2.05rem, 4.2vw, 3.65rem);
    line-height: 1.18;
    margin: 0 0 16px;
}

.application-hero p {
    max-width: 800px;
    margin: 0;
    color: rgba(255,255,255,0.90);
    font-size: 1.05rem;
    line-height: 1.85;
}

.application-page {
    background: linear-gradient(180deg, #ffffff 0%, #f6f8f6 100%);
    padding: 72px 0 88px;
}

.application-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.application-sidebar {
    gap: 16px;
    position: sticky;
    top: 24px;
}

.sidebar-card,
.application-form-card {
    background: #ffffff;
    border: 1px solid var(--join-line);
    border-radius: 8px;
    box-shadow: var(--join-shadow);
}

.sidebar-card {
    padding: 22px;
}

.sidebar-card h3 {
    color: var(--join-green-dark);
    font-size: 1.08rem;
    line-height: 1.4;
    margin: 0 0 11px;
}

.sidebar-card p,
.sidebar-list li,
.sidebar-steps li {
    color: var(--join-muted);
    line-height: 1.62;
}

.sidebar-list,
.sidebar-steps {
    margin: 0;
    padding: 0;
}

.sidebar-list li,
.sidebar-steps li {
    margin-bottom: 12px;
}

.sidebar-list li:last-child,
.sidebar-steps li:last-child {
    margin-bottom: 0;
}

.sidebar-list i {
    color: var(--join-green);
}

.sidebar-steps span {
    min-width: 30px;
    height: 30px;
    border-radius: 4px;
    background: rgba(0, 98, 51, 0.08);
    color: var(--join-green);
    font-size: 0.82rem;
}

.official-notice-card {
    border-left: 4px solid var(--join-gold);
}

.application-id-box {
    border-radius: 6px;
    background: #f8fbf9;
    border: 1px solid rgba(0,98,51,0.12);
}

#applicationNumberDisplay {
    color: var(--join-red);
}

.application-form-card {
    padding: 0;
    overflow: hidden;
}

.form-header-pro {
    margin: 0;
    padding: 30px 34px;
    border-bottom: 1px solid var(--join-line);
    background: #ffffff;
}

.form-header-pro h2 {
    color: var(--join-green-dark);
    font-size: 1.62rem;
    line-height: 1.35;
    margin: 0 0 10px;
}

.form-header-pro p {
    color: var(--join-muted);
    line-height: 1.72;
}

.progress-wrapper {
    margin: 0;
    padding: 22px 34px;
    border-bottom: 1px solid var(--join-line);
    background: #f8fbf9;
}

.progress-top {
    color: var(--join-ink);
    font-weight: 700;
}

.progress-bar {
    height: 9px;
    background: #e8efeb;
}

.progress-fill {
    background: linear-gradient(90deg, var(--join-green), var(--join-red));
}

#smartApplicationForm {
    padding: 34px;
}

.section-heading {
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--join-line);
}

.section-heading span {
    color: var(--join-red);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.section-heading h3 {
    color: var(--join-green-dark);
    font-size: 1.32rem;
    line-height: 1.4;
}

.section-heading p {
    color: var(--join-muted);
    line-height: 1.72;
}

.form-grid-pro {
    gap: 18px;
}

.form-group-pro label {
    color: var(--join-ink);
    font-size: 0.94rem;
    font-weight: 700;
}

.form-group-pro input,
.form-group-pro select,
.form-group-pro textarea {
    border: 1px solid rgba(0,98,51,0.16);
    border-radius: 5px;
    padding: 13px 14px;
    background: #fbfdfc;
    color: var(--join-ink);
    font-family: 'Source Sans 3', 'Poppins', Arial, sans-serif;
}

.form-group-pro input:focus,
.form-group-pro select:focus,
.form-group-pro textarea:focus {
    border-color: rgba(0,98,51,0.45);
    box-shadow: 0 0 0 3px rgba(0,98,51,0.08);
}

.check-card,
.radio-card {
    border: 1px solid rgba(0,98,51,0.14);
    border-radius: 6px;
    background: #ffffff;
    min-height: 66px;
    padding: 14px;
}

.check-card:hover,
.radio-card:hover,
.check-card:has(input:checked),
.radio-card:has(input:checked) {
    border-color: var(--join-green);
    background: #f8fbf9;
    box-shadow: 0 10px 20px rgba(24,46,38,0.07);
}

.check-card input,
.radio-card input,
.checkbox-pro input {
    accent-color: var(--join-green);
}

.check-card span,
.radio-card span,
.checkbox-pro span,
.smart-summary-box {
    color: var(--join-ink);
}

.question-block {
    border-bottom: 1px solid var(--join-line);
}

.question-block h4 {
    color: var(--join-green-dark);
}

.info-note {
    border-left-color: var(--join-green);
    background: rgba(0,98,51,0.06);
    border-radius: 5px;
    color: #455f58;
}

.legal-note {
    border-left-color: var(--join-red);
    background: rgba(193,39,45,0.05);
}

.agreement-box,
.final-review-box,
.upload-preview {
    border: 1px solid var(--join-line);
    border-radius: 6px;
    background: #f8fbf9;
}

.signature-box {
    border-radius: 6px;
    border-color: rgba(0,98,51,0.16);
}

.secondary-btn {
    border-radius: 4px;
    background: #ffffff;
    border-color: var(--join-line);
    color: var(--join-green-dark);
}

.form-navigation {
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--join-line);
}

.form-navigation .nav-btn,
.form-navigation .submit-btn-pro {
    border-radius: 4px;
    min-height: 48px;
    padding: 12px 22px;
    font-weight: 700;
}

.form-navigation .prev-btn {
    background: #eef4f1;
    color: var(--join-green-dark);
}

.form-navigation .next-btn,
.form-navigation .submit-btn-pro {
    background: var(--join-green);
    color: #ffffff;
}

.form-navigation .next-btn:hover,
.form-navigation .submit-btn-pro:hover {
    background: var(--join-green-dark);
    box-shadow: none;
}

.form-message-pro {
    padding: 14px 15px;
    border-radius: 5px;
    background: #f8fbf9;
    border: 1px solid var(--join-line);
}

.form-message-pro.success {
    color: var(--join-green-dark);
    background: rgba(0,98,51,0.08);
}

.form-message-pro.error {
    color: var(--join-red);
    background: rgba(193,39,45,0.08);
    border-color: rgba(193,39,45,0.18);
}

.footer-logo-img {
    object-fit: contain;
}

@media (max-width: 1100px) {
    .application-layout {
        grid-template-columns: 1fr;
    }

    .application-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .application-hero {
        padding: 62px 0 66px;
    }

    .application-hero h1 {
        font-size: 2.15rem;
    }

    .application-page {
        padding: 56px 0 68px;
    }

    .application-sidebar {
        grid-template-columns: 1fr;
    }

    .form-header-pro,
    .progress-wrapper,
    #smartApplicationForm {
        padding: 22px;
    }

    .form-grid-pro,
    .checkbox-grid,
    .radio-grid,
    .departments-grid {
        grid-template-columns: 1fr;
    }

    .form-navigation {
        flex-direction: column;
        align-items: stretch;
    }

    .form-navigation .nav-btn,
    .form-navigation .submit-btn-pro {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* ================= MYCDIC SMART APPLICATION V1.2 ================= */
.join-audience-section {
    padding: 74px 0 30px;
    background: linear-gradient(180deg, #f7faf8 0%, #ffffff 100%);
}

.audience-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.smart-location-grid select,
.smart-location-grid input,
#issuanceCountry,
#moroccoOriginRegion,
#moroccoOriginCity {
    width: 100%;
}

.smart-conditional-panel {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid rgba(0, 98, 51, 0.16);
    border-left: 5px solid var(--join-green);
    border-radius: 8px;
    background: #f8fbf9;
}

.compact-heading {
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.compact-heading h3 {
    font-size: 1.18rem;
}

.location-service-status {
    min-height: 22px;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 5px;
    color: var(--join-muted);
    background: #f5f7f6;
    font-size: 0.9rem;
}

.location-service-status:empty {
    display: none;
}

.location-service-status.loading {
    color: #72560a;
    background: #fff9e8;
}

.location-service-status.success {
    color: var(--join-green-dark);
    background: rgba(0, 98, 51, 0.08);
}

.location-service-status.warning,
.location-service-status.error {
    color: #9c2025;
    background: rgba(193, 39, 45, 0.08);
}

.legal-agreement-box {
    display: grid;
    gap: 14px;
    padding: 22px;
    border-left: 5px solid var(--join-gold);
    background: #fffdf5;
}

.legal-agreement-intro h4 {
    margin: 0 0 8px;
    color: var(--join-green-dark);
}

.legal-agreement-intro p {
    margin: 0;
    color: var(--join-muted);
    line-height: 1.65;
}

.legal-checkbox {
    align-items: flex-start;
    padding: 14px;
    border: 1px solid rgba(0, 98, 51, 0.12);
    border-radius: 6px;
    background: #ffffff;
}

.legal-checkbox input {
    margin-top: 4px;
}

.legal-checkbox span {
    line-height: 1.65;
}

.legal-checkbox a,
.legal-links-row a {
    color: var(--join-green-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 700;
}

.legal-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.legal-links-row a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 11px;
    border: 1px solid rgba(0, 98, 51, 0.14);
    border-radius: 4px;
    background: #ffffff;
    text-decoration: none;
}

.form-trap {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

input[readonly] {
    background: #eef4f1 !important;
    color: var(--join-green-dark) !important;
    font-weight: 700;
}

@media (max-width: 1000px) {
    .audience-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .audience-grid {
        grid-template-columns: 1fr;
    }

    .smart-conditional-panel,
    .legal-agreement-box {
        padding: 18px;
    }

    .legal-links-row {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* ================= LOCATION SYSTEM V1.2.2 ================= */
.calculated-profile-card {
    border: 1px solid rgba(0, 98, 51, 0.18);
    border-left: 5px solid var(--join-green, #006233);
    border-radius: 8px;
    padding: 18px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbf9 100%);
}

.calculated-profile-card .calculated-profile-label {
    display: block;
    color: var(--join-red, #c1272d);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.calculated-profile-card strong {
    display: block;
    color: var(--join-green-dark, #004724);
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.12rem;
    line-height: 1.45;
}

.calculated-profile-card p {
    margin: 8px 0 0;
    color: var(--join-muted, #63727a);
    line-height: 1.65;
}

.location-manual-input {
    margin-top: 10px;
}

.location-service-status {
    margin-top: 16px;
    border-radius: 7px;
    padding: 12px 14px;
    background: #f6f8f6;
    border: 1px solid rgba(0, 98, 51, 0.12);
    color: #42564e;
    line-height: 1.55;
}

.location-service-status:empty {
    display: none;
}

.location-service-status.loading {
    background: #fffaf0;
    border-color: rgba(185, 154, 56, 0.28);
    color: #806317;
}

.location-service-status.success {
    background: #f3faf6;
    border-color: rgba(0, 98, 51, 0.22);
    color: #005b31;
}

.location-service-status.warning {
    background: #fff5f5;
    border-color: rgba(193, 39, 45, 0.2);
    color: #a02127;
}

/* MYCDIC v1.4.0 institutional advisor and legal controls */
.advisor-institutional-note {
  margin: 0 0 24px;
  padding: 18px 20px;
  border: 1px solid rgba(181, 145, 44, .38);
  border-left: 5px solid #b5912c;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffdf5, #f4f8f5);
  color: #183d30;
}
.advisor-institutional-note strong {
  display: block;
  margin-bottom: 6px;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  color: #063f2d;
}
.advisor-institutional-note p { margin: 0; line-height: 1.65; }
.legal-agreement-box .legal-checkbox {
  align-items: flex-start;
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid #dce7e1;
  border-radius: 10px;
  background: #fff;
}
.legal-agreement-box .legal-checkbox:has(input:checked) {
  border-color: rgba(0, 98, 51, .5);
  background: #f3faf6;
}
#signatureName[readonly] {
  background: #eef4f1;
  color: #173d2f;
  font-weight: 700;
  cursor: not-allowed;
}
@media (max-width: 720px) {
  .advisor-institutional-note { padding: 15px; }
}

.upload-limit-note{display:block;margin:6px 0 10px;color:#62766d;font-size:.86rem;line-height:1.45}.form-message-pro.error{white-space:pre-line}.form-message-pro.success a{font-weight:800;color:inherit;text-decoration:underline}

.identity-preview-meta{font-size:.78rem;color:#5e7067;margin-bottom:10px;font-weight:700;overflow-wrap:anywhere}.upload-preview-content img{display:block;width:auto;max-width:100%;max-height:360px;object-fit:contain;margin:10px auto 0;background:#fff;box-shadow:0 10px 28px rgba(15,55,38,.08)}.upload-preview-content .pdf-preview{flex-wrap:wrap}.upload-preview-content .pdf-preview small{display:block;width:100%;font-size:.75rem;color:#6d7b74;margin-top:5px}

.leadership-depth-panel{margin-top:28px;padding:24px;border:1px solid rgba(0,98,51,.16);border-radius:12px;background:linear-gradient(180deg,#f8fbf9,#fff)}.leadership-depth-panel .compact-heading{margin-bottom:18px}.leadership-depth-panel .question-block{padding:18px 0;border-top:1px solid rgba(0,98,51,.10)}

/* v1.9.17.1.6 identity document preview */
.identity-preview-visual{width:100%;margin-top:10px;border:1px solid rgba(0,98,51,.14);border-radius:16px;overflow:hidden;background:#f7faf8;min-height:180px;display:flex;align-items:center;justify-content:center}.identity-preview-visual img{max-width:100%;max-height:430px;object-fit:contain;margin:0!important;box-shadow:none!important}.identity-preview-pdf{height:430px;display:block}.identity-preview-pdf object{display:block;width:100%;height:100%;border:0;background:#fff}.identity-preview-actions{display:flex;justify-content:flex-end;margin-top:9px}.identity-preview-actions a{font-size:.82rem;font-weight:800;color:#006233;text-decoration:none;border-bottom:1px solid rgba(0,98,51,.28)}
@media(max-width:700px){.identity-preview-pdf{height:360px}.identity-preview-visual img{max-height:360px}}
/* v1.9.17.1.6 CSP-safe identity preview */
.identity-preview-pdf-card{min-height:150px;height:auto;padding:24px}.identity-preview-pdf-card .pdf-preview{margin:0;width:100%;justify-content:center;text-align:center}.identity-preview-pdf-card .pdf-preview i{font-size:2rem;color:#a6252e}.identity-preview-pdf-card .pdf-preview small{max-width:520px;margin:8px auto 0}

/* V16.0.26.6: official post-submit verification action remains clickable. */
.form-message-pro.success .application-track-link{display:inline-flex;align-items:center;gap:7px;margin-top:10px;padding:10px 14px;border-radius:8px;background:#006233;color:#fff!important;text-decoration:none!important;font-weight:800;pointer-events:auto!important;cursor:pointer}
.form-submitted .form-message-pro,.form-submitted .form-message-pro *{pointer-events:auto}

/* ========================================================================== */
/* V16.0.27.0 Submission-Gated Task-First                                    */
/* Human verification + canonical-delivery progress                          */
/* ========================================================================== */
.join-eligibility-note {
    margin-top: 14px;
    padding: 13px 16px;
    border-left: 4px solid #006233;
    background: #f3f8f5;
    border-radius: 10px;
    color: #334b42;
}
.human-verification-card {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid #d6e4dc;
    background: linear-gradient(180deg, #f8fbf9 0%, #ffffff 100%);
    border-radius: 14px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.human-verification-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #e7f3ed;
    color: #006233;
    flex: 0 0 auto;
}
.human-verification-content { flex: 1; min-width: 0; }
.human-verification-title { font-weight: 800; color: #123d2d; margin-bottom: 4px; }
.human-verification-content p { margin: 0 0 12px; color: #5c6f66; line-height: 1.55; font-size: 13px; }
.human-verification-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 105px auto;
    gap: 10px;
    align-items: center;
}
.human-verification-row label { font-weight: 800; color: #173f31; }
.human-verification-row input {
    min-height: 43px;
    border: 1px solid #cbdad2;
    border-radius: 10px;
    padding: 8px 12px;
    font: inherit;
    background: #fff;
}
.bot-refresh-btn { min-height: 43px; white-space: nowrap; }
.human-verification-status { margin-top: 9px; font-size: 12px; color: #63756d; }
.human-verification-status.error { color: #a5232a; }

.submission-pipeline {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #cfe0d6;
    border-radius: 16px;
    background: #fbfdfc;
    box-shadow: 0 10px 28px rgba(0, 57, 35, 0.08);
}
.submission-pipeline[hidden] { display: none !important; }
.submission-pipeline-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; }
.submission-pipeline-kicker { display: block; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 800; color: #7e6720; margin-bottom: 4px; }
.submission-pipeline-head strong { display: block; color: #0a4d33; font-size: 17px; }
#submissionPipelinePercent { color: #006233; font-weight: 900; font-size: 18px; }
.submission-pipeline-track {
    height: 11px;
    margin-top: 14px;
    background: #e3ebe7;
    border-radius: 999px;
    overflow: hidden;
}
.submission-pipeline-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #006233, #168354);
    border-radius: inherit;
    transition: width .35s ease;
}
.submission-pipeline-detail { margin-top: 10px; color: #586c62; font-size: 13px; line-height: 1.5; }
.submission-pipeline-stages { margin-top: 13px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.submission-pipeline-stages span { font-size: 10px; text-align: center; color: #7a8982; padding-top: 7px; border-top: 2px solid #dce6e1; }
.submission-pipeline-stages span.active { color: #006233; border-top-color: #006233; font-weight: 800; }
.submission-pipeline-stages span.done { color: #245642; border-top-color: #75a58f; }
.submission-pipeline.warning { border-color: #dec98b; background: #fffdf5; }
.submission-pipeline.error { border-color: #e0b9bc; background: #fff8f8; }

@media (max-width: 720px) {
    .human-verification-card { flex-direction: column; }
    .human-verification-row { grid-template-columns: 1fr; }
    .bot-refresh-btn { width: 100%; }
    .submission-pipeline-stages { grid-template-columns: 1fr; gap: 3px; }
    .submission-pipeline-stages span { text-align: left; border-top: 0; border-left: 2px solid #dce6e1; padding: 3px 0 3px 8px; }
    .submission-pipeline-stages span.active, .submission-pipeline-stages span.done { border-left-color: #006233; }
}
.form-message-pro.warning{white-space:normal;background:#fff8df;border:1px solid #e3c86c;color:#654f0d}.form-message-pro.warning a{color:#006233;font-weight:800;text-decoration:underline}

/* V16.0.27.2: freeze the approved application immediately after Submit. */
.form-locked input,
.form-locked select,
.form-locked textarea,
.form-locked button,
.form-submitted input,
.form-submitted select,
.form-submitted textarea,
.form-submitted button { cursor: not-allowed !important; }
.form-locked #signatureCanvas,
.form-submitted #signatureCanvas { pointer-events: none !important; opacity: .82; cursor: not-allowed !important; }
.form-locked .signature-box { position: relative; }
.form-locked .signature-box::after {
  content: 'Signature locked while the application is being recorded';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #0a4d33;
  background: rgba(247, 250, 248, .86);
  border-radius: inherit;
  pointer-events: none;
}
.submission-pipeline.success { border-color: #8fc5a8; background: #f4fbf7; }
.submission-pipeline.success .submission-pipeline-kicker { color: #006233; }
