#loginModal {
    background: rgba(6, 17, 31, 0.67);
    backdrop-filter: blur(2px);
}

#loginModal .login-container {
    box-sizing: border-box;
    width: min(92vw, 506px);
    max-width: 506px;
    max-height: min(94vh, 800px);
    padding: 34px 30px 22px;
    overflow-y: auto;
    border: 1px solid rgba(212, 221, 232, 0.92);
    border-radius: 20px;
    background:
        radial-gradient(circle at 1% 1%, rgba(220, 231, 242, 0.72), transparent 26%),
        #fff;
    box-shadow: 0 28px 70px rgba(4, 15, 30, 0.3);
}

#loginModal .login-header {
    margin: 0 0 20px;
}

#loginModal .login-logo {
    width: min(240px, 72%) !important;
    height: auto !important;
}

#loginModal #close-btn {
    top: 16px;
    right: 16px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #eef2f7;
    color: #536b89;
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
}

#loginModal #close-btn:hover {
    background: #e2e8f0;
    color: #173457;
}

#loginModal .login-form {
    gap: 0;
}

#loginModal .auth-step h2 {
    margin: 0 0 0.25rem;
    color: #071b38;
    font-size: clamp(1.65rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    text-align: center;
}

#loginModal .auth-help {
    margin: 0 0 1.45rem;
    color: #6c7d96;
    font-size: 1rem;
    line-height: 1.45;
    text-align: center;
}

#loginModal .auth-field {
    margin-bottom: 1rem;
}

#loginModal .auth-field > label {
    display: block;
    margin: 0 0 0.45rem;
    color: #173457;
    font-size: 0.92rem;
    font-weight: 600;
}

#loginModal .auth-input {
    margin: 0;
}

#loginModal .auth-input input {
    box-sizing: border-box;
    width: 100%;
    height: 56px;
    padding: 0 48px 0 16px;
    border: 1px solid #cbd6e3;
    border-radius: 10px;
    background: rgba(250, 252, 255, 0.94);
    color: #102844;
    font-size: 0.96rem;
    box-shadow: 0 1px 2px rgba(15, 36, 61, 0.03);
}

#loginModal .auth-input input::placeholder {
    color: #8798ae;
}

#loginModal .auth-input input:focus {
    border-color: #087dce;
    box-shadow: 0 0 0 3px rgba(0, 126, 207, 0.12);
}

#loginModal .auth-field-icon,
#loginModal .auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    display: grid;
    width: 25px;
    height: 25px;
    padding: 0;
    transform: translateY(-50%);
    place-items: center;
    border: 0;
    background: transparent;
    color: #173b68;
}

#loginModal .auth-password-toggle {
    cursor: pointer;
}

#loginModal .auth-field-icon svg,
#loginModal .auth-password-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#loginModal .auth-password-toggle.is-visible {
    color: #0785d1;
}

#loginModal .auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.05rem 0 1.3rem;
}

#loginModal .auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #173457;
    font-size: 0.83rem;
    white-space: nowrap;
}

#loginModal .auth-remember input {
    appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1.5px solid #9fb2c9;
    border-radius: 5px;
    background: #fff;
    accent-color: #087dce;
}

#loginModal .auth-remember input:checked {
    border-color: #087dce;
    background: #087dce;
    box-shadow: inset 0 0 0 4px #fff;
}

#loginModal .auth-forgot,
#loginModal .auth-support a {
    color: #0084db;
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
}

#loginModal .auth-forgot {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

#loginModal .auth-eyebrow {
    margin: 0 0 0.35rem;
    color: #f58220;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

#loginModal .auth-forgot:hover,
#loginModal .auth-support a:hover {
    text-decoration: underline;
}

#loginModal .login-button {
    width: 100% !important;
    min-height: 54px;
    border-radius: 10px;
    background: linear-gradient(100deg, #064b9a, #0789d6);
    box-shadow: 0 8px 18px rgba(0, 95, 174, 0.2);
    font-size: 1rem;
}

#loginModal .login-button:hover {
    background: linear-gradient(100deg, #073f82, #0079c8);
}

#loginModal .auth-submit {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

#loginModal .auth-submit > span:first-child {
    grid-column: 2;
}

#loginModal .auth-arrow {
    grid-column: 3;
    justify-self: center;
    font-size: 1.65rem;
    font-weight: 300;
    line-height: 1;
}

#loginModal .auth-support {
    margin-top: 1.2rem;
    padding-top: 1.15rem;
    border-top: 1px solid #e3e9f0;
    color: #73839a;
    font-size: 0.82rem;
    text-align: center;
}

#loginModal .auth-secondary,
#loginModal .auth-link-button {
    box-sizing: border-box;
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.72rem 1rem;
    border: 1px solid #bcc5d0;
    border-radius: 7px;
    background: #fff;
    color: #34465c;
    cursor: pointer;
    font: inherit;
}

#loginModal .auth-link-button {
    border-color: transparent;
    background: transparent;
    color: #526b89;
}

#loginModal button:disabled {
    cursor: wait;
    opacity: 0.68;
}

#loginModal .auth-message {
    display: block;
    min-height: 1.25rem;
    margin-top: 0.75rem;
    line-height: 1.35;
    text-align: center;
}

#loginModal .auth-code-input input {
    padding-right: 16px;
    letter-spacing: 0.35em;
    text-align: center;
}

#loginModal .auth-message.error {
    color: #b42318;
}

#loginModal .auth-message.success {
    color: #137333;
}

#loginModal .auth-requirements {
    margin: 0.25rem 0 1rem;
    padding-left: 1.25rem;
    color: #687383;
    font-size: 0.78rem;
    line-height: 1.5;
}

#loginModal .auth-qr {
    display: flex;
    width: 192px;
    min-height: 192px;
    margin: 0 auto 0.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8dee7;
    border-radius: 8px;
    background: #fff;
}

#loginModal .auth-qr img,
#loginModal .auth-qr canvas {
    display: block;
}

#loginModal .auth-secret-label {
    margin: 0.3rem 0;
    color: #687383;
    font-size: 0.75rem;
    text-align: center;
}

#loginModal .auth-secret {
    display: block;
    margin: 0 0 1rem;
    padding: 0.55rem;
    overflow-wrap: anywhere;
    border-radius: 6px;
    background: #f2f4f7;
    color: #26364a;
    text-align: center;
    user-select: all;
}

#loginModal .auth-centered {
    padding: 1rem 0;
    text-align: center;
}

#loginModal .auth-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 1rem;
    border: 3px solid #d8dee7;
    border-top-color: #2d5b9a;
    border-radius: 50%;
    animation: tds-auth-spin 0.8s linear infinite;
}

@keyframes tds-auth-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 560px) {
    #loginModal {
        align-items: flex-start;
        padding: 16px 0;
        overflow-y: auto;
    }

    #loginModal .login-container {
        width: calc(100vw - 24px);
        max-height: none;
        padding: 30px 20px 20px;
        border-radius: 16px;
    }

    #loginModal .login-logo {
        width: min(210px, 68%) !important;
    }

    #loginModal .auth-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.7rem;
    }

    #loginModal .auth-forgot {
        align-self: flex-end;
    }
}
