:root {
    --login-accent: #e42313;
    --login-text: #2f3338;
    --login-muted: #5b6470;
    --login-field: #e8f1ff;
    --login-button: #454545;
}

* {
    box-sizing: border-box;
}

body.frontend-login-page {
    min-height: 100vh;
    margin: 0;
    background: #ffffff;
    color: var(--login-text);
    font-family: Arial, Helvetica, sans-serif;
}

.login-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 4px solid var(--login-accent);
    box-shadow: inset 0 1px 0 #f7f7f7;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 126px;
    padding: 28px 20px;
}

.login-logo img {
    display: block;
    max-width: min(320px, 72vw);
    min-height: 100px;
    object-fit: contain;
}

.login-main {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: calc(100vh - 170px);
    padding: 118px 20px 56px;
}

.frontend-login-box {
    width: min(100%, 422px);
}

.login-message,
.activation-message {
    width: 100%;
    margin: 0 0 24px;
    padding: 18px 20px;
    border: 1px solid #d8e2ec;
    border-left: 5px solid #2f7d3d;
    border-radius: 5px;
    background: #f3fbf5;
    color: #25313d;
    font-size: 16px;
    line-height: 1.42;
    box-shadow: 0 8px 22px rgba(25, 36, 50, .08);
}

.login-message p,
.activation-message p {
    margin: 0;
}

.login-message a,
.activation-message a {
    display: inline-block;
    margin-top: 12px;
    color: #263f78;
    font-weight: 600;
    text-decoration: underline;
}

.login-message-error,
.activation-message-error {
    border-left-color: #c3261a;
    background: #fff4f2;
    color: #65170f;
}

.login-message-success,
.activation-message-success {
    border-left-color: #2f7d3d;
}

.frontend-login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.frontend-login-form input {
    width: 100%;
    height: 68px;
    margin: 0 0 20px;
    padding: 0 26px;
    border: 0;
    border-radius: 1px;
    background: var(--login-field);
    color: #111111;
    font-size: 18px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .16);
    outline: none;
}

.frontend-login-form input:focus {
    box-shadow: 0 0 0 3px rgba(228, 35, 19, .18), 0 5px 14px rgba(0, 0, 0, .16);
}

.frontend-login-form button {
    width: 180px;
    height: 50px;
    margin: 10px 0 32px;
    border: 0;
    border-radius: 6px;
    background: var(--login-button);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.frontend-login-form button:hover,
.frontend-login-form button:focus {
    background: #333333;
}

.forgot {
    color: var(--login-muted);
    font-size: 16px;
    text-decoration: none;
}

.forgot:hover,
.forgot:focus {
    color: #111111;
    text-decoration: underline;
}

.login-footer {
    display: none;
}

body.frontend-app-page {
    min-height: 100vh;
    margin: 0;
    background: #f5f6f8;
    color: #101722;
    font-family: Arial, Helvetica, sans-serif;
}

.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    height: 94px;
    background: #ffffff;
    border-bottom: 1px solid #e4e7eb;
    box-shadow: 0 6px 24px rgba(19, 28, 39, .06);
}

.app-logo {
    display: flex;
    align-items: center;
    width: 430px;
    height: 94px;
    padding: 0 42px;
}

.app-logo img {
    max-width: 225px;
    max-height: 90px;
    object-fit: contain;
}

.app-logout {
    position: absolute;
    top: 0;
    right: 40px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 94px;
    color: #b70606;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.app-logout-icon {
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid #b70606;
    border-right: 0;
    border-radius: 2px;
    margin-right: 10px;
}

.app-logout-icon::before {
    content: "";
    position: absolute;
    top: 7px;
    right: -9px;
    width: 12px;
    height: 2px;
    background: #b70606;
}

.app-logout-icon::after {
    content: "";
    position: absolute;
    top: 4px;
    right: -10px;
    width: 7px;
    height: 7px;
    border-top: 2px solid #b70606;
    border-right: 2px solid #b70606;
    transform: rotate(45deg);
}

.app-sidebar {
    position: fixed;
    top: 95px;
    left: 0;
    bottom: 0;
    z-index: 18;
    width: 80px;
    background: #eef0f2;
    border-right: 1px solid #d9dde2;
}

.app-side-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 76px;
    border-bottom: 1px solid #d9dde2;
    color: #68717c;
    text-decoration: none;
}

