:root {
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

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

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.auth-body {
    --auth-bg: #f7f8fb;
    --auth-card: rgba(255, 255, 255, 0.96);
    --auth-panel: #ffffff;
    --auth-ink: #111a33;
    --auth-muted: #667085;
    --auth-line: #dce3ef;
    --auth-soft-line: rgba(17, 26, 51, 0.08);
    --auth-orange: #ff7900;
    --auth-orange-dark: #d95f00;
    --auth-blue: #061846;
    --auth-blue-soft: #eef4ff;
    --auth-shadow: 0 26px 70px rgba(17, 26, 51, 0.13);
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px;
    background:
        radial-gradient(circle at 12% 14%, rgba(255, 121, 0, 0.13), transparent 30%),
        linear-gradient(135deg, rgba(255, 121, 0, 0.08), rgba(255, 255, 255, 0.72) 44%, rgba(6, 24, 70, 0.07)),
        var(--auth-bg);
    color: var(--auth-ink);
}

.auth-body.auth-dark {
    color-scheme: dark;
    --auth-bg: #111827;
    --auth-card: rgba(21, 29, 44, 0.96);
    --auth-panel: #151d2c;
    --auth-ink: #f8fafc;
    --auth-muted: #b4becf;
    --auth-line: #3b4759;
    --auth-soft-line: rgba(255, 255, 255, 0.1);
    --auth-blue-soft: rgba(255, 255, 255, 0.06);
    --auth-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(390px, 1fr) minmax(390px, 1fr);
    width: min(1400px, 100%);
    min-height: 700px;
    border: 1px solid var(--auth-soft-line);
    border-radius: 24px;
    overflow: hidden;
    background: var(--auth-card);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(18px);
}

.auth-panel {
    position: relative;
    display: grid;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    padding: 64px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.86)),
        var(--auth-panel);
}

.auth-body.auth-dark .auth-panel {
    background: linear-gradient(135deg, rgba(21, 29, 44, 0.98), rgba(36, 44, 61, 0.94));
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255, 121, 0, 0.16) 1.5px, transparent 1.8px),
        linear-gradient(135deg, transparent 0 64%, rgba(255, 121, 0, 0.07) 64% 65%, transparent 65%);
    background-position: 24px 24px, 0 0;
    background-size: 24px 24px, 100% 100%;
    opacity: 0.34;
    pointer-events: none;
}

.auth-panel-shape,
.auth-growth-arrow {
    position: absolute;
    pointer-events: none;
    opacity: 0.1;
}

.auth-panel-shape {
    right: -58px;
    bottom: 116px;
    width: 330px;
    height: 190px;
    border-right: 18px solid var(--auth-orange);
    border-bottom: 18px solid var(--auth-orange);
    border-radius: 0 0 140px 0;
    transform: rotate(-18deg);
}

.auth-growth-arrow {
    right: 100px;
    bottom: 194px;
    width: 92px;
    height: 92px;
    border-top: 16px solid var(--auth-orange);
    border-right: 16px solid var(--auth-orange);
    transform: rotate(16deg);
}

.auth-panel-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 24px;
    justify-items: start;
    max-width: 580px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--auth-soft-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--auth-blue);
    font-size: 13px;
    font-weight: 800;
}

.auth-body.auth-dark .auth-badge {
    background: rgba(255, 255, 255, 0.06);
    color: var(--auth-ink);
}

.auth-panel-logo {
    display: block;
    width: min(320px, 78%);
    height: auto;
    max-height: 150px;
    object-fit: contain;
    object-position: center;
}

.auth-panel-title {
    max-width: 560px;
    margin: 0;
    color: var(--auth-blue);
    font-size: 34px;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: 0;
}

.auth-panel-title em {
    color: var(--auth-orange);
    font-style: normal;
}

.auth-body.auth-dark .auth-panel-title {
    color: var(--auth-ink);
}

.auth-panel-copy {
    max-width: 520px;
    margin: 0;
    color: var(--auth-muted);
    font-size: 16px;
    line-height: 1.65;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: min(580px, 100%);
    margin-top: 12px;
}

.auth-feature-grid article {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--auth-soft-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 10px 28px rgba(17, 26, 51, 0.06);
}

