:root {
    --med-primary: #0f9f91;
    --med-primary-dark: #087c73;
    --med-accent: #06b6d4;
    --med-danger: #ef4444;
    --med-ink: #071833;
    --med-muted: #6b7c93;
    --med-card: rgba(255, 255, 255, 0.86);
    --med-stroke: rgba(15, 159, 145, 0.18);
    --med-shadow: 0 30px 80px rgba(11, 73, 94, 0.16);
}

* { box-sizing: border-box; }

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

body.med-login-page {
    margin: 0;
    overflow-x: hidden;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--med-ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(15, 159, 145, 0.16), transparent 28%),
        radial-gradient(circle at 90% 15%, rgba(6, 182, 212, 0.16), transparent 30%),
        linear-gradient(135deg, #f2fffd 0%, #eef8ff 45%, #ffffff 100%);
}

.med-login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.med-login-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.45;
    background-image:
        linear-gradient(rgba(15, 159, 145, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 159, 145, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.med-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.75;
    animation: medFloat 8s ease-in-out infinite;
}

.med-glow-1 { width: 310px; height: 310px; left: -80px; top: 10%; background: rgba(15, 159, 145, 0.14); }
.med-glow-2 { width: 260px; height: 260px; right: 10%; bottom: 10%; background: rgba(6, 182, 212, 0.16); animation-delay: -2s; }
.med-glow-3 { width: 180px; height: 180px; right: 30%; top: 4%; background: rgba(239, 68, 68, 0.07); animation-delay: -4s; }

.med-particle {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 5px;
    background: rgba(15, 159, 145, 0.17);
    animation: medRise 9s linear infinite;
}
.med-particle::before, .med-particle::after {
    content: "";
    position: absolute;
    background: rgba(15, 159, 145, 0.28);
    border-radius: 2px;
}
.med-particle::before { width: 4px; height: 16px; left: 6px; top: 0; }
.med-particle::after { width: 16px; height: 4px; left: 0; top: 6px; }
.med-particle-1 { left: 14%; bottom: -30px; }
.med-particle-2 { left: 48%; bottom: -60px; animation-delay: -2s; }
.med-particle-3 { left: 78%; bottom: -40px; animation-delay: -4s; }
.med-particle-4 { left: 90%; bottom: -80px; animation-delay: -6s; }

.med-login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: 34px;
    padding: 34px;
    align-items: stretch;
}

.med-hero-panel, .med-form-panel {
    border: 1px solid var(--med-stroke);
    box-shadow: var(--med-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.med-hero-panel {
    position: relative;
    min-height: calc(100vh - 68px);
    border-radius: 36px;
    padding: 38px;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.83), rgba(235, 255, 252, 0.68)),
        radial-gradient(circle at 85% 18%, rgba(15, 159, 145, 0.16), transparent 30%);
}

.med-hero-panel::before {
    content: "";
    position: absolute;
    inset: auto -18% -32% 20%;
    height: 55%;
    background: linear-gradient(120deg, rgba(15,159,145,0.16), rgba(6,182,212,0.11));
    border-radius: 60% 40% 0 0;
    transform: rotate(-5deg);
}

.med-brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
}

.med-logo-card {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 159, 145, 0.16);
    animation: medBeat 2.2s ease-in-out infinite;
}

.med-logo-card img { width: 62px; max-height: 62px; object-fit: contain; }