.app-side-icon.active {
    background: linear-gradient(180deg, #e00000, #b80000);
    color: #ffffff;
    box-shadow: 8px 0 20px rgba(190, 0, 0, .16);
}

.app-side-icon span::before {
    display: block;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
}

.app-icon-user::before {
    content: "\25CB";
}

.app-icon-cart::before {
    content: "\25F1";
}

.app-icon-doc::before {
    content: "\25B1";
}

.app-menu {
    position: fixed;
    top: 95px;
    left: 80px;
    bottom: 0;
    z-index: 17;
    width: 330px;
    background: #ffffff;
    border-right: 1px solid #dfe3e8;
    border-top-right-radius: 6px;
    box-shadow: 16px 0 34px rgba(30, 42, 56, .07);
}

.app-menu a {
    display: flex;
    align-items: center;
    height: 76px;
    padding: 0 28px;
    border-bottom: 1px solid #e4e7eb;
    color: #101722;
    font-size: 19px;
    font-weight: 500;
    text-decoration: none;
}

.app-menu a.active {
    border-right: 5px solid #d10000;
    color: #b30000;
    background: linear-gradient(90deg, rgba(210, 0, 0, .05), rgba(255, 255, 255, 0));
}

.profile-incomplete .app-menu a:not(.active),
.profile-incomplete .app-sidebar a:not(.active) {
    cursor: not-allowed;
    opacity: .55;
}

.app-main {
    min-height: 100vh;
    padding: 128px 80px 56px 474px;
    background: radial-gradient(circle at 76% 18%, rgba(255, 255, 255, .9), rgba(245, 246, 248, 0) 36%), #f5f6f8;
}

.frontend-profile-box {
    width: 100%;
}

.profile-card {
    width: 100%;
    min-height: 620px;
    padding: 44px 56px 36px;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 52px rgba(25, 36, 50, .12);
}

.profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dfe3e8;
}

.profile-head h1 {
    margin: 0 0 18px;
    color: #101722;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0;
}

.profile-head p {
    margin: 0;
    color: #68717c;
    font-size: 16px;
}

.profile-note {
    margin-bottom: 18px;
    color: #565d66;
    font-size: 14px;
}

.profile-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-left: 4px solid #3b8f46;
    background: #edf8ef;
    color: #2e6735;
}

.profile-message.error {
    border-left-color: #a61912;
    background: #fff0ee;
    color: #8d1711;
}

.profile-form {
    width: 100%;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 22px 34px;
}

.profile-grid label,
.profile-static {
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: #222b36;
    font-size: 15px;
    font-weight: 500;
}

.profile-grid input,
.profile-grid select {
    width: 100%;
    height: 50px;
    border: 1px solid #cfd5dc;
    border-radius: 5px;
    background: #ffffff;
    padding: 0 16px;
    color: #101722;
    font-size: 17px;
    box-shadow: inset 0 1px 2px rgba(16, 23, 34, .04);
}

.profile-grid input:disabled,
.profile-grid select:disabled {
    background: #f1f2f4;
    color: #8b94a0;
}

.profile-grid input.invalid,
.profile-grid select.invalid {
    border-color: #ff1717;
    box-shadow: 0 0 0 1px rgba(255, 23, 23, .2);
}

.profile-static strong {
    min-height: 50px;
    display: flex;
    align-items: center;
    font-size: 16px;
}

.profile-hidden-country {
    display: none !important;
}

.profile-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: auto;
    min-width: 260px;
    height: 54px;
    margin-top: 28px;
    border: 0;
    border-radius: 5px;
    background: linear-gradient(180deg, #d60000, #b60000);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(190, 0, 0, .22);
}

.profile-submit:hover,
.profile-submit:focus {
    background: linear-gradient(180deg, #bd0000, #9f0000);
}

.profile-save-icon {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.profile-save-icon::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 3px;
    height: 6px;
    border: 2px solid currentColor;
    border-bottom: 0;
}

.legal-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 170px 24px 40px;
    background: rgba(0, 0, 0, .48);
}

.legal-modal {
    width: min(1020px, 96vw);
    min-height: 440px;
    max-height: min(620px, calc(100vh - 120px));
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
    overflow: auto;
}

.legal-modal-content {
    padding: 44px 48px 36px;
    color: #5b6570;
    font-size: 14px;
    line-height: 1.55;
}

.legal-modal-content h2 {
    margin: 0 0 20px;
    color: #323840;
    font-size: 20px;
    font-weight: 600;
}

.legal-modal-text {
    margin-bottom: 26px;
}

.legal-check {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    align-items: flex-start;
    margin: 0 0 26px;
}