.auth-body.auth-dark .auth-feature-grid article {
    background: rgba(255, 255, 255, 0.05);
}

.auth-feature-grid span {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--auth-orange);
    font-size: 18px;
    box-shadow: 0 8px 18px rgba(17, 26, 51, 0.08);
}

.auth-feature-grid strong {
    color: var(--auth-ink);
    font-size: 15px;
    line-height: 1.25;
}

.auth-feature-grid p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.4;
}

.auth-card {
    position: relative;
    display: grid;
    align-content: center;
    width: 100%;
    min-width: 0;
    padding: 72px 72px;
    background: var(--auth-card);
}

.auth-theme-toggle {
    position: absolute;
    top: 44px;
    right: 46px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 72px;
    min-height: 44px;
    padding: 4px 9px;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    background: var(--auth-card);
    color: var(--auth-blue);
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(17, 26, 51, 0.07);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.auth-theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(17, 26, 51, 0.1);
}

.auth-theme-toggle span {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.auth-theme-toggle span:first-child {
    background: rgba(255, 121, 0, 0.12);
}

.auth-theme-sun::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--auth-orange);
    box-shadow: 0 0 0 4px rgba(255, 121, 0, 0.16);
}

.auth-theme-moon::before {
    content: "";
    width: 13px;
    height: 13px;
    border-radius: 50%;
    box-shadow: -4px 0 0 0 var(--auth-blue);
}

.auth-body.auth-dark .auth-theme-moon::before {
    box-shadow: -4px 0 0 0 var(--auth-ink);
}

.auth-card h2 {
    margin: 0;
    color: var(--auth-ink);
    font-size: 40px;
    line-height: 1.12;
    letter-spacing: 0;
}

.auth-subtitle {
    max-width: 440px;
    margin: 12px 0 0;
    color: var(--auth-muted);
    font-size: 16px;
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 18px;
    width: min(480px, 100%);
    margin-top: 36px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field label,
.auth-form label {
    color: var(--auth-ink);
    font-size: 15px;
    font-weight: 800;
}

.auth-control {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 52px;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: var(--auth-card);
    padding: 0 14px;
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.auth-control:focus-within {
    border-color: rgba(255, 121, 0, 0.78);
    box-shadow: 0 0 0 4px rgba(255, 121, 0, 0.13);
}

.auth-field-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    color: #657189;
}

.auth-user-icon::before,
.auth-user-icon::after,
.auth-key-icon::before,
.auth-key-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}

.auth-user-icon::before {
    top: 1px;
    left: 5px;
    width: 8px;
    height: 8px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.auth-user-icon::after {
    right: 2px;
    bottom: 1px;
    left: 2px;
    height: 8px;
    border: 2px solid currentColor;
    border-radius: 9px 9px 3px 3px;
}

.auth-key-icon::before {
    top: 4px;
    left: 1px;
    width: 8px;
    height: 8px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.auth-key-icon::after {
    top: 7px;
    left: 8px;
    width: 10px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    height: 50px;
    border: 0;
    background: transparent;
    color: var(--auth-ink);
    font: inherit;
    font-size: 15px;
    outline: 0;
}

.auth-password-field {
    position: relative;
    grid-template-columns: 26px minmax(0, 1fr) 44px;
}

.auth-form button.auth-password-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #657189;
    cursor: pointer;
    transition: background-color 200ms ease, color 200ms ease;
}

.auth-form button.auth-password-toggle:hover {
    background: rgba(255, 121, 0, 0.11);
    color: var(--auth-orange);
}

.auth-password-toggle span,
.auth-password-toggle span::before,
.auth-password-toggle span::after {
    display: block;
    box-sizing: border-box;
}

.auth-password-toggle span {
    position: relative;
    width: 21px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 60% 60% 55% 55%;
    transform: rotate(45deg);
}

.auth-password-toggle span::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 4px;
    width: 7px;
    height: 7px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.auth-password-toggle span::after {
    content: "";
    position: absolute;
    top: -5px;
    left: 8px;
    width: 2px;
    height: 24px;
    background: currentColor;
    opacity: 0.9;
}

.auth-password-toggle.is-visible span::after {
    opacity: 0;
}

.auth-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-remember {
    display: inline-flex !important;
    align-items: center;
    min-height: 44px;
    gap: 10px !important;
    color: var(--auth-muted);
    font-size: 14px;
    font-weight: 700 !important;
}

.auth-form .auth-remember input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 5px;
    accent-color: var(--auth-orange);
}

