.auth-shell {
    --auth-primary: #174f78;
    --auth-primary-hover: #113f62;
    --auth-text: #202b38;
    --auth-muted: #667384;
    --auth-border: #d8dee6;
    --auth-background: #f3f5f7;
    --auth-surface: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--auth-background);
    color: var(--auth-text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.auth-header {
    display: flex;
    align-items: center;
    min-height: 76px;
    padding: 14px clamp(24px, 5vw, 72px);
    background: var(--auth-surface);
    border-top: 4px solid var(--auth-primary);
    border-bottom: 1px solid #e4e8ed;
}

.auth-logo {
    display: flex;
    align-items: center;
    padding-right: 22px;
    border-right: 1px solid var(--auth-border);
}

.auth-logo img {
    display: block;
    width: 126px;
    height: 36px;
    object-fit: contain;
}

.auth-product {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 22px;
}

.auth-product span {
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 600;
}

.auth-product small {
    color: var(--auth-muted);
    font-size: 11px;
}

.auth-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 3vw, 44px) clamp(24px, 4vw, 64px) 28px;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(330px, 40%) minmax(0, 60%);
    width: 100%;
    max-width: 1320px;
    min-height: clamp(520px, calc(100svh - 180px), 660px);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(32, 43, 56, 0.09);
}

.auth-content-register .auth-layout {
    grid-template-columns: minmax(340px, 38%) minmax(0, 62%);
    max-width: 1320px;
}

.auth-form-container {
    width: 100%;
    max-width: none;
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px clamp(42px, 6vw, 86px);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    box-shadow: none;
}

.auth-card > .auth-card-header,
.auth-card > .auth-form {
    width: 100%;
    max-width: 520px;
    margin-right: auto;
    margin-left: auto;
}

.auth-content-register .auth-card > .auth-card-header,
.auth-content-register .auth-card > .auth-form {
    max-width: 680px;
}

.auth-context {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(42px, 5vw, 70px);
    color: #ffffff;
    background: #123b59;
    border: 1px solid #123b59;
    border-radius: 10px 0 0 10px;
}

.auth-context-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 24px;
    color: #9bd8d2;
    font-size: 20px;
    border: 1px solid rgba(155, 216, 210, 0.45);
    border-radius: 8px;
}

.auth-context-label {
    margin: 0 0 12px;
    color: #9bd8d2;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.7px;
}

