*, *::before, *::after { box-sizing: border-box; }
:root {
    --nmc-blue: #1d4ed8;
    --nmc-indigo: #4f46e5;
    --nmc-purple: #7c3aed;
    --nmc-green: #16a34a;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #edf2f8;
}

/* Page header */
.reg-hero { background: #0d203a; }

.reg-hero-tricolor { display: flex; height: 3px; width: 100%; }
.tc-saffron { flex: 1; background: #ff9933; }
.tc-white   { flex: 1; background: #ffffff; }
.tc-green   { flex: 1; background: #138808; }

.reg-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 83px;
    padding: 18px clamp(16px, 3.1vw, 40px);
}

.reg-hero-brand { display: flex; align-items: center; gap: 13px; min-width: 0; }

.reg-hero-logo svg { width: 22px; height: 22px; }

.reg-hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 47px;
    height: 47px;
    border: 2px solid #347ff4;
    border-radius: 50%;
    background: #142b4b;
    color: #93c5fd;
}

.reg-hero-org { min-width: 0; }

.reg-hero-english {
    margin-bottom: 3px;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.08em;
    color: #70a9f5;
    text-transform: uppercase;
}

.reg-hero-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.015em;
    color: #fff;
}

.reg-hero-actions { flex-shrink: 0; }

.reg-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 18px;
    border: 1px solid #324d7a;
    border-radius: 8px;
    background: #182747;
    color: #e2eafb;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    transition: background .2s, border-color .2s;
}

.reg-login-btn i { flex-shrink: 0; font-size: 15px; }
.reg-login-btn:hover { background: #22385c; border-color: #70a9f5; color: #fff; }
.reg-login-btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }

/* Registration sections */
.reg-container { width: 100%; max-width: 1024px; margin: 35px auto 0; padding: 0 16px; }
.reg-section { background: #fff; border: 1px solid #dfe6ef; border-radius: 15px; box-shadow: 0 2px 3px rgba(15,32,58,.05); margin-bottom: 24px; overflow: hidden; }
.reg-section-head { display: flex; align-items: center; gap: 13px; padding: 21px 27px; border-bottom: 1px solid #e8eef5; }
.reg-section-num { width: 31px; height: 31px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; font-size: 15px; font-weight: 700; }
.reg-section-num--blue { background: #2860f2; }
.reg-section-num--purple { background: #7c36f4; }
.reg-section-title { margin: 0; color: #0d203a; font-size: 17px; font-weight: 700; }
.reg-communication-note { display: flex; align-items: baseline; gap: 9px; padding: 12px 27px 12px 23px; background: #fff7e6; color: #7a4a00; border-left: 4px solid #f59e0b; border-bottom: 1px solid #fde2b0; font-size: 13.5px; font-weight: 500; line-height: 1.5; }
.reg-communication-note i { flex-shrink: 0; color: #d97706; font-size: 15px; }
.reg-communication-note strong { color: #5c3700; font-weight: 700; }
.reg-section-body { padding: 24px 27px 32px; }
.reg-fields { --bs-gutter-x: 24px; --bs-gutter-y: 17px; }
.reg-label { display: block; margin-bottom: 4px; color: #3d506b; font-size: 13px; font-weight: 400; }
.reg-label--primary { color: #0d203a; font-weight: 700; }
.reg-field { position: relative; }
.reg-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a7c0; font-size: 14px; line-height: 1; pointer-events: none; z-index: 2; }
.reg-icon--top { top: 13px; transform: none; }
.reg-input { width: 100%; min-height: 38px; border: 1.5px solid #cad7e8; border-radius: 9px; background-color: #fff; color: #0d203a; font-size: 14px; line-height: 1.4; }
input.reg-input, textarea.reg-input, select.reg-input { padding: 8px 12px 8px 36px; }
select.reg-input { padding-right: 27px; background-size: 12px 9px; }
textarea.reg-input { min-height: 53px; resize: vertical; }
.reg-input::placeholder { color: #94a7c0; opacity: 1; }
.reg-input:focus { border-color: #2860f2; box-shadow: 0 0 0 3px rgba(40,96,242,.12); outline: none; }
.reg-input:disabled { background-color: #f5f7fa; }
.reg-input.is-invalid { border-color: #dc3545; }
.error-message { margin-top: 3px; color: #b42335; font-size: 12px; }
.pw-hint { margin-top: 3px; font-size: 12px; color: #64748b; }
/* Show/hide password control. Sits inside .reg-field opposite the leading lock icon;
   the input gets extra right padding so long values never run under the button. */
.reg-pw-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #94a7c0; font-size: 15px; line-height: 1; cursor: pointer; z-index: 3; }
.reg-pw-toggle:hover { color: #2860f2; background: #eff6ff; }
.reg-pw-toggle:focus-visible { outline: 2px solid #2860f2; outline-offset: 1px; color: #2860f2; }
.reg-pw-toggle[aria-pressed="true"] { color: #2860f2; }
.reg-field:has(.reg-pw-toggle) input.reg-input { padding-right: 40px; }
/* Fallback for browsers without :has() -- the class is set by the toggle script. */
.reg-field.has-pw-toggle input.reg-input { padding-right: 40px; }
.reg-captcha-row { border-top: 1px solid #e8eef5; padding-top: 19px; margin-top: 24px; }
.captcha-wrap { display: flex; align-items: center; gap: 9px; }
.captcha-box { min-width: 103px; height: 36px; padding: 7px 13px; border: 1px dashed #cad7e8; border-radius: 9px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }
.captcha-box .login-math-captcha-text { font-size: 14px; font-weight: 500; letter-spacing: .1em; color: #0d203a; white-space: nowrap; }
.btn-captcha-refresh { width: 36px; height: 36px; border: 1.5px solid #cad7e8; border-radius: 9px; color: #657b99; background: #fff; font-size: 17px; }
.btn-captcha-refresh:hover { background: #eff6ff; }
input.captcha-answer { padding-left: 12px; }
.btn-reg-submit { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 43px; margin-top: 21px; padding: 9px 16px; border: 0; border-radius: 9px; background: linear-gradient(110deg,#2461ef,#4434cf); color: #fff; font-size: 14px; font-weight: 600; }
.btn-reg-submit i { font-size: 17px; }
.btn-reg-submit:hover { filter: brightness(1.06); }
.btn-reg-submit:disabled { opacity: .65; cursor: wait; }
.btn-reg-submit:focus-visible, .btn-captcha-refresh:focus-visible { outline: 3px solid #2860f2; outline-offset: 3px; }
.reg-alert { display: flex; gap: 8px; padding: 12px 16px; margin-bottom: 16px; border-radius: 9px; }
.reg-alert-error { background: #fef2f2; color: #991b1b; }
.reg-footer { text-align: center; padding: 0 8px 37px; color: #94a7c0; font-size: 11px; }
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single { display: flex; align-items: center; height: 38px; padding: 0 27px 0 36px; border: 1.5px solid #cad7e8; border-radius: 9px; background: #fff; }
.select2-container--default .select2-selection--single .select2-selection__rendered { padding: 0; font-size: 14px; color: #0d203a; line-height: 1.4; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 37px; right: 9px; }
.select2-container--default.select2-container--disabled .select2-selection--single { background: #f5f7fa; }
.select2-container--default.select2-container--focus .select2-selection--single { border-color: #2860f2; }
.is-invalid + .select2-container .select2-selection--single { border-color: #dc3545; }
.select2-dropdown { border-color: #cad7e8; }
@media (max-width: 1100px) {
    .reg-hero-inner { gap: 20px; }
    .reg-hero-title { font-size: 20px; }
}
@media (max-width: 767px) {
    .reg-container { margin-top: 24px; padding: 0 16px; }
    .reg-section { border-radius: 14px; margin-bottom: 24px; }
    .reg-section-head { padding: 20px; gap: 12px; }
    .reg-section-title { font-size: 18px; }
    .reg-section-num { width: 32px; height: 32px; font-size: 16px; }
    .reg-section-body { padding: 24px 20px; }
    .reg-communication-note { padding: 12px 20px; font-size: 14px; }
    .reg-label { font-size: 14px; }
    .reg-input, .select2-container--default .select2-selection--single .select2-selection__rendered { font-size: 16px; }
    .reg-input, .select2-container--default .select2-selection--single { min-height: 44px; }
    .select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; }
    .reg-fields { --bs-gutter-y: 18px; }
    .reg-footer { font-size: 12px; }
}
@media (max-width: 640px) {
    .reg-hero-inner { flex-wrap: wrap; padding: 20px 16px; }
    .reg-hero-brand { align-items: flex-start; gap: 12px; }
    .reg-hero-logo { width: 44px; height: 44px; border-width: 2px; }
    .reg-hero-english { font-size: 10px; }
    .reg-hero-title { font-size: 18px; }
    .reg-hero-actions { width: 100%; }
    .reg-login-btn { width: 100%; padding: 10px 14px; font-size: 14px; }
}


/* ── Pre-application notice dialog ─────────────────────────────────────────
   Shown on load; the applicant must acknowledge it with OK. Bootstrap's JS is
   not loaded on this page, so this is a self-contained dialog. */
body.reg-notice-open { overflow: hidden; }

.reg-notice-backdrop {
    position: fixed; inset: 0; z-index: 1080;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    background: rgba(13, 32, 58, .62);
}
.reg-notice-backdrop[hidden] { display: none; }

.reg-notice {
    display: flex; flex-direction: column;
    width: 100%; max-width: 780px; max-height: calc(100vh - 48px);
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 18px 48px rgba(13, 32, 58, .32);
}

.reg-notice-head {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 17px 24px;
    background: linear-gradient(110deg, #1a3a6b 0%, #1e5299 55%, #2563a8 100%);
    border-bottom: 3px solid #f0a500;
}
.reg-notice-head i { flex-shrink: 0; margin-top: 2px; font-size: 18px; color: #ffd066; }
.reg-notice-title { margin: 0; color: #fff; font-size: 16px; font-weight: 700; line-height: 1.35; }

.reg-notice-body { padding: 20px 24px; overflow-y: auto; color: #27384b; }
.reg-notice-body:focus-visible { outline: 2px solid #2860f2; outline-offset: -2px; }

.reg-notice-list strong, .reg-notice-accept strong { font-weight: 700; }
.reg-notice-list { margin: 0; padding-left: 19px; }
.reg-notice-list > li { margin-bottom: 13px; font-size: 13.5px; line-height: 1.65; text-align: justify; }
.reg-notice-list > li:last-child { margin-bottom: 0; }
.reg-notice-list > li::marker { font-weight: 700; color: #1a3a6b; }

.reg-notice-sublist { margin: 8px 0 0; padding-left: 21px; }
.reg-notice-sublist > li { margin-bottom: 5px; font-size: 13px; line-height: 1.6; }
.reg-notice-sublist > li::marker { font-weight: 600; color: #2860f2; }

.reg-notice-quote {
    margin: 9px 0 0; padding: 9px 13px;
    border-left: 3px solid #cad7e8; border-radius: 0 5px 5px 0;
    background: #f4f7fc;
    font-size: 12.5px; font-style: italic; line-height: 1.6; color: #3d506b;
}


.reg-notice-foot {
    display: flex; justify-content: flex-end;
    padding: 14px 24px;
    background: #f6f9fc; border-top: 1px solid #e8eef5;
}
.btn-reg-notice-ok {
    display: inline-flex; align-items: center; gap: 7px;
    min-width: 128px; justify-content: center;
    padding: 9px 26px; border: 0; border-radius: 8px;
    background: linear-gradient(110deg, #2461ef, #4434cf);
    color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-reg-notice-ok:hover { opacity: .93; }
.btn-reg-notice-ok:disabled { opacity: .5; cursor: not-allowed; }
.reg-notice-accept {
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: 20px; padding-top: 16px; border-top: 1px solid #dce4ee;
    font-size: 13.5px; line-height: 1.6; cursor: pointer;
}
.reg-notice-accept input {
    flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; accent-color: #2461ef;
}
.btn-reg-notice-ok:focus-visible { outline: 3px solid rgba(40, 96, 242, .45); outline-offset: 2px; }

@media (max-width: 575.98px) {
    .reg-notice-backdrop { padding: 12px; }
    .reg-notice-head, .reg-notice-body, .reg-notice-foot { padding-left: 16px; padding-right: 16px; }
    .reg-notice-title { font-size: 15px; }
    .reg-notice-list > li { font-size: 13px; text-align: left; }
    .btn-reg-notice-ok { width: 100%; }
}
