:root {
    --navy: #102d42;
    --navy-deep: #0a2234;
    --teal: #167b73;
    --teal-soft: #dcefeb;
    --gold: #e0a43b;
    --ink: #152638;
    --muted: #607286;
    --line: #d4dfdf;
    --surface: #ffffff;
    --canvas: #f3f7f5;
    --danger: #b84c4c;
    color-scheme: light;
    font-family: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    color: var(--ink);
    background: var(--canvas);
    font-variant-numeric: tabular-nums;
}

button,
input {
    font: inherit;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(310px, 37vw) minmax(0, 1fr);
    min-height: 100vh;
}

.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: clamp(2rem, 5vw, 4.5rem);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 15% 85%, rgba(22, 123, 115, 0.54), transparent 34%),
        linear-gradient(150deg, #173d55 0%, var(--navy-deep) 62%, #071b29 100%);
}

.login-brand::after {
    content: "";
    position: absolute;
    right: -7rem;
    bottom: 13%;
    width: 19rem;
    height: 19rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 50%;
    box-shadow: 0 0 0 3rem rgba(255, 255, 255, 0.025), 0 0 0 6rem rgba(255, 255, 255, 0.018);
}

.login-brand-copy,
.brand-message,
.brand-signal,
.brand-registration {
    position: relative;
    z-index: 1;
}

.login-brand-copy {
    display: grid;
    grid-template-columns: 2.7rem 1fr;
    column-gap: 0.85rem;
    align-items: center;
}

.brand-mark {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    color: #bce9df;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.08);
}

.brand-name,
.brand-platform,
.brand-message p,
.brand-registration {
    margin: 0;
}

.brand-name {
    font-size: 1rem;
    font-weight: 750;
}

.brand-platform {
    color: #8ee0d5;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-message {
    max-width: 34rem;
    margin: auto 0;
    padding: 4rem 0;
}

.brand-message .brand-eyebrow,
.login-eyebrow {
    color: #7ed5c9;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-message h1 {
    max-width: 12ch;
    margin: 0.8rem 0 1.2rem;
    font-size: clamp(2.1rem, 4vw, 4.2rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.brand-message p:last-child {
    max-width: 41rem;
    color: #d3e1e7;
    font-size: clamp(0.94rem, 1.2vw, 1.08rem);
    line-height: 1.7;
}

.brand-signal {
    display: flex;
    align-items: end;
    gap: 0.38rem;
    height: 2rem;
    margin-bottom: 1.4rem;
}

.brand-signal span {
    width: 0.35rem;
    border-radius: 999px;
    background: linear-gradient(#91dfd4, var(--teal));
}

.brand-signal span:nth-child(1) { height: 30%; }
.brand-signal span:nth-child(2) { height: 52%; }
.brand-signal span:nth-child(3) { height: 42%; }
.brand-signal span:nth-child(4) { height: 76%; }
.brand-signal span:nth-child(5) { height: 100%; background: linear-gradient(#f1cb76, var(--gold)); }

.brand-registration {
    color: #adc1ca;
    font-size: 0.76rem;
}

.login-stage {
    display: grid;
    place-items: center;
    align-content: center;
    min-width: 0;
    padding: clamp(1.5rem, 5vw, 5rem);
    background:
        linear-gradient(rgba(22, 123, 115, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 123, 115, 0.035) 1px, transparent 1px),
        var(--canvas);
    background-size: 32px 32px;
}

.login-banner,
.login-card,
.login-help {
    width: min(100%, 31rem);
}

.login-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    color: var(--teal);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.banner-dot {
    width: 0.52rem;
    height: 0.52rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 3px rgba(22, 123, 115, 0.16);
}

.login-card {
    padding: clamp(1.6rem, 4vw, 2.7rem);
    border: 1px solid rgba(194, 211, 208, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(17, 49, 65, 0.13);
}

.login-card-heading {
    margin-bottom: 1.8rem;
}

.login-eyebrow {
    margin: 0 0 0.55rem;
    color: var(--teal);
}

.login-card h2 {
    margin: 0;
    font-size: clamp(1.55rem, 2.6vw, 2.05rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.login-card-heading > p:last-child {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.field-group + .field-group {
    margin-top: 1.1rem;
}

.field-group label,
.field-label-row {
    color: #33485a;
    font-size: 0.8rem;
    font-weight: 750;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.caps-lock {
    color: #a8661b;
    font-size: 0.72rem;
}

input {
    width: 100%;
    height: 3.1rem;
    margin-top: 0.45rem;
    padding: 0 0.9rem;
    border: 1px solid #becdce;
    border-radius: 10px;
    color: var(--ink);
    background: #fbfdfc;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input:hover {
    border-color: #8ca9a7;
}

input:focus {
    border-color: var(--teal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22, 123, 115, 0.12);
}

.password-control {
    position: relative;
}

.password-control input {
    padding-right: 4.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.45rem;
    bottom: 0.43rem;
    height: 2.25rem;
    padding: 0 0.65rem;
    border: 0;
    border-radius: 7px;
    color: var(--teal);
    font-size: 0.74rem;
    font-weight: 750;
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: var(--teal-soft);
    outline: none;
}

.login-message {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #e8bcbc;
    border-radius: 9px;
    color: #8d3030;
    font-size: 0.8rem;
    line-height: 1.45;
    background: #fff2f2;
}

.login-submit {
    display: grid;
    grid-template-columns: 1fr auto;
    place-items: center;
    width: 100%;
    min-height: 3.2rem;
    margin-top: 1.35rem;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-weight: 750;
    background: linear-gradient(135deg, #187f76, #10665f);
    box-shadow: 0 10px 22px rgba(22, 123, 115, 0.23);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.login-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(22, 123, 115, 0.28);
    filter: saturate(1.08);
}

.login-submit:focus-visible {
    outline: 3px solid rgba(22, 123, 115, 0.24);
    outline-offset: 3px;
}

.login-submit:disabled {
    cursor: wait;
    opacity: 0.78;
}

.submit-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-top-color: #fff;
    border-radius: 50%;
}

.login-submit.is-loading .submit-spinner {
    display: block;
    animation: spin 700ms linear infinite;
}

.security-note {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: start;
    margin-top: 1.6rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e0e9e7;
    color: var(--muted);
}

.security-note p {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.5;
}

.security-icon {
    width: 1rem;
    height: 1.15rem;
    margin-top: 0.1rem;
    border: 2px solid var(--teal);
    border-radius: 0.18rem 0.18rem 0.35rem 0.35rem;
    clip-path: polygon(0 23%, 50% 0, 100% 23%, 100% 100%, 0 100%);
}

.login-help {
    margin: 1.1rem 0 0;
    color: var(--muted);
    font-size: 0.74rem;
    text-align: center;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: auto;
        padding: 1.3rem 1.5rem;
    }

    .brand-message,
    .brand-signal,
    .brand-registration {
        display: none;
    }

    .login-stage {
        min-height: calc(100vh - 5.3rem);
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.35rem;
        border-radius: 15px;
    }

    .login-stage {
        place-items: start center;
        align-content: start;
    }
}

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