/* Auth modal — login + register popup UI */

.auth-modal[hidden] {
    display: none;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.auth-modal__card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
    padding: 32px;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
}

.auth-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #777;
    cursor: pointer;
    padding: 4px 8px;
}

.auth-modal__close:hover {
    color: #222;
}

.auth-modal__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.auth-modal__switch {
    margin: 0 0 20px;
    font-size: 13px;
    color: #666;
}

.auth-modal__switch a {
    color: #1a1a1a;
    text-decoration: underline;
    cursor: pointer;
}

.auth-modal__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-modal__error {
    color: #b00020;
    font-size: 13px;
}

.auth-modal__error:empty {
    display: none;
}

.auth-modal__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-modal__field label {
    font-size: 12px;
    color: #444;
}

.auth-modal__field input {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    width: 100%;
}

.auth-modal__field input:focus {
    outline: 2px solid rgba(99, 162, 96, 0.35);
    border-color: #63a260;
}

.auth-modal__field span.field-validation-error,
.auth-modal__field span[data-valmsg-for] {
    color: #b00020;
    font-size: 12px;
}

.auth-modal__hint {
    margin: -4px 0 0;
    font-size: 12px;
    color: #888;
}

.auth-modal__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    margin: 4px 0;
    cursor: pointer;
}

.auth-modal__checkbox input {
    width: 16px;
    height: 16px;
}

.auth-modal__privacy {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin: 8px 0;
}

.auth-modal__privacy a {
    text-decoration: underline;
}

.auth-modal__submit {
    margin-top: 12px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #63a260;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
}

.auth-modal__submit:hover {
    background: #538a51;
}

.auth-modal__footer {
    margin: 12px 0 0;
    font-size: 13px;
}

.auth-modal__footer a {
    color: #1a1a1a;
    text-decoration: underline;
    font-weight: 600;
}

.auth-modal__captcha {
    margin: 4px 0;
}

body.auth-modal-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .auth-modal__card {
        padding: 24px 20px;
    }

    .auth-modal__title {
        font-size: 20px;
    }
}

/* Topic login-required prompt — shown to guests on member-gated topics in place of the body */
.topic-login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
    min-height: 360px;
    gap: 16px;
}

.topic-login-required__title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.topic-login-required__message {
    margin: 0;
    max-width: 480px;
    font-size: 16px;
    color: #555;
    line-height: 1.5;
}

.topic-login-required__button {
    margin-top: 8px;
    min-width: 200px;
    height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: #63a260;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.topic-login-required__button:hover {
    background: #538a51;
}
