:root {
    --ink: #101010;
    --muted: #77736e;
    --line: #dedbd5;
    --paper: #f5f4f0;
    --white: #fffefa;
    --theme-transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "DM Sans", sans-serif;
    transition: var(--theme-transition);
}

.login-page {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    min-height: 100vh;
}

.login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 510px);
    padding: 56px clamp(28px, 7vw, 108px);
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 11px;
    color: var(--ink);
    font-family: "Space Grotesk", sans-serif;
    font-size: 3.3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 51px;
    height: 51px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--ink);
}

.brand-mark img {
    width: 51px;
    height: 51px;
    display: block;
    object-fit: cover;
}

.theme-toggle {
    display: none;
    position: absolute;
    top: 30px;
    right: 24px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 9px;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--theme-transition), transform 180ms ease;
}

.theme-toggle img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0);
}

body.dark-mode .theme-toggle img {
    filter: brightness(0) invert(1);
}

.theme-toggle:hover {
    transform: rotate(12deg);
}

.intro {
    margin-top: clamp(66px, 11vh, 120px);
}

.eyebrow,
.visual-kicker {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1 {
    max-width: 360px;
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.25rem, 4vw, 3.35rem);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.intro-copy {
    margin: 19px 0 0;
    color: var(--muted);
    font-size: 0.96rem;
}

.login-form {
    display: grid;
    gap: 22px;
    margin-top: 42px;
}

.field-group {
    display: grid;
    gap: 9px;
}

.field-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

label,
.field-heading a,
.remember-option {
    font-size: 0.78rem;
    font-weight: 600;
}

.field-heading a,
.signup-prompt a {
    color: var(--ink);
    text-underline-offset: 3px;
}

input[type="email"],
input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 14px 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    outline: none;
    font: inherit;
    font-size: 0.91rem;
    transition: border-color 180ms ease;
}

input::placeholder {
    color: #aaa59e;
}

input[type="email"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--ink);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 6px) 20px, calc(100% - 1px) 20px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    font-size: 0.91rem;
}

select:invalid {
    color: #aaa59e;
}

.remember-option {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    cursor: pointer;
}

input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--ink);
}

.login-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 18px;
    color: var(--white);
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 2px;
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.login-link span {
    font-size: 1.25rem;
    line-height: 0.7;
}

.login-link:hover {
    color: var(--ink);
    background: transparent;
    transform: translateY(-2px);
}

.signup-prompt {
    margin: 28px 0 0;
    color: var(--muted);
    font-size: 0.77rem;
    text-align: center;
}

.visual-panel {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 100vh;
    overflow: hidden;
    padding: 54px clamp(32px, 7vw, 112px);
    color: var(--white);
    background: var(--ink);
}

.visual-grid {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, transparent, #000 35%, #000);
}

.visual-panel::before,
.visual-panel::after {
    position: absolute;
    display: block;
    content: "";
    border: 1px solid rgba(255, 254, 250, 0.45);
    border-radius: 50%;
}

.visual-panel::before {
    width: min(39vw, 540px);
    aspect-ratio: 1;
    top: 15%;
    right: -16%;
}

.visual-panel::after {
    width: min(26vw, 360px);
    aspect-ratio: 1;
    top: 27%;
    right: 5%;
}

.visual-content,
.visual-corner {
    position: relative;
    z-index: 1;
}

.visual-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 24px;
}

.visual-kicker {
    color: #a8a7a2;
}

.visual-message {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.2rem, 5vw, 5.1rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.visual-message strong {
    color: #a8a7a2;
    font-weight: 500;
}

.visual-corner {
    position: absolute;
    top: 54px;
    right: clamp(32px, 7vw, 112px);
    color: #a8a7a2;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

@media (max-width: 900px) {
    .login-page {
        display: block;
    }

    .login-panel {
        width: min(100%, 620px);
        min-height: auto;
        padding: 48px clamp(28px, 8vw, 72px) 64px;
    }

    .visual-panel {
        min-height: 300px;
        padding: 48px clamp(28px, 8vw, 72px);
    }

    .intro {
        margin-top: 62px;
    }
}

@media (max-width: 560px) {
    body.dark-mode {
        --ink: #f5f4f0;
        --muted: #aaa8a2;
        --line: #4a4946;
        --paper: #171717;
        --white: #101010;
    }

    .login-panel {
        min-height: 100vh;
        padding: 30px 24px 40px;
    }

    .brand {
        font-size: 2.4rem;
    }

    .theme-toggle {
        display: flex;
    }

    .brand-mark {
        width: 43px;
        height: 43px;
    }

    .brand-mark img {
        width: 42.5px;
        height: 42.5px;
    }

    .intro {
        margin-top: 64px;
    }

    h1 {
        font-size: clamp(2.2rem, 12vw, 3rem);
    }

    .intro-copy {
        max-width: 31rem;
        line-height: 1.5;
    }

    .login-form {
        gap: 20px;
        margin-top: 36px;
    }

    .field-heading {
        align-items: flex-start;
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .signup-prompt {
        line-height: 1.5;
    }

    .visual-panel {
        display: none;
    }
}
