.auth-main {
    max-width: none;
    margin: 0;
    padding: 34px 20px;
    background: transparent;
    border: 0;
}

.auth-shell {
    max-width: 600px;
    margin: 0 auto;
}

.auth-layout {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38);
    width: 560px;
    max-width: 100%;
    margin: 0 auto;
}

.auth-card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 42px;
    display: grid;
    gap: 16px;
    align-content: start;
}

.auth-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
    width: min(100%, 400px);
    margin-left: auto;
    margin-right: auto;
}

.auth-alert {
    border: 1px solid #7a2d2d;
    background: rgba(160, 52, 52, 0.16);
    color: #ffd0d0;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    width: min(100%, 400px);
    margin-left: auto;
    margin-right: auto;
}

.auth-alert-success {
    border-color: #2b6f46;
    background: rgba(55, 141, 89, 0.16);
    color: #c9f0d6;
}

.auth-social-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: center;
    justify-items: center;
}

.auth-social-row > :only-child {
    grid-column: 1 / -1;
}

.auth-social-btn {
    width: min(100%, 400px);
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.auth-social-btn-google {
    color: #3c4043;
    background: #fff;
    border: 1px solid #dadce0;
}

.auth-social-btn-google:hover {
    background: #f5f6f7;
    border-color: #c6c7c9;
}

.auth-social-btn-telegram {
    color: #ffffff;
    background: #2aabee;
    border: 1px solid #229ed9;
}

.auth-social-btn-telegram:hover {
    background: #239fdb;
    border-color: #1d8ac2;
}

.auth-social-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.auth-social-icon img {
    width: 18px;
    height: 18px;
    display: block;
}

.auth-social-icon-telegram {
    background: transparent;
    width: 18px;
    height: 18px;
}

.auth-social-icon-telegram img {
    filter: brightness(0) invert(1);
    width: 18px;
    height: 18px;
}

.auth-telegram-action {
    position: relative;
    width: min(100%, 400px);
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-telegram-widget-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    pointer-events: auto;
}

.auth-telegram-widget-wrap iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

.auth-telegram-widget-wrap > div,
.auth-telegram-widget-wrap > span,
.auth-telegram-widget-wrap > div > iframe {
    width: 100% !important;
    height: 100% !important;
}

.auth-separator {
    position: relative;
    width: 72%;
    margin: 8px auto 10px;
    text-align: center;
}

.auth-separator::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateY(-50%);
}

.auth-separator > span {
    position: relative;
    display: inline-block;
    padding: 0 10px;
    color: var(--text-muted);
    background: var(--bg-card);
    font-size: 12px;
    line-height: 1;
    text-transform: lowercase;
}

.auth-form {
    display: grid;
    gap: 14px;
    justify-items: center;
}

.auth-form > * {
    width: min(100%, 400px);
}

.auth-field {
    display: grid;
    gap: 7px;
    font-size: 14px;
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

.auth-field span {
    color: var(--text-muted);
    padding-left: 4px;
}

.auth-field input {
    background: #111;
    border: 1px solid var(--border-color);
    padding: 10px;
    color: var(--text-main);
    border-radius: 4px;
    width: 100%;
    margin: 0;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-password-row {
    position: relative;
    display: grid;
    align-items: center;
}

.auth-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    width: 32px;
    min-width: 32px;
    height: 32px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transform: translateY(-50%);
}

.auth-eye:hover {
    color: var(--text-muted);
}

.auth-eye.is-active {
    color: var(--accent);
}

.auth-eye:focus-visible {
    outline: none;
}

.auth-eye-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    pointer-events: none;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.auth-eye-off {
    -webkit-mask-image: url("../../icons/eye-off.svg");
    mask-image: url("../../icons/eye-off.svg");
}

.auth-eye-on {
    -webkit-mask-image: url("../../icons/eye.svg");
    mask-image: url("../../icons/eye.svg");
}

.auth-eye .auth-eye-on {
    display: none;
}

.auth-eye.is-active .auth-eye-on {
    display: inline-flex;
}

.auth-eye.is-active .auth-eye-off {
    display: none;
}

.auth-password-popup {
    margin-top: 0;
    border: 0 solid #7a2d2d;
    background: rgba(160, 52, 52, 0.12);
    border-radius: 12px;
    padding: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: max-height 0.2s ease, opacity 0.2s ease, transform 0.2s ease, padding 0.2s ease;
}

.auth-password-popup.is-open {
    margin-top: 8px;
    border-width: 1px;
    max-height: 180px;
    opacity: 1;
    transform: translateY(0);
    padding: 10px 12px;
}

.auth-rules {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.auth-rule {
    font-size: 13px;
    line-height: 1.4;
    color: #ffb3b3;
}

.auth-submit {
    width: min(100%, 400px);
    background: var(--accent);
    color: #111;
    border-color: transparent;
    margin-top: 8px;
    justify-self: center;
}

.auth-submit:hover {
    background: #ffd633;
}

.auth-submit:active {
    background: var(--accent);
    color: #111;
}

.auth-submit:disabled:hover {
    background: var(--accent);
}

.auth-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 16px;
    padding-top: 12px;
    text-align: center;
}

.auth-password-row input {
    padding-right: 44px;
}

.auth-separator {
    width: min(100%, 400px);
}

.auth-switch {
    width: min(100%, 400px);
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

.auth-switch-inline {
    gap: 6px;
}

.auth-switch-inline a {
    color: var(--accent);
    text-decoration: none;
}

.auth-switch-inline a:hover {
    text-decoration: underline;
}

.auth-link-button {
    width: min(100%, 400px);
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    padding-left: 4px;
    margin-top: 6px;
    margin-bottom: 6px;
}

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


@media (max-width: 560px) {
    .auth-main {
        padding: 18px 10px;
    }

    .auth-card {
        padding: 22px 18px;
    }

    .auth-title {
        font-size: 26px;
    }

    .auth-switch {
        flex-direction: column;
        align-items: stretch;
    }

}
