*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.lk-auth-page {
    min-height: 100vh;
    background: #f4f6f7;
    color: #0f172a;
    font-family: 'Montserrat', sans-serif;
}

[hidden] {
    display: none !important;
}

.lk-auth-page__shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.lk-auth-page__layout {
    width: 100%;
    max-width: 760px;
}

.lk-auth-page__brand {
    text-align: center;
    margin-bottom: 28px;
}

.lk-auth-page__brand-logo {
    display: inline-block;
    width: auto;
    height: 46px;
    max-width: 220px;
    object-fit: contain;
}

.lk-auth-page__brand-subtitle {
    margin-top: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.lk-auth-card {
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    padding: 30px 28px 26px;
}

.lk-auth-card.is-state-form,
.lk-auth-card.is-state-success,
.lk-auth-card.is-state-pending.is-pending-no-qr {
    max-width: 480px;
}

.lk-auth-card.is-state-pending.is-pending-has-qr {
    max-width: 740px;
}

.lk-modal__alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(227, 30, 36, 0.08);
    border: 1px solid rgba(227, 30, 36, 0.18);
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.4;
}

.lk-auth-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef9f7;
    color: #169a90;
    font-size: 32px;
}

.lk-auth-state-head--center {
    text-align: center;
}

.lk-auth-state-head h1,
.lk-auth-state-head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
}

.lk-auth-state-head p {
    max-width: 360px;
    margin: 10px auto 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.45;
}

.lk-login-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.lk-form-group {
    display: grid;
    gap: 8px;
}

.lk-form-group label {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.lk-form-group input {
    width: 100%;
    border: 1px solid #d6dde5;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    line-height: 1.3;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lk-form-group input:focus {
    outline: none;
    border-color: #1aa39a;
    box-shadow: 0 0 0 4px rgba(26, 163, 154, 0.10);
}

.lk-login-submit {
    min-height: 52px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, #84c8c1 0%, #8ad7cf 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.lk-login-submit:hover:not(:disabled) {
    box-shadow: 0 10px 10px rgba(15, 23, 42, 0.16);
}

.lk-login-submit:disabled {
    background: linear-gradient(90deg, #8fa4a2 0%, #98afad 100%);
    color: rgba(255, 255, 255, 0.92);
    opacity: 1;
    filter: saturate(0.8) brightness(0.92);
    box-shadow: none;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7.5' fill='white' stroke='%23d32f2f' stroke-width='2'/%3E%3Cline x1='5.3' y1='14.7' x2='14.7' y2='5.3' stroke='%23d32f2f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 10 10, not-allowed;
}

.lk-login-submit:disabled:hover {
    box-shadow: none;
}

.lk-max-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(28, 179, 166, 0.08);
    border: 1px solid rgba(28, 179, 166, 0.18);
    color: #0f766e;
    font-size: 14px;
    line-height: 1.45;
}

.lk-max-note i {
    margin-top: 1px;
    font-size: 16px;
    line-height: 1;
}

.lk-max-status-row--card {
    min-height: 50px;
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(28, 179, 166, 0.24);
    background: rgba(28, 179, 166, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lk-max-status-row__left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #147d74;
    font-size: 15px;
    font-weight: 700;
}

#lk-max-request-timer {
    color: #147d74;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.lk-max-steps--rich {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: grid;
    gap: 12px;
}

.lk-max-steps--rich li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-size: 15px;
    line-height: 1.35;
}

.lk-max-step-badge {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    background: #eef2f7;
    color: #94a3b8;
    font-size: 15px;
}

.lk-max-steps--rich li.is-done .lk-max-step-badge {
    background: #21c45d;
    color: #ffffff;
}

.lk-max-steps--rich li.is-current .lk-max-step-badge {
    background: rgba(28, 179, 166, 0.16);
    color: #1cb3a6;
}

.lk-max-steps--rich li:not(.is-done):not(.is-current) {
    color: #9ca3af;
}

.lk-max-qr-card {
    padding: 16px;
    border-radius: 16px;
    background: rgba(28, 179, 166, 0.06);
    border: 1px solid rgba(28, 179, 166, 0.16);
}

.lk-max-qr-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
    color: #147d74;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
}

.lk-max-qr-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 186px;
    margin-bottom: 10px;
}

#lk-max-qr-image {
    width: 170px;
    height: 170px;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
    padding: 6px;
}

.lk-max-qr-help {
    margin: 0;
    color: #147d74;
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
}

