:root {
    color-scheme: light;
    --orange: #f96816;
    --orange-deep: #d94711;
    --green: #28a84a;
    --blue: #43a1be;
    --ink: #231f20;
    --paper: #fffdf8;
    --muted: #62666b;
    --line: #d9d7cf;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    background: var(--ink);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

.login-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(380px, 0.9fr) minmax(480px, 1.1fr);
    background: var(--paper);
}

.login-art {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        linear-gradient(152deg, rgba(249, 104, 22, 0.96) 0 46%, rgba(40, 168, 74, 0.96) 46% 100%);
}

.login-art img {
    display: block;
    width: 100%;
    height: 100vh;
    object-fit: contain;
    filter: saturate(1.04) contrast(1.02);
}

.login-content {
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 48px clamp(28px, 6vw, 92px);
    background:
        linear-gradient(90deg, rgba(67, 161, 190, 0.08) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(rgba(67, 161, 190, 0.08) 1px, transparent 1px) 0 0 / 24px 24px,
        var(--paper);
}

.login-content::before,
.login-content::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.login-content::before {
    top: 0;
    right: 0;
    width: 34%;
    height: 18px;
    background: var(--orange);
}

.login-content::after {
    right: 0;
    bottom: 0;
    width: 150px;
    height: 150px;
    background: var(--green);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.login-form-wrap {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    border-top: 8px solid var(--orange);
    background: #ffffff;
    padding: clamp(28px, 5vw, 52px);
    box-shadow: 12px 12px 0 var(--ink);
}

.login-eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1;
    letter-spacing: 0;
}

.login-intro {
    margin: 18px 0 26px;
    color: var(--muted);
    line-height: 1.55;
}

.login-alert {
    margin-bottom: 20px;
    border: 1px solid #efb2aa;
    border-left: 5px solid #b42318;
    background: #fff4f2;
    padding: 12px 14px;
    color: #8f1d16;
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-form label {
    display: grid;
    gap: 7px;
}

.login-form label span {
    font-size: 0.88rem;
    font-weight: 800;
}

.login-form input {
    width: 100%;
    min-height: 48px;
    border: 2px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

.login-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(67, 161, 190, 0.2);
}

.login-form button {
    min-height: 50px;
    margin-top: 4px;
    border: 2px solid var(--ink);
    border-radius: 4px;
    background: var(--orange);
    color: #ffffff;
    box-shadow: 5px 5px 0 var(--ink);
    font-weight: 900;
    cursor: pointer;
}

.login-form button:hover,
.login-form button:focus-visible {
    background: var(--orange-deep);
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--ink);
}

.login-footer {
    margin: 30px 0 0;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.twofa-panel {
    width: min(520px, 100%);
}

.twofa-qr-wrap {
    display: flex;
    width: 260px;
    min-height: 260px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    border: 2px solid var(--line);
    background: #ffffff;
    color: var(--muted);
}

.twofa-readonly-field {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
}

.twofa-readonly-field span,
.twofa-details summary {
    font-size: 0.88rem;
    font-weight: 800;
}

.twofa-readonly-field input,
.twofa-details textarea {
    width: 100%;
    border: 2px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    color: var(--ink);
    padding: 10px 12px;
    font: inherit;
}

.twofa-details {
    margin-bottom: 18px;
}

.twofa-details summary {
    cursor: pointer;
    color: var(--blue);
}

.twofa-details textarea {
    min-height: 88px;
    margin-top: 10px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
}

.twofa-backup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0;
}

.twofa-backup-grid code {
    display: block;
    border: 2px solid var(--line);
    border-radius: 4px;
    background: #f7faf7;
    padding: 10px;
    text-align: center;
    color: var(--ink);
    font-weight: 900;
    letter-spacing: 0.04em;
}

.login-button-link {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ink);
    border-radius: 4px;
    background: var(--orange);
    color: #ffffff;
    box-shadow: 5px 5px 0 var(--ink);
    padding: 10px 18px;
    font-weight: 900;
    text-decoration: none;
}

.login-button-link:hover,
.login-button-link:focus-visible {
    background: var(--orange-deep);
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--ink);
}

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

    .login-art {
        min-height: 210px;
        max-height: 34vh;
    }

    .login-art img {
        height: 34vh;
        min-height: 210px;
        object-fit: cover;
        object-position: 50% 44%;
    }

    .login-content {
        min-height: 66vh;
        padding: 34px 20px 54px;
    }
}

@media (max-width: 460px) {
    .login-form-wrap {
        padding: 26px 22px;
        box-shadow: 8px 8px 0 var(--ink);
    }

    .login-content::after {
        width: 86px;
        height: 86px;
    }

    .twofa-backup-grid {
        grid-template-columns: 1fr;
    }
}
