:root {
    color-scheme: light;
    --login-ink: #17283f;
    --login-muted: #64748b;
    --login-line: #dce5ec;
    --login-accent: #147d86;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    color: var(--login-ink);
    background: radial-gradient(circle at 12% 10%, #e2f5f2 0, transparent 32%), #f3f6f9;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.login-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: clamp(16px, 4vw, 42px);
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(410px, .88fr);
    width: min(100%, 1080px);
    min-height: 600px;
    overflow: hidden;
    border: 1px solid #e0e8ee;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(24, 48, 74, .13);
}

.login-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
    padding: 34px clamp(30px, 4vw, 58px);
    color: #fff;
    background: linear-gradient(145deg, #12243e 0%, #164660 62%, #167777 100%);
}

.login-intro::before,
.login-intro::after {
    position: absolute;
    content: "";
    width: 440px;
    height: 440px;
    border: 1px solid rgba(217, 255, 251, .13);
    border-radius: 50%;
    pointer-events: none;
}

.login-intro::before { right: -260px; top: -240px; }
.login-intro::after { left: -250px; bottom: -280px; }

.login-brand,
.login-intro-visual,
.login-intro-footer {
    position: relative;
    z-index: 1;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand-mark {
    display: grid;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .23);
    border-radius: 13px;
    color: #8cf2e2;
    background: rgba(255, 255, 255, .08);
}

.login-brand-mark svg { width: 35px; height: 35px; }
.login-brand strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.login-brand small { display: block; margin-top: 2px; color: #a9d7df; font-size: 11px; }

.login-intro-visual {
    display: grid;
    flex: 1;
    min-height: 0;
    margin: 0 -26px;
    place-items: center;
}

.login-intro-visual img {
    display: block;
    width: min(100%, 570px);
    height: auto;
    max-height: 390px;
    object-fit: contain;
    filter: drop-shadow(0 18px 25px rgba(4, 23, 36, .25));
}

.login-intro-footer { color: #9cc7d2; font-size: 11px; }

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(30px, 5vw, 62px);
}

.login-panel-topline,
.login-modules-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--login-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.login-panel-dot,
.login-connection-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.login-panel-heading { margin: 12px 0 27px; }
.login-panel-heading h2 { margin: 0 0 8px; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.04em; line-height: 1.16; }
.login-panel-heading p { max-width: 330px; margin: 0; color: var(--login-muted); font-size: 13px; line-height: 1.55; }
.login-form { display: grid; gap: 18px; }
.login-field { display: grid; gap: 8px; }
.login-field label { font-size: 12px; font-weight: 700; }
.login-input-wrap { position: relative; }

.login-input-wrap > svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #8294a6;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input-wrap input,
.login-input-wrap select {
    display: block;
    width: 100%;
    min-height: 47px;
    padding: 10px 14px;
    border: 1px solid var(--login-line);
    border-radius: 10px;
    outline: none;
    background: #f9fbfc;
    color: var(--login-ink);
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.login-input-wrap input { padding-left: 43px; }
.login-input-wrap input[type="password"],
.login-input-wrap input#password { padding-right: 80px; }
.login-input-wrap input::placeholder { color: #9aa8b5; }
.login-input-wrap input:focus,
.login-input-wrap select:focus { border-color: #42a4ac; box-shadow: 0 0 0 4px rgba(35, 151, 160, .13); background: #fff; }

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    padding: 7px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #317b88;
    font-size: 11px;
    font-weight: 700;
    transform: translateY(-50%);
}

.login-password-toggle:hover { background: #e9f5f5; }

.login-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 49px;
    margin-top: 5px;
    padding: 0 17px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(100deg, #176a81, #138b80);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(20, 116, 128, .18);
    transition: transform .16s ease, box-shadow .16s ease;
}

.login-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(20, 116, 128, .24); }
.login-submit span { font-size: 22px; font-weight: 400; }

.login-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
    padding-top: 17px;
    border-top: 1px solid #e9eef2;
}

.login-connection { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; }
.login-connection.is-online { color: #168367; }
.login-connection.is-offline { color: #aa5048; }
.login-modules-button { padding: 6px 0; border: 0; background: none; color: #1b7180; font-size: 11px; font-weight: 800; }
.login-modules-button:hover { text-decoration: underline; }

.login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 17px;
    padding: 11px 13px;
    border: 1px solid #f1cbc5;
    border-radius: 10px;
    background: #fff2f0;
    color: #9a3f36;
    font-size: 12px;
    line-height: 1.4;
}

.login-alert span { display: grid; flex: 0 0 auto; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: #c65d52; color: #fff; font-weight: 800; }

.login-modules-dialog {
    width: min(680px, calc(100vw - 28px));
    max-height: min(78vh, 720px);
    padding: 27px;
    border: 1px solid #e3ebf0;
    border-radius: 18px;
    box-shadow: 0 26px 70px rgba(14, 35, 56, .25);
    color: var(--login-ink);
}

.login-modules-dialog::backdrop { background: rgba(11, 29, 48, .58); backdrop-filter: blur(3px); }
.login-modules-header { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.login-modules-header h2 { margin: 8px 0 4px; font-size: 24px; letter-spacing: -.03em; }
.login-modules-header p { margin: 0; color: var(--login-muted); font-size: 12px; }
.login-dialog-close { display: grid; width: 33px; height: 33px; place-items: center; border: 0; border-radius: 8px; background: #f0f4f6; color: #526579; font-size: 24px; line-height: 1; }
.login-dialog-close:hover { background: #e4edf0; }
.login-modules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 25px; }
.login-module { padding: 16px; border: 1px solid #e5ebef; border-radius: 12px; background: #fbfcfd; }
.login-module h3 { margin: 0 0 10px; font-size: 14px; }
.login-module ul { display: grid; gap: 7px; margin: 0; padding-left: 17px; color: var(--login-muted); font-size: 12px; line-height: 1.4; }

button:focus-visible { outline: 3px solid #49b6b7; outline-offset: 3px; }

@media (max-width: 780px) {
    .login-page { padding: 14px; }
    .login-layout { grid-template-columns: 1fr; min-height: 0; max-width: 530px; border-radius: 19px; }
    .login-intro { min-height: 0; padding: 24px 28px; }
    .login-intro-visual { margin: 2px -8px -8px; }
    .login-intro-visual img { width: min(100%, 370px); max-height: 200px; }
    .login-intro-footer { display: none; }
    .login-panel { padding: 28px; }
}

@media (max-width: 480px) {
    .login-page { padding: 0; place-items: stretch; }
    .login-layout { max-width: none; min-height: 100dvh; border: 0; border-radius: 0; }
    .login-intro { padding: 20px; }
    .login-brand-mark { width: 39px; height: 39px; }
    .login-intro-visual img { max-height: 155px; }
    .login-panel { justify-content: flex-start; padding: 27px 20px 38px; }
    .login-panel-heading { margin-bottom: 22px; }
    .login-modules-dialog { padding: 20px; }
    .login-modules-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