.med-brand-name {
    font-size: 27px;
    font-weight: 900;
    letter-spacing: 8px;
}
.med-brand-subtitle {
    margin-top: 3px;
    font-size: 13px;
    color: var(--med-muted);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.med-hero-content {
    position: relative;
    z-index: 2;
    max-width: 690px;
    margin-top: 72px;
}
.med-kicker {
    color: var(--med-primary-dark);
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
    font-size: 12px;
}
.med-hero-content h1 {
    margin: 12px 0 16px;
    font-size: clamp(38px, 5vw, 76px);
    line-height: 0.96;
    letter-spacing: -0.06em;
}
.med-hero-content p {
    max-width: 540px;
    margin: 0;
    font-size: 18px;
    line-height: 1.7;
    color: var(--med-muted);
}

.med-monitor-card {
    position: relative;
    z-index: 2;
    margin-top: 55px;
    width: min(640px, 100%);
    border-radius: 28px;
    border: 1px solid rgba(15,159,145,0.14);
    background: rgba(255,255,255,0.76);
    box-shadow: 0 24px 60px rgba(7, 24, 51, 0.09);
    overflow: hidden;
}
.med-monitor-top {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(15,159,145,0.10);
}
.med-monitor-top span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #8ee6dd;
}
.med-monitor-top span:nth-child(2) { background: #7dd3fc; }
.med-monitor-top span:nth-child(3) { background: #fca5a5; }
.med-monitor-top strong {
    margin-left: auto;
    color: var(--med-primary-dark);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.med-heart-wrap {
    position: relative;
    height: 158px;
    padding: 18px;
    overflow: hidden;
}
.med-heart-wrap svg {
    width: 100%;
    height: 100%;
}
.med-grid-line {
    fill: none;
    stroke: rgba(15,159,145,0.12);
    stroke-width: 2;
}
.med-ecg-line {
    fill: none;
    stroke: url(#medPulseGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: medEcg 2.7s ease-in-out infinite;
    filter: drop-shadow(0 6px 12px rgba(15, 159, 145, 0.18));
}
.med-pulse-dot {
    position: absolute;
    top: 50%;
    left: 16%;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--med-danger);
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0.14);
    animation: medDot 2.7s linear infinite;
}

.med-floating-card {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(15,159,145,0.14);
    box-shadow: 0 22px 50px rgba(7, 24, 51, 0.12);
    animation: medFloat 5.5s ease-in-out infinite;
}
.med-floating-card span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(15,159,145,0.12);
}
.med-floating-card b { display: block; font-size: 14px; }
.med-floating-card small { color: var(--med-muted); }
.med-card-a { right: 46px; top: 165px; }
.med-card-b { right: 9%; bottom: 19%; animation-delay: -1.6s; }
.med-card-c { left: 52px; bottom: 58px; animation-delay: -3s; }

.med-form-panel {
    min-height: calc(100vh - 68px);
    border-radius: 36px;
    padding: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.66);
}

.med-login-card {
    width: min(480px, 100%);
    position: relative;
    border-radius: 34px;
    padding: 38px;
    background: var(--med-card);
    border: 1px solid rgba(15,159,145,0.16);
    box-shadow: 0 30px 70px rgba(7, 24, 51, 0.14);
    overflow: hidden;
}
.med-login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: linear-gradient(90deg, var(--med-primary), var(--med-accent), var(--med-danger));
}

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

.med-lock-orbit {
    position: relative;
    width: 92px;
    height: 92px;
    margin: 0 auto 20px;
}
.med-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(15,159,145,0.35);
    animation: medSpin 10s linear infinite;
}
.med-orbit::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--med-danger);
    top: 8px;
    left: 8px;
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.12);
}
.med-lock {
    position: absolute;
    inset: 15px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--med-primary), #12b6a4);
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    box-shadow: 0 18px 35px rgba(15,159,145,0.25);
}

.med-form-title { text-align: center; margin-bottom: 24px; }
.med-form-title span {
    font-size: 12px;
    color: var(--med-primary-dark);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .13em;
}
.med-form-title h2 {
    margin: 8px 0 6px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.05em;
}
.med-form-title p { margin: 0; color: var(--med-muted); line-height: 1.5; }

