:root {
    --mdrhc-navy-950: #031a33;
    --mdrhc-navy-900: #062848;
    --mdrhc-navy-800: #0a3a62;
    --mdrhc-orange: #f57c00;
    --mdrhc-orange-soft: #fff2e5;
    --mdrhc-green: #079447;
    --mdrhc-green-soft: #e9f8ef;
    --mdrhc-text: #11243e;
    --mdrhc-muted: #697b90;
    --mdrhc-border: rgba(18, 45, 75, .12);
    --mdrhc-card: rgba(255, 255, 255, .96);
    --mdrhc-shadow: 0 28px 70px rgba(2, 26, 51, .22);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.mdrhc-login-page {
    margin: 0;
    min-height: 100vh;
    color: var(--mdrhc-text);
    background: #eef4fa;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

.mdrhc-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(420px, .58fr);
}

.mdrhc-login-identity {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
    overflow: hidden;
    background-image: var(--mdrhc-palace-image);
    background-size: cover;
    background-position: center;
}

.mdrhc-login-identity::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        radial-gradient(circle at 80% 14%, rgba(255,255,255,.10), transparent 28%),
        linear-gradient(110deg, rgba(3,26,51,.98) 0%, rgba(3,35,67,.94) 43%, rgba(3,35,67,.72) 65%, rgba(3,35,67,.20) 100%);
}

.mdrhc-login-identity::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: .17;
    background-image:
        linear-gradient(30deg, transparent 24%, rgba(255,255,255,.10) 25%, rgba(255,255,255,.10) 26%, transparent 27%, transparent 74%, rgba(255,255,255,.10) 75%, rgba(255,255,255,.10) 76%, transparent 77%);
    background-size: 54px 54px;
    mask-image: linear-gradient(to right, #000, transparent 70%);
}

.mdrhc-identity-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(2,20,39,.78), transparent 46%);
}

.mdrhc-identity-content {
    position: relative;
    z-index: 1;
    width: min(980px, 88%);
    min-height: 100vh;
    padding: clamp(42px, 7vh, 88px) clamp(34px, 6vw, 88px) 105px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mdrhc-brand-row {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-bottom: clamp(28px, 5vh, 54px);
}

.mdrhc-logo-frame {
    width: clamp(112px, 11vw, 166px);
    aspect-ratio: 1;
    flex: 0 0 auto;
    border-radius: 50%;
    padding: 7px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 18px 42px rgba(0,0,0,.28), 0 0 0 5px rgba(255,255,255,.11);
}

.mdrhc-logo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.mdrhc-country,
.mdrhc-government {
    margin: 0;
    letter-spacing: .035em;
    font-weight: 800;
}

.mdrhc-country {
    color: #fff;
    font-size: clamp(15px, 1.45vw, 22px);
}

.mdrhc-government {
    margin-top: 8px;
    color: #ff972b;
    font-size: clamp(15px, 1.35vw, 21px);
}

.mdrhc-ministry-copy h1 {
    max-width: 930px;
    margin: 0;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(38px, 5vw, 76px);
    line-height: .98;
    letter-spacing: -.025em;
    text-shadow: 0 4px 22px rgba(0,0,0,.32);
}

.mdrhc-tagline {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin: 25px 0 0;
    font-size: clamp(15px, 1.45vw, 21px);
    font-weight: 750;
}

.mdrhc-tagline span:nth-of-type(1) { color: #54d783; }
.mdrhc-tagline span:nth-of-type(2) { color: #ff9b31; }
.mdrhc-tagline span:nth-of-type(3) { color: #b6e08e; }
.mdrhc-tagline b { color: rgba(255,255,255,.65); }

.mdrhc-system-badge {
    width: fit-content;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: clamp(42px, 8vh, 86px);
    padding: 13px 20px 13px 13px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 18px;
    background: rgba(3,28,53,.58);
    box-shadow: 0 14px 40px rgba(0,0,0,.16);
    backdrop-filter: blur(14px);
}

.mdrhc-system-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--mdrhc-orange), #ff9f32);
    box-shadow: 0 10px 22px rgba(245,124,0,.3);
}

.mdrhc-system-badge small,
.mdrhc-system-badge strong { display: block; }
.mdrhc-system-badge small { color: rgba(255,255,255,.68); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; }
.mdrhc-system-badge strong { margin-top: 2px; font-size: 17px; }

.mdrhc-ribbon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42px;
    z-index: 3;
}

.mdrhc-ribbon span { position: absolute; left: -4%; right: -4%; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.mdrhc-ribbon-orange { bottom: 24px; height: 14px; background: var(--mdrhc-orange); transform: rotate(-.5deg); }
.mdrhc-ribbon-green { bottom: 12px; height: 18px; background: var(--mdrhc-green); transform: rotate(.4deg); }
.mdrhc-ribbon-navy { bottom: -5px; height: 22px; background: var(--mdrhc-navy-950); }

.mdrhc-login-panel {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 42px clamp(28px, 4.5vw, 74px);
    background:
        radial-gradient(circle at 100% 0, rgba(245,124,0,.09), transparent 27%),
        radial-gradient(circle at 0 100%, rgba(7,148,71,.09), transparent 30%),
        #f5f8fc;
}

.mdrhc-login-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .36;
    background-image: radial-gradient(rgba(9,55,92,.13) .8px, transparent .8px);
    background-size: 22px 22px;
}

.mdrhc-login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 485px);
    padding: clamp(28px, 4vw, 48px);
    border: 1px solid rgba(255,255,255,.92);
    border-radius: 30px;
    background: var(--mdrhc-card);
    box-shadow: var(--mdrhc-shadow);
    backdrop-filter: blur(16px);
}

