:root {
    --primary: #066a66;
    --primary-dark: #04514e;
    --primary-soft: #e1f1ef;
    --text: #163432;
    --muted: #667875;
    --border: #d8e4e2;
    --page: #f4f8f7;
    --error: #b42318;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
    background: var(--page);
    color: var(--text);
    font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
}
button, input { font: inherit; }

.login-shell { display: grid; grid-template-columns: minmax(0, 65%) minmax(420px, 35%); min-height: 100vh; min-height: 100dvh; overflow: hidden; }
.login-visual { background: #174c49; min-height: 100vh; min-height: 100dvh; overflow: hidden; position: relative; }
.login-visual > picture { inset: 0; position: absolute; }
.login-visual > picture img { height: 100%; object-fit: cover; object-position: center; width: 100%; }
.visual-overlay { background: linear-gradient(180deg, rgba(5,44,42,.18) 0%, rgba(4,45,43,.08) 38%, rgba(3,40,38,.86) 100%); inset: 0; position: absolute; }
.brand { align-items: center; display: inline-flex; font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: 1.25rem; font-weight: 600; gap: 10px; letter-spacing: -.04em; text-decoration: none; }
.brand-light { color: #fff; left: 46px; position: absolute; top: 40px; z-index: 2; }
.brand-dark { color: var(--text); display: none; }
.mobile-medical-art { display: none; }
.brand-mark { align-items: center; background: #fff; border-radius: 10px; box-shadow: 0 5px 16px rgba(15, 49, 47, .14); display: flex; flex: 0 0 38px; height: 38px; justify-content: center; overflow: hidden; padding: 3px; width: 38px; }
.brand-mark img { display: block; height: 100%; object-fit: contain; width: 100%; }
.brand-dark .brand-mark { box-shadow: 0 5px 16px rgba(15, 49, 47, .1); }
.visual-copy { bottom: clamp(42px, 7vh, 80px); color: #fff; left: 46px; max-width: 540px; position: absolute; right: 42px; z-index: 2; }
.visual-badge { align-items: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.22); border-radius: 30px; display: inline-flex; font-size: .76rem; font-weight: 700; gap: 7px; padding: 8px 12px; }
.visual-badge span { align-items: center; background: #fff; border-radius: 50%; color: var(--primary); display: flex; font-size: .65rem; height: 17px; justify-content: center; width: 17px; }
.visual-copy h2 { color: #fff; font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: 52px; font-weight: 600; letter-spacing: -.04em; line-height: 58px; margin: 20px 0 16px; }
.visual-copy p { color: rgba(255,255,255,.9); font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: 16px; line-height: 24px; margin: 0; max-width: 510px; }
.trust-items { border-top: 1px solid rgba(255,255,255,.2); display: flex; gap: 28px; margin-top: 27px; padding-top: 21px; }
.trust-items span { align-items: center; display: flex; font-size: .8rem; font-weight: 600; gap: 8px; }
.trust-items i { align-items: center; background: rgba(255,255,255,.16); border-radius: 50%; display: flex; font-size: .65rem; font-style: normal; height: 21px; justify-content: center; width: 21px; }

.login-panel { align-items: center; background: #fff; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; overflow-y: auto; padding: clamp(28px, 6vh, 60px) clamp(28px, 3.5vw, 58px) 24px; position: relative; }
.login-card { margin: auto 0; max-width: 420px; padding: 24px 0; width: 100%; }
.eyebrow { color: var(--primary); display: block; font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: .72rem; font-weight: 600; letter-spacing: .14em; margin-bottom: 11px; text-transform: uppercase; }
.login-heading h1 {
    color: var(--primary-dark);
    font-family: Merienda, cursive;
    font-size: 52px;
    font-weight: 600;
    letter-spacing: -.03em;
    line-height: 58px;
    margin: 0 0 12px;
    position: relative;
}
.login-heading h1::after {
    background: linear-gradient(90deg, var(--primary), rgba(6, 106, 102, 0));
    border-radius: 999px;
    content: "";
    display: block;
    height: 4px;
    margin-top: 14px;
    width: 72px;
}
.login-heading p { color: rgba(22, 52, 50, .9); font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: 16px; line-height: 24px; margin: 0 0 34px; }
.error { align-items: flex-start; background: #fff2f0; border: 1px solid #ffd5d0; border-radius: 11px; color: var(--error); display: flex; font-size: .85rem; gap: 10px; margin: -12px 0 24px; padding: 12px 14px; }
.error-icon { align-items: center; background: var(--error); border-radius: 50%; color: #fff; display: flex; flex: 0 0 19px; font-size: .7rem; font-weight: 800; height: 19px; justify-content: center; }
.form-field { margin-bottom: 20px; }
label { display: block; font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: .82rem; font-weight: 400; margin-bottom: 8px; }
.input-wrap { position: relative; }
.input-wrap > svg { left: 15px; pointer-events: none; position: absolute; stroke: #849794; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; top: 50%; transform: translateY(-50%); width: 19px; }
input { background: #fff; border: 1px solid var(--border); border-radius: 11px; color: var(--text); font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: 16px; height: 51px; outline: 0; padding: 0 46px; transition: border .2s, box-shadow .2s; width: 100%; }
input::placeholder { color: #99a8a6; }
input:hover { border-color: #afc5c2; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input.is-invalid { border-color: var(--error); box-shadow: 0 0 0 3px #ffebe8; }
.field-error { color: var(--error); display: block; font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: .75rem; min-height: 0; padding-top: 5px; }
.field-error:empty { display: none; }
.password-toggle { align-items: center; background: transparent; border: 0; color: #7a8d8a; cursor: pointer; display: flex; height: 40px; justify-content: center; padding: 0; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; }
.password-toggle svg { stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 19px; }
.eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.submit-button { align-items: center; background: var(--primary); border: 0; border-radius: 11px; box-shadow: 0 9px 22px rgba(6,106,102,.18); color: #fff; cursor: pointer; display: flex; font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: 16px; font-weight: 600; height: 52px; justify-content: center; margin-top: 8px; overflow: hidden; position: relative; transition: background .2s, transform .2s, box-shadow .2s; width: 100%; }
.submit-button svg { margin-left: 9px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transition: transform .2s; width: 19px; }
.submit-loader { display: none; left: 50%; pointer-events: none; position: absolute; top: 50%; transform: translate(-50%, -50%); width: 112px; }
.submit-loader svg { display: block; height: 24px; width: 112px; }
.submit-loader path {
    stroke: #ffffff;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
    vector-effect: non-scaling-stroke;
}
.submit-loader-base { opacity: .38; }
.submit-loader-trace {
    stroke-dasharray: 8 92;
    stroke-dashoffset: 0;
    animation: heartbeat-loader 1.3s linear infinite;
}
.submit-button.is-loading { cursor: wait; opacity: .96; pointer-events: none; }
.submit-button.is-loading > span:first-child { visibility: hidden; }
.submit-button.is-loading > svg { display: none; }
.submit-button.is-loading .submit-loader { display: block; }
.submit-button:hover { background: var(--primary-dark); box-shadow: 0 11px 28px rgba(6,106,102,.25); transform: translateY(-1px); }
.submit-button:hover svg { transform: translateX(3px); }
.submit-button:disabled { cursor: wait; opacity: .75; transform: none; }
.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; }
.auth-links a { color: var(--primary-dark); font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-links a:hover { color: var(--primary); text-decoration: underline; }
.secondary-action {
    align-items: center;
    background: rgba(6, 106, 102, .08);
    border: 1px solid rgba(6, 106, 102, .14);
    border-radius: 11px;
    color: var(--primary-dark);
    display: flex;
    font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 600;
    height: 52px;
    justify-content: center;
    margin-top: 12px;
    text-decoration: none;
    transition: background .2s, border-color .2s, transform .2s;
    width: 100%;
}
.secondary-action:hover { background: rgba(6, 106, 102, .12); border-color: rgba(6, 106, 102, .22); transform: translateY(-1px); }
.security-note { align-items: center; color: var(--muted); display: flex; font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: 16px; gap: 8px; justify-content: center; line-height: 24px; margin-top: 25px; }
.security-note svg { stroke: var(--primary); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 18px; }
footer { color: #8a9a98; display: flex; flex-shrink: 0; font-family: "Instrument Sans", "Instrument Sans Fallback: BlinkMacSystemFont", "Instrument Sans Fallback: Segoe UI", "Instrument Sans Fallback: Helvetica Neue", "Instrument Sans Fallback: Arial", "Instrument Sans Fallback: Noto Sans", -apple-system, sans-serif; font-size: .72rem; justify-content: space-between; width: 100%; }

@media (max-width: 1200px) {
    .login-shell { grid-template-columns: minmax(0, 55.45dvh) minmax(0, 1fr); }
    .visual-copy { left: 32px; right: 30px; }
    .brand-light { left: 32px; top: 30px; }
    .trust-items { align-items: flex-start; flex-direction: column; gap: 10px; }
}
@media (max-width: 900px) {
    .visual-copy h2 { font-size: 36px; line-height: 42px; }
    .visual-copy p { font-size: 15px; line-height: 22px; }
}
@media (min-width: 768px) {
    .login-panel {
        background:
            radial-gradient(circle at 92% 8%, rgba(6, 106, 102, .09), transparent 24%),
            radial-gradient(circle at 7% 92%, rgba(92, 136, 246, .07), transparent 25%),
            #fff;
        isolation: isolate;
        overflow: hidden auto;
    }
    .mobile-medical-art { display: block; inset: 0; pointer-events: none; position: absolute; z-index: 0; }
    .medical-symbol { align-items: center; display: flex; justify-content: center; position: absolute; }
    .medical-symbol svg { height: 100%; stroke: var(--primary); stroke-linecap: round; stroke-linejoin: round; width: 100%; }
    .medical-heart {
        animation: medical-heartbeat 3.6s ease-in-out infinite;
        height: 112px;
        opacity: .16;
        right: 5%;
        top: 5%;
        width: 112px;
    }
    .medical-heart::before {
        animation: medical-pulse-ring 3.6s ease-out infinite;
        border: 1px solid rgba(6, 106, 102, .28);
        border-radius: 50%;
        content: "";
        inset: 14%;
        position: absolute;
    }
    .medical-heart svg { stroke-width: 1.25; }
    .medical-cross {
        animation: medical-float 6s ease-in-out infinite;
        bottom: 5%;
        height: 90px;
        opacity: .1;
        right: 7%;
        transform: rotate(12deg);
        width: 90px;
    }
    .medical-cross svg { fill: rgba(6, 106, 102, .12); stroke-width: 1.1; }
    .brand-dark, .login-card, footer { position: relative; z-index: 1; }
}
@media (max-width: 767px) {
    .login-shell { display: block; }
    .login-visual { display: none; }
    .login-panel {
        background:
            radial-gradient(rgba(6, 106, 102, .075) 1px, transparent 1px),
            radial-gradient(circle at 8% 8%, rgba(6, 106, 102, .16), transparent 34%),
            radial-gradient(circle at 94% 88%, rgba(92, 136, 246, .13), transparent 32%),
            linear-gradient(145deg, #f4fbfa 0%, #fff 48%, #f1f7ff 100%);
        background-size: 22px 22px, auto, auto, auto;
        isolation: isolate;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 24px clamp(18px, 6vw, 36px) 20px;
    }
    .login-panel::before,
    .login-panel::after {
        border: 1px solid rgba(6, 106, 102, .1);
        border-radius: 50%;
        content: "";
        pointer-events: none;
        position: absolute;
        z-index: 0;
    }
    .login-panel::before {
        background: rgba(255, 255, 255, .42);
        box-shadow: inset 0 0 40px rgba(6, 106, 102, .05);
        height: 230px;
        right: -105px;
        top: -85px;
        width: 230px;
    }
    .login-panel::after {
        background: rgba(225, 241, 239, .38);
        bottom: -125px;
        height: 280px;
        left: -135px;
        width: 280px;
    }
    .mobile-medical-art { display: block; inset: 0; pointer-events: none; position: absolute; z-index: 0; }
    .medical-symbol {
        align-items: center;
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        background: rgba(255, 255, 255, .48);
        border: 1px solid rgba(255, 255, 255, .82);
        box-shadow: 0 16px 35px rgba(15, 73, 69, .08);
        display: flex;
        justify-content: center;
        position: absolute;
        transform: rotate(-9deg);
    }
    .medical-symbol svg { height: 58%; stroke: var(--primary); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 58%; }
    .medical-heart {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: transparent;
        border: 0;
        box-shadow: none;
        height: 82px;
        right: 22px;
        top: 25px;
        transform: rotate(6deg);
        width: 82px;
    }
    .medical-heart svg {
        filter: drop-shadow(0 8px 12px rgba(6, 106, 102, .14));
        height: 100%;
        stroke: rgba(6, 106, 102, .48);
        stroke-width: 1.45;
        width: 100%;
    }
    .medical-cross { border-radius: 20px; bottom: 8%; height: 76px; left: -22px; transform: rotate(12deg); width: 76px; }
    .medical-cross svg { fill: rgba(6, 106, 102, .08); }
    .brand-dark, .login-card, footer { position: relative; z-index: 1; }
    .brand-dark {
        align-self: flex-start;
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        background: rgba(255, 255, 255, .68);
        border: 1px solid rgba(255, 255, 255, .9);
        border-radius: 14px;
        box-shadow: 0 10px 28px rgba(15, 73, 69, .08);
        display: inline-flex;
        padding: 7px 12px 7px 7px;
    }
    .login-card {
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        background: rgba(255, 255, 255, .78);
        border: 1px solid rgba(255, 255, 255, .9);
        border-radius: 22px;
        box-shadow: 0 24px 60px rgba(15, 73, 69, .11);
        overflow: hidden;
        padding: 28px clamp(18px, 5vw, 26px);
        position: relative;
    }
    .login-card::before {
        background: linear-gradient(90deg, var(--primary), #58aeb0, #728df0);
        content: "";
        height: 4px;
        left: 0;
        position: absolute;
        right: 0;
        top: 0;
    }
    .login-card input {
        background: rgba(247, 251, 255, .9);
        box-shadow: inset 0 1px 2px rgba(22, 52, 50, .025);
    }
    .login-heading h1 { font-size: 36px; line-height: 42px; }
    .login-heading p { font-size: 15px; line-height: 22px; }
    .login-card .submit-button {
        box-shadow: 0 12px 28px rgba(6, 106, 102, .22);
    }
    footer { padding-top: 18px; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); }
}
@keyframes medical-heartbeat {
    0%, 45%, 100% { transform: scale(1) rotate(3deg); }
    50% { transform: scale(1.08) rotate(3deg); }
    56% { transform: scale(1.02) rotate(3deg); }
    62% { transform: scale(1.1) rotate(3deg); }
}
@keyframes medical-float {
    0%, 100% { transform: translateY(0) rotate(12deg); }
    50% { transform: translateY(-12px) rotate(16deg); }
}
@keyframes medical-pulse-ring {
    0%, 44% { opacity: 0; transform: scale(.72); }
    50% { opacity: .75; }
    72%, 100% { opacity: 0; transform: scale(1.45); }
}
@keyframes heartbeat-loader {
    0% { stroke-dashoffset: 0; opacity: .88; }
    100% { stroke-dashoffset: -100; opacity: .88; }
}
@media (max-height: 820px) and (min-width: 768px) {
    .login-panel { padding-bottom: 18px; padding-top: 24px; }
    .login-card { padding: 18px 0; }
    .visual-copy { bottom: 28px; }
    .visual-copy h2 { font-size: 44px; line-height: 50px; }
    .trust-items { margin-top: 18px; padding-top: 16px; }
}
@media (max-height: 680px) and (min-width: 768px) {
    .visual-copy p, .trust-items { display: none; }
    .visual-copy h2 { margin-bottom: 0; }
    .login-heading p { margin-bottom: 22px; }
    .form-field { margin-bottom: 15px; }
    .security-note { margin-top: 20px; }
}
@media (max-width: 420px) {
    .login-panel { padding-left: 18px; padding-right: 18px; }
    .login-heading h1 { font-size: 2rem; }
    footer { gap: 12px; }
}
@media (max-width: 380px) {
    .brand { font-size: 1.1rem; }
    .brand-mark { flex-basis: 34px; height: 34px; width: 34px; }
    .login-card { padding: 24px 17px; }
    .login-heading h1 { font-size: 1.85rem; }
    .login-heading p { font-size: .9rem; margin-bottom: 25px; }
    footer { font-size: .66rem; }
}
@media (max-width: 520px) {
    .auth-links { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
