.alg-gate {
    --alg-primary: #0f172a;
    --alg-secondary: #eef2f7;
    --alg-card: #fff;
    --alg-text: #0f172a;
    --alg-radius: 16px;
    position: relative;
    margin: 0 0 32px;
    color: var(--alg-text);
}

.alg-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font: inherit;
    line-height: 1.75;
    margin-bottom: 0;
}

.alg-fade {
    height: 46px;
    margin-top: -18px;
    position: relative;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(255,255,255,0), var(--alg-card) 82%);
    pointer-events: none;
}

.alg-locked-placeholder {
    filter: blur(4px);
    opacity: .26;
    user-select: none;
    pointer-events: none;
    margin: 4px 0 20px;
}

.alg-locked-placeholder span {
    display: block;
    height: 12px;
    margin: 13px 0;
    border-radius: 999px;
    background: currentColor;
}

.alg-locked-placeholder span:nth-child(8n+1) { width: 96%; }
.alg-locked-placeholder span:nth-child(8n+2) { width: 88%; }
.alg-locked-placeholder span:nth-child(8n+3) { width: 93%; }
.alg-locked-placeholder span:nth-child(8n+4) { width: 78%; }
.alg-locked-placeholder span:nth-child(8n+5) { width: 86%; }
.alg-locked-placeholder span:nth-child(8n+6) { width: 91%; }
.alg-locked-placeholder span:nth-child(8n+7) { width: 74%; }
.alg-locked-placeholder span:nth-child(8n+8) { width: 84%; }

.alg-lock-card {
    position: relative;
    z-index: 3;
    max-width: 680px;
    margin: -8px auto 0;
    padding: 30px 26px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: var(--alg-radius);
    background: var(--alg-card);
    color: var(--alg-text);
    box-shadow: 0 14px 40px rgba(15, 23, 42, .08);
    text-align: center;
}

.alg-lock-icon {
    font-size: 22px;
    margin-bottom: 8px;
}

.alg-lock-card h3,
.alg-panel h2 {
    margin: 0 0 8px;
    line-height: 1.25;
    color: var(--alg-text);
}

.alg-lock-card p,
.alg-panel > p {
    margin: 0 0 20px;
    color: var(--alg-text);
}

.alg-lock-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.alg-button {
    appearance: none;
    border: 0;
    border-radius: calc(var(--alg-radius) / 2);
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease;
}

.alg-button:hover { transform: translateY(-1px); }
.alg-button:disabled { opacity: .55; cursor: wait; transform: none; }

.alg-button-primary {
    background: var(--alg-primary);
    color: #fff;
}

.alg-button-secondary {
    background: var(--alg-secondary);
    color: var(--alg-text);
}

.alg-full { width: 100%; }

.alg-modal[hidden] { display: none !important; }
.alg-modal {
    --alg-primary: #0f172a;
    --alg-secondary: #eef2f7;
    --alg-card: #fff;
    --alg-text: #0f172a;
    --alg-radius: 16px;
    --alg-modal-width: 460px;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 18px;
}

.alg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: #020617;
    opacity: .68;
    backdrop-filter: blur(3px);
}

.alg-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(100%, var(--alg-modal-width));
    max-height: calc(100vh - 36px);
    overflow: auto;
    border-radius: var(--alg-radius);
    background: var(--alg-card);
    color: var(--alg-text);
    padding: 26px;
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
}

.alg-modal-close {
    position: absolute;
    right: 14px;
    top: 10px;
    border: 0;
    background: transparent;
    color: var(--alg-text);
    opacity: .7;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.alg-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    margin: 0 34px 24px 0;
    border-radius: calc(var(--alg-radius) * .65);
    background: var(--alg-secondary);
}

.alg-tabs-single { grid-template-columns: 1fr; }

.alg-tab {
    border: 0;
    border-radius: calc(var(--alg-radius) * .45);
    padding: 10px 12px;
    background: transparent;
    color: var(--alg-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.alg-tab.is-active {
    background: var(--alg-card);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

.alg-panel label {
    display: block;
    margin: 0 0 14px;
    color: var(--alg-text);
    font-weight: 600;
}

.alg-panel input[type="text"],
.alg-panel input[type="email"],
.alg-panel input[type="password"] {
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 13px;
    border: 1px solid #cbd5e1;
    border-radius: calc(var(--alg-radius) / 2);
    background: var(--alg-card);
    color: var(--alg-text);
    font: inherit;
}

.alg-panel input:focus {
    outline: 2px solid #94a3b8;
    outline-offset: 1px;
}

.alg-remember {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
}

.alg-form-message {
    min-height: 22px;
    margin-top: 12px;
    font-size: 14px;
}

.alg-form-message.is-error { color: #b91c1c; }
.alg-form-message.is-success { color: #166534; }
.alg-privacy { font-size: 13px; opacity: .72; }
.alg-honeypot { position: absolute !important; left: -99999px !important; opacity: 0 !important; }

body.alg-modal-open { overflow: hidden; }

@media (max-width: 540px) {
    .alg-lock-card { padding: 24px 18px; }
    .alg-lock-actions { display: grid; }
    .alg-lock-actions .alg-button { width: 100%; }
    .alg-modal-dialog { padding: 22px 18px; }
    .alg-tabs { margin-right: 34px; }
}

.alg-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px 0 16px;
}

.alg-auth-row .alg-remember {
    margin: 0;
}

.alg-link-button,
.alg-back-login {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--alg-primary);
    padding: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.alg-link-button:hover,
.alg-back-login:hover {
    text-decoration: underline;
}

.alg-back-login {
    display: block;
    margin: 16px auto 0;
}

.alg-google-area {
    margin: 4px 0 18px;
}

.alg-google-button {
    min-height: 44px;
    display: flex;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.alg-auth-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: var(--alg-text);
    opacity: .58;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.alg-auth-separator::before,
.alg-auth-separator::after {
    content: '';
    height: 1px;
    flex: 1;
    background: currentColor;
    opacity: .28;
}

@media (max-width: 420px) {
    .alg-auth-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}