.med-field-label {
    display: block;
    margin: 16px 0 8px;
    font-size: 13px;
    font-weight: 900;
    color: #1f3351;
}
.med-input-group {
    position: relative;
    display: flex;
    align-items: center;
    height: 58px;
    border: 1px solid rgba(15,159,145,0.19);
    border-radius: 18px;
    background: rgba(255,255,255,0.82);
    transition: .2s ease;
}
.med-input-group:focus-within {
    border-color: rgba(15,159,145,0.66);
    box-shadow: 0 0 0 5px rgba(15,159,145,0.10);
    transform: translateY(-1px);
}
.med-input-group.has-error {
    border-color: rgba(239,68,68,.65);
}
.med-input-icon {
    width: 54px;
    text-align: center;
    font-size: 19px;
}
.med-input-group input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 16px 0 0;
    color: var(--med-ink);
    font-size: 16px;
    font-weight: 700;
}
.med-input-group input::placeholder { color: #8b9bb0; font-weight: 600; }
.med-eye-btn {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    margin-right: 6px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    background: rgba(15,159,145,0.10);
    transition: .2s ease;
}
.med-eye-btn:hover { background: rgba(15,159,145,0.18); }

.med-field-error {
    margin-top: 6px;
    color: #dc2626;
    font-weight: 700;
    font-size: 13px;
}

.med-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
}
.med-alert-danger {
    color: #991b1b;
    background: rgba(239,68,68,0.10);
    border: 1px solid rgba(239,68,68,0.20);
}
.med-alert-info {
    color: #075985;
    background: rgba(14,165,233,0.10);
    border: 1px solid rgba(14,165,233,0.20);
}

.med-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 22px;
}
.med-form-row small { color: var(--med-muted); font-weight: 800; font-style: italic; }
.med-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #344761;
    font-weight: 800;
    font-size: 14px;
}
.med-check input { display: none; }
.med-check span {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(15,159,145,0.35);
    border-radius: 8px;
    background: #fff;
    display: grid;
    place-items: center;
}
.med-check input:checked + span {
    background: var(--med-primary);
    border-color: var(--med-primary);
}
.med-check input:checked + span::before {
    content: "✓";
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

.med-submit-btn {
    width: 100%;
    height: 60px;
    border: 0;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--med-primary-dark), #12b6a4);
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 18px 42px rgba(15,159,145,0.27);
    transition: .22s ease;
}
.med-submit-btn b {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    transition: .22s ease;
}
.med-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 52px rgba(15,159,145,0.33);
}
.med-submit-btn:hover b { transform: translateX(3px); }

.med-secure-note {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--med-muted);
    font-size: 13px;
    font-weight: 800;
}
.med-secure-note p { margin: 0; }

@keyframes medEcg {
    0% { stroke-dashoffset: 900; opacity: .4; }
    45% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: -900; opacity: .4; }
}
@keyframes medDot {
    0% { left: 10%; opacity: 0; }
    12% { opacity: 1; }
    55% { opacity: 1; }
    88% { opacity: 0; }
    100% { left: 92%; opacity: 0; }
}
@keyframes medFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}
@keyframes medRise {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    12% { opacity: 1; }
    100% { transform: translateY(-110vh) rotate(180deg); opacity: 0; }
}
@keyframes medSpin { to { transform: rotate(360deg); } }
@keyframes medBeat {
    0%, 100% { transform: scale(1); }
    16% { transform: scale(1.05); }
    28% { transform: scale(.98); }
    42% { transform: scale(1.03); }
}

@media (max-width: 1120px) {
    .med-login-shell {
        grid-template-columns: 1fr;
        padding: 22px;
    }
    .med-hero-panel {
        min-height: auto;
    }
    .med-form-panel {
        min-height: auto;
    }
}

@media (max-width: 760px) {
    .med-login-shell { padding: 14px; gap: 16px; }
    .med-hero-panel { display: none; }
    .med-form-panel { padding: 14px; border-radius: 28px; min-height: 100vh; }
    .med-mobile-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        margin-bottom: 16px;
        font-size: 24px;
        font-weight: 900;
        letter-spacing: .18em;
    }
    .med-mobile-brand img { width: 58px; height: 58px; object-fit: contain; }
    .med-login-card { padding: 28px 20px; border-radius: 28px; }
    .med-form-title h2 { font-size: 29px; }
    .med-form-row { align-items: flex-start; flex-direction: column; }
}