.mdrhc-mobile-brand { display: none; }

.mdrhc-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 30px;
}

.mdrhc-card-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: #fff;
    font-size: 20px;
    background: linear-gradient(145deg, var(--mdrhc-navy-800), var(--mdrhc-navy-950));
    box-shadow: 0 12px 25px rgba(3,37,70,.24);
}

.mdrhc-eyebrow {
    margin: 0 0 3px;
    color: var(--mdrhc-orange);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .14em;
}

.mdrhc-card-header h2 {
    margin: 0;
    color: var(--mdrhc-text);
    font-size: clamp(27px, 3vw, 35px);
    font-weight: 830;
    letter-spacing: -.035em;
}

.mdrhc-card-header p:last-child {
    margin: 7px 0 0;
    color: var(--mdrhc-muted);
    line-height: 1.55;
}

.mdrhc-login-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 22px;
    padding: 13px 15px;
    border: 0;
    border-radius: 14px;
    font-size: 14px;
}

.mdrhc-login-alert i { margin-top: 3px; }

.mdrhc-login-form { margin: 0; }

.mdrhc-field { margin-bottom: 19px; }

.mdrhc-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: #2c4059;
    font-size: 13px;
    font-weight: 750;
}

.mdrhc-field label i { width: 16px; color: var(--mdrhc-green); }