.auth-forgot-link,
.auth-switch-link,
.auth-support-link {
    color: var(--auth-orange);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.auth-forgot-link:hover,
.auth-switch-link:hover,
.auth-support-link:hover {
    color: var(--auth-orange-dark);
    text-decoration: underline;
}

.auth-locked-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: var(--auth-blue-soft);
}

.auth-locked-user > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--auth-orange), var(--auth-orange-dark));
    color: #ffffff;
    font-weight: 900;
}

.auth-locked-user strong,
.auth-locked-user small {
    display: block;
}

.auth-locked-user small {
    color: var(--auth-muted);
}

.auth-form > button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-orange), var(--auth-orange-dark));
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 13px 28px rgba(255, 121, 0, 0.24);
    transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}

.auth-form > button[type="submit"]:hover {
    box-shadow: 0 16px 34px rgba(255, 121, 0, 0.32);
    filter: saturate(1.08);
    transform: translateY(-1px);
}

.auth-help {
    margin: 6px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    text-align: center;
}

.auth-switch-link {
    justify-self: center;
}

.erp-flash {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
}

.erp-flash.is-success {
    border: 1px solid rgba(29, 128, 75, 0.22);
    background: rgba(29, 128, 75, 0.09);
    color: #17603a;
}

.erp-flash.is-error {
    border: 1px solid rgba(181, 48, 42, 0.24);
    background: rgba(181, 48, 42, 0.09);
    color: #932b25;
}

@media (max-width: 1024px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .auth-panel,
    .auth-card {
        padding: 44px;
    }

    .auth-panel-content {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .auth-body {
        place-items: start center;
        min-height: auto;
        padding: 16px;
    }

    .auth-panel-shape,
    .auth-growth-arrow {
        display: none;
    }

    .auth-shell {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .auth-panel,
    .auth-panel-content {
        display: contents;
    }

    .auth-panel::before {
        display: none;
    }

    .auth-panel-logo {
        order: 1;
        justify-self: center;
        width: min(190px, 62%);
        margin: 28px auto 0;
    }

    .auth-panel-title {
        order: 2;
        max-width: none;
        margin: 18px 24px 0;
        text-align: center;
        font-size: 25px;
    }

    .auth-panel-copy {
        order: 3;
        display: block;
        margin: 10px 26px 0;
        text-align: center;
        font-size: 15px;
        line-height: 1.5;
    }

    .auth-card {
        order: 4;
    }

    .auth-feature-grid {
        order: 5;
    }

    .auth-panel-content {
        gap: 18px;
        justify-items: center;
        text-align: center;
    }

    .auth-badge {
        display: none;
    }

    .auth-feature-grid {
        display: flex;
        width: auto;
        gap: 12px;
        margin: 0 18px 22px;
        overflow-x: auto;
        padding: 2px 2px 12px;
        scroll-snap-type: x mandatory;
    }

    .auth-feature-grid article {
        flex: 0 0 210px;
        scroll-snap-align: start;
        text-align: left;
    }

    .auth-card {
        padding: 28px 24px 24px;
    }

    .auth-theme-toggle {
        position: static;
        justify-self: end;
        margin-bottom: 20px;
    }
}

@media (max-width: 520px) {
    .auth-body {
        padding: 10px;
    }

    .auth-shell {
        border-radius: 20px;
    }

    .auth-panel-logo {
        width: min(170px, 58%);
        margin-top: 22px;
    }

    .auth-panel-title {
        margin-right: 18px;
        margin-left: 18px;
        font-size: 22px;
    }

    .auth-panel-copy {
        display: none;
    }

    .auth-feature-grid article {
        flex-basis: 176px;
        padding: 13px;
    }

    .auth-card h2 {
        font-size: 32px;
    }

    .auth-form-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}