.legal-check input {
    margin-top: 3px;
}

.legal-check a {
    color: #4b5966;
    text-decoration: underline;
}

.legal-confirm {
    min-width: 150px;
    height: 38px;
    border: 0;
    border-radius: 2px;
    background: #a61912;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.legal-confirm:disabled {
    opacity: .65;
    cursor: wait;
}

.app-side-icon.active path{
    stroke: #ffffff;
}
.app-side-icon.active .fill path{
    fill: #ffffff;
}

.bonus-balance {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 8px 0 24px;
    padding: 12px 16px;
    border-left: 4px solid #a61912;
    background: #f6f6f6;
    color: #3f4348;
}

.bonus-balance span {
    color: #69717a;
}

.bonus-balance strong {
    font-size: 18px;
}

.bonus-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.bonus-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 14px;
}

.bonus-table th,
.bonus-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #dedede;
    color: #3f4348;
    vertical-align: top;
}

.bonus-table th {
    background: #f4f4f4;
    color: #555f69;
    font-weight: 600;
    text-align: left;
}

.bonus-table .text-right {
    text-align: right;
}

.bonus-head-row {
    cursor: pointer;
}

.bonus-head-row:hover {
    background: #fbf3f2;
}

.bonus-item-row td {
    background: #fafafa;
    color: #5d6570;
}

.bonus-empty {
    text-align: center;
    color: #6d7580;
}

.frontend-delete-box {
    width: min(100%, 1120px);
}

.privacy-card {
    display: grid;
    gap: 26px;
}

.privacy-section {
    padding: 22px 0;
    border-bottom: 1px solid #e2e6ea;
    color: #4f5965;
    font-size: 16px;
    line-height: 1.55;
}

.privacy-section:last-child {
    border-bottom: 0;
}

.privacy-section h2 {
    margin: 0 0 16px;
    color: #101722;
    font-size: 22px;
}

.privacy-checkbox {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 12px;
    align-items: start;
    margin: 16px 0;
}

.privacy-checkbox input {
    margin-top: 4px;
}

.privacy-secondary-btn,
.privacy-danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 12px 0;
    padding: 0 18px;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.privacy-secondary-btn {
    background: #eef1f4;
    color: #303a45;
}

.privacy-danger-btn {
    background: linear-gradient(180deg, #d60000, #b60000);
    color: #ffffff;
}

.privacy-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .48);
}

.privacy-modal-backdrop[hidden] {
    display: none;
}

.privacy-modal,
.privacy-confirm-modal {
    width: min(900px, 96vw);
    max-height: min(620px, calc(100vh - 80px));
    overflow: auto;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .24);
}

.privacy-confirm-modal {
    width: min(440px, 94vw);
    padding: 28px;
}

.privacy-modal-content {
    padding: 42px;
}

.privacy-modal-close {
    float: right;
    margin: 14px 16px 0 0;
    border: 0;
    background: transparent;
    color: #69717c;
    font-size: 20px;
    cursor: pointer;
}

.privacy-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(90px);
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 18px;
    border-radius: 999px;
    background: #222832;
    color: #ffffff;
    text-align: center;
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .login-header {
        border-top-width: 22px;
    }

    .login-logo {
        min-height: 104px;
    }

    .login-main {
        min-height: calc(100vh - 130px);
        padding-top: 74px;
    }

    .frontend-login-form input {
        height: 58px;
        font-size: 16px;
    }
}

@media (max-width: 900px) {
    .app-logo {
        width: 100%;
        border-right: 0;
        height: 74px;
        padding: 0 20px;
    }

    .app-logo img {
        max-width: 190px;
    }

    .app-topbar {
        height: 74px;
    }

    .app-logout {
        right: 18px;
        height: 74px;
        font-size: 14px;
    }

    .app-sidebar {
        display: none;
    }

    .app-menu {
        position: static;
        display: flex;
        width: 100%;
        margin-top: 74px;
        border-right: 0;
        border-radius: 0;
        overflow-x: auto;
        box-shadow: none;
    }

    .app-menu a {
        flex: 0 0 auto;
        height: 48px;
        padding: 0 18px;
        font-size: 15px;
        border-right: 0;
    }

    .app-menu a.active {
        border-right: 0;
        border-bottom: 4px solid #a61912;
    }

    .app-main {
        padding: 28px 18px 44px;
    }

    .profile-card {
        min-height: 0;
        padding: 28px 20px;
    }

    .profile-head h1 {
        font-size: 26px;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}