.lk-max-actions {
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.lk-max-actions button {
    font: inherit;
    cursor: pointer;
}

.lk-max-actions button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.lk-btn-outline--max {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lk-btn-outline--max.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.lk-max-footer-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}

.lk-max-footer-actions--split {
    justify-content: space-between;
}

.lk-max-footer-actions--center {
    justify-content: center;
}

.lk-max-text-action {
    border: none;
    background: transparent;
    padding: 0;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    line-height: 1.3;
    cursor: pointer;
}

.lk-max-text-action:hover {
    color: #6b7280;
}

.lk-max-text-action--primary {
    color: #1cb3a6;
}

.lk-max-text-action--primary:hover {
    color: #147d74;
}

.lk-max-after-note {
    margin: 14px 0 0;
    color: #9ca3af;
    text-align: center;
    font-size: 13px;
    line-height: 1.35;
}

.lk-max-success-progress {
    min-height: 54px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(34, 197, 94, 0.18);
    background: rgba(34, 197, 94, 0.08);
    color: #15803d;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.lk-max-success-dots {
    letter-spacing: 0.14em;
}

.lk-auth-page__footer {
    margin-top: 18px;
    text-align: center;
}

.lk-auth-page__back {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0 0 10px;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.lk-auth-page__back:hover {
    color: #6b7280;
}

.lk-auth-page__help {
    margin: 0;
    color: #9ca3af;
    font-size: 14px;
    line-height: 1.4;
}

.lk-auth-page__help a {
    color: #1aa39a;
    text-decoration: none;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-areas:
        "icon icon"
        "head head"
        "status qr"
        "steps qr"
        "actions qr"
        "footer footer"
        "note note";
    column-gap: 16px;
    row-gap: 10px;
    align-items: start;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-auth-state-icon {
    grid-area: icon;
    margin-bottom: 6px;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-auth-state-head {
    grid-area: head;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-status-row--card {
    grid-area: status;
    margin: 0;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-steps--rich {
    grid-area: steps;
    margin: 0;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-qr-card {
    grid-area: qr;
    margin: 0;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-actions {
    grid-area: actions;
    margin: 0;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-footer-actions {
    grid-area: footer;
    margin-top: 4px;
}

.lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-after-note {
    grid-area: note;
    margin-top: 0;
}

@media (max-width: 767.98px) {
    .lk-max-actions {
        grid-template-columns: 1fr;
    }
    
    .lk-auth-page__shell {
        padding: 28px 14px;
    }

    .lk-auth-page__brand {
        margin-bottom: 22px;
    }

    .lk-auth-page__brand-logo {
        height: 40px;
        max-width: 190px;
    }

    .lk-auth-card,
    .lk-auth-card.is-state-form,
    .lk-auth-card.is-state-success,
    .lk-auth-card.is-state-pending.is-pending-no-qr,
    .lk-auth-card.is-state-pending.is-pending-has-qr {
        max-width: 100%;
        padding: 22px 18px 20px;
        border-radius: 20px;
    }

    .lk-auth-state-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
        font-size: 28px;
    }

    .lk-auth-state-head h1,
    .lk-auth-state-head h2 {
        font-size: 16px;
    }

    .lk-auth-state-head p {
        font-size: 14px;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending {
        display: block;
    }

    .lk-max-steps--rich {
        gap: 18px;
        margin-bottom: 28px;
    }

    .lk-max-steps--rich li {
        line-height: 1.45;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-auth-state-head {
        margin-bottom: 22px;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-auth-state-head p {
        margin-top: 14px;
        line-height: 1.5;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-status-row--card {
        margin: 22px 0 26px;
        padding: 16px 18px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-status-row--card .lk-max-status-row__left {
        align-items: center;
        gap: 10px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-status-row--card #lk-max-request-timer {
        flex: 0 0 auto;
        margin-left: auto;
        text-align: right;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-steps--rich {
        margin: 0 0 26px;
        gap: 18px;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-steps--rich li {
        line-height: 1.45;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-qr-card {
        margin: 24px 0 0;
        padding: 24px 18px 22px;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-qr-card .lk-max-qr-title {
        margin-bottom: 18px;
        line-height: 1.45;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-qr-card .lk-max-qr-image-wrap {
        margin-bottom: 20px;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-qr-card .lk-max-qr-help {
        line-height: 1.5;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-actions {
        margin: 22px 0 0;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-footer-actions {
        margin-top: 20px;
        padding-top: 2px;
    }

    .lk-auth-card.is-state-pending.is-pending-has-qr #lk-max-step-pending > .lk-max-after-note {
        margin-top: 20px;
        line-height: 1.5;
    }

    .lk-max-footer-actions {
        gap: 12px;
    }

    .lk-max-footer-actions--split {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .lk-max-footer-actions--split .lk-max-text-action {
        justify-content: flex-start;
        white-space: nowrap;
    }

    .lk-max-footer-actions--center {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .lk-max-text-action {
        font-size: 15px;
    }

    .lk-auth-page__back {
        justify-content: center;
    }
}