.auth-context h2 {
    margin: 0 0 14px;
    color: #ffffff;
    max-width: 360px;
    font-size: clamp(26px, 2.2vw, 32px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.35px;
}

.auth-context > p:not(.auth-context-label) {
    max-width: 360px;
    margin: 0;
    color: #c5d4df;
    font-size: 12px;
    line-height: 1.7;
}

.auth-context-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 22px;
    margin-top: 24px;
    color: #d7e2ea;
    font-size: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-context-status span {
    width: 7px;
    height: 7px;
    background: #71c7bb;
    border-radius: 50%;
}

.auth-card-header {
    padding-bottom: 24px;
    margin-bottom: 26px;
    border-bottom: 1px solid #e9edf1;
}

.auth-content h1 {
    margin: 0 0 8px;
    color: var(--auth-text);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.25px;
}

.auth-description {
    margin: 0;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.55;
}

.auth-form .form-label {
    margin-bottom: 7px;
    color: var(--auth-text);
    font-size: 13px;
    font-weight: 600;
}

.auth-shell .auth-input {
    min-height: 46px;
    padding: 10px 13px;
    color: var(--auth-text);
    font-size: 14px;
    background-color: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-shell .auth-input::placeholder {
    color: #8a95a3;
    opacity: 1;
}

.auth-shell .auth-input:focus {
    border-color: #4a7fa3;
    box-shadow: 0 0 0 3px rgba(23, 79, 120, 0.12);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap input[type="password"],
.auth-input-wrap input[autocomplete="current-password"],
.auth-input-wrap input[autocomplete="new-password"] {
    padding-right: 76px;
}

.auth-password-toggle {
    position: absolute;
    top: 7px;
    right: 8px;
    height: 32px;
    padding: 0 8px;
    color: var(--auth-primary);
    font-size: 11px;
    font-weight: 600;
    background: var(--auth-surface);
    border: 0;
    border-radius: 4px;
}

.auth-shell :is(a, button):focus-visible {
    outline: 2px solid #3679a8;
    outline-offset: 3px;
}

.auth-shell .auth-submit {
    min-height: 46px;
    padding: 11px 18px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    background: var(--auth-primary);
    border: 1px solid var(--auth-primary);
    border-radius: 6px;
    box-shadow: none;
}

.auth-shell .auth-submit:hover,
.auth-shell .auth-submit:focus {
    color: #ffffff;
    background: var(--auth-primary-hover);
    border-color: var(--auth-primary-hover);
}

.auth-shell .auth-submit:disabled {
    color: #ffffff;
    background: #7893a7;
    border-color: #7893a7;
    cursor: not-allowed;
    opacity: 0.75;
}

.auth-location {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0 0 18px;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.5;
}

.auth-location i {
    margin-top: 2px;
}

.auth-registration-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 6px 0 20px;
    padding: 11px 12px;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.5;
    background: var(--auth-background);
    border: 1px solid var(--auth-border);
    border-radius: 6px;
}

.auth-registration-note i {
    margin-top: 2px;
    color: var(--auth-primary);
}

.auth-switch {
    margin-top: 22px;
    color: var(--auth-muted);
    font-size: 12px;
    text-align: center;
}

.auth-shell .auth-link {
    margin-left: 3px;
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-shell .auth-link:hover {
    text-decoration: underline;
}

.auth-footer {
    margin: 20px 0 0;
    color: #7d8793;
    font-size: 11px;
    text-align: center;
}

.auth-form .alert {
    font-size: 12px;
    border-radius: 6px;
}

.auth-form .invalid-feedback {
    font-size: 12px;
}

.auth-form.was-validated .auth-input:invalid {
    border-color: #dc3545;
    background-image: none;
}

body.dark-mode .auth-shell {
    --auth-primary: var(--primary-bg-color, #6259ca);
    --auth-primary-hover: var(--primary-bg-hover, #544bc4);
    --auth-text: #dedefd;
    --auth-muted: #9595b5;
    --auth-border: rgba(255, 255, 255, 0.1);
    --auth-background: #1a1a3c;
    --auth-surface: #2a2a4a;
}

body.dark-mode .auth-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .auth-logo {
    padding: 7px 20px 7px 0;
}

body.dark-mode .auth-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .auth-layout {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

body.dark-mode .auth-context {
    background: #242446;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .auth-shell .auth-input {
    color: var(--auth-text);
    background-color: #282848;
    border-color: var(--auth-border);
}

body.dark-mode .auth-shell .auth-input::placeholder {
    color: #626281;
}

body.dark-mode .auth-password-toggle {
    background: #282848;
}

body.dark-mode .auth-shell .auth-submit {
    color: #ffffff;
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

body.dark-mode .auth-shell .auth-submit:hover {
    background: var(--auth-primary-hover);
    border-color: var(--auth-primary-hover);
}

@media (max-width: 850px) {
    .auth-layout,
    .auth-content-register .auth-layout {
        grid-template-columns: 1fr;
        max-width: 620px;
        min-height: auto;
    }

    .auth-context {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 16px;
        padding: 22px 26px;
        border-radius: 10px 10px 0 0;
    }

    .auth-context-icon {
        grid-row: 1 / 4;
        margin: 0;
    }

    .auth-context-label {
        margin-bottom: 5px;
    }

    .auth-context h2 {
        margin: 0;
        font-size: 18px;
    }

    .auth-context > p:not(.auth-context-label),
    .auth-context-status {
        display: none;
    }

    .auth-card {
        display: block;
        border-top: 0;
        border-left: 1px solid var(--auth-border);
        border-radius: 0 0 10px 10px;
    }
}

@media (max-width: 576px) {
    .auth-header {
        min-height: 68px;
        padding: 12px 20px;
    }

    .auth-logo {
        padding-right: 16px;
    }

    .auth-logo img {
        width: 108px;
        height: 32px;
    }

    .auth-product {
        margin-left: 16px;
    }

    .auth-product small {
        display: none;
    }

    .auth-content {
        justify-content: flex-start;
        padding: 28px 16px 24px;
    }

    .auth-context {
        display: none;
    }

    .auth-card {
        padding: 26px 22px 24px;
        border-top: 1px solid var(--auth-border);
        border-radius: 10px;
    }

    .auth-card-header {
        padding-bottom: 20px;
        margin-bottom: 22px;
    }

    .auth-content h1 {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell * {
        transition: none !important;
    }
}
