.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);
}

.auth-card {
    width: 560px;
    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;
}

.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;
}

.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-telegram-widget-wrap {
    width: min(100%, 360px);
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    overflow: hidden;
    text-align: center;
    margin: 0 auto;
    background: #2aabee;
}

.auth-telegram-widget-wrap iframe {
    width: 100% !important;
    max-width: 360px !important;
    height: 44px !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 999px !important;
}

.auth-telegram-widget-wrap > * {
    margin-left: auto !important;
    margin-right: auto !important;
}

.auth-social-btn {
    width: min(100%, 360px);
    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: 15px;
    line-height: 1;
}

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

.auth-social-btn-google:hover {
    background: #2b2d30;
}

.auth-social-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #4285f4;
    font-size: 12px;
    font-weight: 700;
}

.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;
}

.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 {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
    align-items: center;
}

.auth-eye {
    width: 37px;
    min-width: 37px;
    height: 37px;
    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;
}

.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_slash.svg");
    mask-image: url("../../icons/eye_slash.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: 100%;
    background: var(--accent);
    color: #111;
    border-color: transparent;
    margin-top: 8px;
}

.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-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: fit-content;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    padding-left: 4px;
    margin-top: -8px;
    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;
    }

}