.mdrhc-input-wrap .form-control {
    width: 100%;
    height: 54px;
    padding: 0 17px;
    color: var(--mdrhc-text);
    border: 1px solid #dce4ed;
    border-radius: 15px;
    background: #f8fafc;
    font-size: 15px;
    box-shadow: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.mdrhc-input-wrap .form-control::placeholder { color: #9aa8b7; }

.mdrhc-input-wrap .form-control:hover { border-color: #c2cfdd; background: #fff; }

.mdrhc-input-wrap .form-control:focus {
    border-color: var(--mdrhc-green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(7,148,71,.11);
}

.mdrhc-login-button {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 9px;
    color: #fff;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(115deg, var(--mdrhc-navy-900), var(--mdrhc-navy-800));
    box-shadow: 0 14px 27px rgba(5,43,77,.25);
    font-weight: 800;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.mdrhc-login-button:hover,
.mdrhc-login-button:focus {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 17px 32px rgba(5,43,77,.3);
}

.mdrhc-login-button:active { transform: translateY(0); }

.mdrhc-security-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 13px 14px;
    color: #4f6b5b;
    border: 1px solid #d9efe1;
    border-radius: 14px;
    background: var(--mdrhc-green-soft);
    font-size: 12.5px;
    line-height: 1.45;
}

.mdrhc-security-note i { margin-top: 2px; color: var(--mdrhc-green); }

.mdrhc-login-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    color: #8290a1;
    font-size: 12px;
}

.mdrhc-footer-dot { color: var(--mdrhc-orange); }

@media (max-width: 1180px) {
    .mdrhc-login-shell { grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr); }
    .mdrhc-identity-content { width: 95%; padding-left: 42px; padding-right: 42px; }
    .mdrhc-ministry-copy h1 { font-size: clamp(38px, 5.2vw, 62px); }
}

@media (max-width: 900px) {
    .mdrhc-login-shell { display: block; min-height: 100vh; }

    .mdrhc-login-identity {
        min-height: 315px;
        height: 36vh;
        background-position: 68% center;
    }

    .mdrhc-login-identity::before {
        background: linear-gradient(105deg, rgba(3,26,51,.98) 0%, rgba(3,35,67,.9) 55%, rgba(3,35,67,.35) 100%);
    }

    .mdrhc-identity-content {
        width: 100%;
        min-height: 100%;
        padding: 31px 30px 58px;
        justify-content: center;
    }

    .mdrhc-brand-row { margin-bottom: 18px; gap: 18px; }
    .mdrhc-logo-frame { width: 92px; }
    .mdrhc-country { font-size: 14px; }
    .mdrhc-government { font-size: 13px; margin-top: 4px; }
    .mdrhc-ministry-copy h1 { font-size: clamp(28px, 6vw, 46px); line-height: 1.02; }
    .mdrhc-tagline { margin-top: 13px; font-size: 13px; }
    .mdrhc-system-badge { display: none; }

    .mdrhc-login-panel {
        min-height: auto;
        padding: 30px 18px 45px;
        margin-top: -8px;
    }

    .mdrhc-login-card { width: min(100%, 570px); }
}

@media (max-width: 575.98px) {
    body.mdrhc-login-page { background: #f5f8fc; }

    .mdrhc-login-identity {
        min-height: 228px;
        height: 29vh;
        background-position: 70% center;
    }

    .mdrhc-identity-content { padding: 24px 20px 43px; }
    .mdrhc-brand-row { margin: 0; }
    .mdrhc-logo-frame { width: 75px; padding: 4px; }
    .mdrhc-government-copy { min-width: 0; }
    .mdrhc-country { font-size: 11px; letter-spacing: .02em; }
    .mdrhc-government { font-size: 10.5px; }
    .mdrhc-ministry-copy { display: none; }

    .mdrhc-ribbon { height: 27px; }
    .mdrhc-ribbon-orange { bottom: 16px; height: 9px; }
    .mdrhc-ribbon-green { bottom: 8px; height: 11px; }
    .mdrhc-ribbon-navy { height: 14px; }

    .mdrhc-login-panel { padding: 0 12px 25px; margin-top: -23px; background: transparent; }

    .mdrhc-login-card {
        width: 100%;
        padding: 25px 20px 22px;
        border-radius: 24px;
        box-shadow: 0 20px 50px rgba(2,26,51,.18);
    }

    .mdrhc-mobile-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 22px;
        padding-bottom: 18px;
        border-bottom: 1px solid var(--mdrhc-border);
    }

    .mdrhc-mobile-brand img { width: 45px; height: 45px; object-fit: contain; border-radius: 50%; }
    .mdrhc-mobile-brand strong,
    .mdrhc-mobile-brand span { display: block; }
    .mdrhc-mobile-brand strong { color: var(--mdrhc-navy-900); font-size: 17px; }
    .mdrhc-mobile-brand span { color: var(--mdrhc-muted); font-size: 12px; }

    .mdrhc-card-header { gap: 12px; margin-bottom: 22px; }
    .mdrhc-card-icon { width: 46px; height: 46px; border-radius: 14px; }
    .mdrhc-card-header h2 { font-size: 26px; }
    .mdrhc-card-header p:last-child { font-size: 13px; }
    .mdrhc-field { margin-bottom: 16px; }
    .mdrhc-input-wrap .form-control { height: 52px; }
    .mdrhc-login-button { min-height: 54px; }
    .mdrhc-security-note { font-size: 11.5px; }
    .mdrhc-login-footer { margin-top: 22px; }
}

@media (max-height: 680px) and (min-width: 901px) {
    .mdrhc-identity-content { padding-top: 35px; padding-bottom: 65px; }
    .mdrhc-brand-row { margin-bottom: 25px; }
    .mdrhc-system-badge { margin-top: 30px; }
    .mdrhc-login-card { padding-top: 30px; padding-bottom: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
