.auth-page {
    background: var(--theme-bg);
    color: var(--theme-copy);
}

.auth-page .auth-section {
    min-height: calc(100vh - 100px);
    padding: 112px 0 48px;
}

.auth-page .auth-section > .shape {
    height: 320px;
}

.auth-page .auth-container {
    padding-top: 0 !important;
}

.auth-page .auth-column {
    flex: 0 0 100%;
    max-width: 480px;
}

.auth-page .auth-card {
    overflow: hidden;
    border: 1px solid var(--theme-border) !important;
    border-radius: 12px;
    background: var(--theme-surface) !important;
    box-shadow: var(--theme-shadow-soft) !important;
}

.auth-page .auth-card > .card-header,
.auth-page .auth-card > .card-body {
    padding: 24px !important;
    background: var(--theme-surface) !important;
}

.auth-page .auth-card > .card-header {
    border-bottom: 1px solid var(--theme-border);
}

.auth-page .auth-title {
    margin-bottom: 0 !important;
    color: var(--theme-text) !important;
    font-weight: 700;
}

.auth-page .auth-title small {
    font-size: 1.1rem;
    color: var(--theme-text);
}

.auth-page .auth-social-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.auth-page .auth-social-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}

.auth-page .btn {
    min-height: 44px;
    border-radius: 6px;
    box-shadow: none;
    font-weight: 600;
    white-space: normal;
}

.auth-page .btn:hover {
    transform: none;
}

.auth-page .btn-primary {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: var(--theme-on-primary);
}

.auth-page :is(.btn-neutral, .btn-secondary, .btn-white) {
    background: var(--theme-surface-soft);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

.auth-page :is(.auth-social-btn, #passkeyLoginBtn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    color: var(--theme-text) !important;
}

.auth-page :is(.auth-social-btn, #passkeyLoginBtn):not(:disabled):is(:hover, :focus-visible) {
    background: var(--theme-surface-soft);
    border-color: var(--theme-primary);
}

.auth-page .auth-social-btn img,
.auth-page .passkey-login-icon {
    width: 20px;
    height: 20px;
}

.auth-page .auth-social-btn img,
.auth-page .passkey-login-icon {
    filter: var(--theme-logo-filter);
}

.auth-page :is(.btn-inner-text, .btn-inner--text) {
    margin-left: 0;
}

.auth-page .auth-label {
    margin-bottom: 8px;
    color: var(--theme-text);
    font-size: .8125rem;
    font-weight: 600;
}

.auth-page .auth-field-hint {
    display: block;
    margin-top: 8px;
    color: var(--theme-muted);
    font-size: 12px;
    line-height: 1.6;
}

.auth-page .invalid-feedback {
    margin-top: 8px;
    color: var(--theme-danger-text);
}

.auth-page .alert-success {
    background: var(--theme-success-soft);
    border-color: var(--theme-success);
    color: var(--theme-success-text);
}

.auth-page .alert-danger {
    background: var(--theme-danger-soft);
    border-color: var(--theme-danger);
    color: var(--theme-danger-text);
}

.auth-page .form-group {
    margin-bottom: 20px;
}

.auth-page .input-group-alternative,
.auth-page .auth-input-standalone {
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    background: var(--theme-input-bg);
    box-shadow: none;
}

.auth-page .input-group-alternative:focus-within,
.auth-page .auth-input-standalone:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), .12);
}

.auth-page .form-control,
.auth-page .input-group-text {
    min-height: 44px;
    height: auto;
    background: var(--theme-input-bg);
    color: var(--theme-copy);
    box-shadow: none;
}

.auth-page .input-group > .form-control {
    min-width: 0;
    border: 0;
}

.auth-page .form-control::placeholder {
    color: var(--theme-muted);
    opacity: 1;
}

.auth-page .input-group-text {
    border: 0;
    color: var(--theme-muted);
}

.auth-page .input-group .btn {
    min-height: 44px;
    margin: 0;
    padding: .5rem .75rem;
    border: 0;
    border-left: 1px solid var(--theme-border);
    border-radius: 0;
}

.auth-page .input-group [data-password-toggle] {
    min-width: 44px;
    background: transparent;
    color: var(--theme-copy);
}

.auth-page .auth-inline-action {
    max-width: 50%;
    flex-shrink: 0;
}

.auth-page .auth-submit,
.auth-page #passkeyLoginBtn {
    width: 100%;
    margin: 20px 0 0 !important;
}

.auth-page .custom-control-label {
    color: var(--theme-copy);
    font-size: .8125rem;
    line-height: 1.6;
}

.auth-page .custom-control-alternative .custom-control-label::before {
    border: 1px solid var(--theme-border);
    background: var(--theme-input-bg);
    box-shadow: none;
}

.auth-page .custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--theme-primary);
    background: var(--theme-primary);
}

.auth-page .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), .18);
}

.auth-page .text-muted {
    color: var(--theme-muted) !important;
}

.auth-page :is(.auth-card, .modal) a:not(.btn),
.auth-page :is(.btn-link, .text-primary) {
    color: var(--theme-primary);
}

.auth-page .auth-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 0;
    padding: 0 4px;
}

.auth-page .auth-links > div {
    flex: 1;
    max-width: none;
    padding: 0;
}

.auth-page .auth-links .text-light {
    color: var(--theme-copy) !important;
}

.auth-page .auth-links a:hover,
.auth-page .custom-control-label a:hover {
    text-decoration: underline;
}

.auth-page .modal-content {
    max-height: calc(100vh - 32px);
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-surface);
    box-shadow: var(--theme-shadow-soft);
}

.auth-page .modal-body {
    min-height: 0;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

.auth-page .modal-header,
.auth-page .modal-footer {
    border-color: var(--theme-border);
    background: var(--theme-surface-raised);
}

.auth-page .close {
    color: var(--theme-copy);
    opacity: 1;
    text-shadow: none;
}

.auth-page .close > span {
    color: inherit;
}

.auth-page .close:is(:hover, :focus) {
    color: var(--theme-primary);
}

.auth-page .root-legal-list li.is-warning {
    color: var(--theme-warning-text);
}

.auth-page .root-legal-list li.is-danger {
    color: var(--theme-danger-text);
}

.auth-page .telegram-login-code-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.auth-page .telegram-login-code-btn:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.auth-page .telegram-login-code-btn code {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    margin: 8px 0;
    padding: 12px;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    background: var(--theme-surface-soft);
    color: var(--theme-primary);
    font-size: 1.25rem;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}

.auth-page .hidden {
    display: none !important;
}

.auth-page .footer {
    padding: 24px 0;
    background: var(--theme-bg);
}

@supports (height: 100dvh) {
    .auth-page .auth-section {
        min-height: calc(100dvh - 100px);
    }
    .auth-page .modal-content {
        max-height: calc(100dvh - 32px);
    }
}

@media (max-width: 575px) {
    .auth-page .auth-section {
        padding: 88px 0 32px;
    }
    .auth-page .auth-card > .card-header,
    .auth-page .auth-card > .card-body {
        padding: 20px !important;
    }
    .auth-page .modal-dialog {
        margin: 16px 12px;
    }
}
