.rd-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99997;
    padding: 20px;
}
.rd-auth-overlay.is-open { display: flex; }

.rd-auth-dialog {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 28px 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.rd-auth-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #555;
}
.rd-auth-close:hover { background: #f3f3f3; color: #000; }

.rd-auth-back {
    background: transparent;
    border: 0;
    color: #1a5fb4;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    margin: 0 0 10px;
}
.rd-auth-back:hover { text-decoration: underline; }

.rd-auth-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1a1a1a;
}
.rd-auth-hint {
    color: #5a6b80;
    font-size: 13px;
    margin: 0 0 18px;
    line-height: 1.4;
}

.rd-auth-email-display {
    background: #f4f7fb;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    color: #5a6b80;
    margin-bottom: 14px;
    word-break: break-all;
}

.rd-auth-step { display: none; }
.rd-auth-overlay.is-step-email    .rd-auth-step--email    { display: block; }
.rd-auth-overlay.is-step-password .rd-auth-step--password { display: block; }
.rd-auth-overlay.is-step-register .rd-auth-step--register { display: block; }
.rd-auth-overlay.is-step-lostpass .rd-auth-step--lostpass { display: block; }

.rd-auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rd-auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rd-auth-field > span {
    color: #5a6b80;
    font-size: 12px;
    font-weight: 500;
}
.rd-auth-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d4d8df;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    color: #1a1a1a;
    box-sizing: border-box;
    transition: border-color .15s ease;
}
.rd-auth-field input:focus {
    border-color: #1a5fb4;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(26, 95, 180, .12);
}

.rd-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .rd-auth-row { grid-template-columns: 1fr; }
}

.rd-auth-link {
    color: #1a5fb4;
    font-size: 12px;
    text-decoration: none;
    align-self: flex-end;
}
.rd-auth-link:hover { text-decoration: underline; }

.rd-auth-agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #5a6b80;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
}
.rd-auth-agree input[type=checkbox] { margin-top: 2px; flex-shrink: 0; }

.rd-auth-status {
    font-size: 13px;
    line-height: 1.4;
    min-height: 0;
}
.rd-auth-status.is-error   { color: #d31700; padding: 4px 0; }
.rd-auth-status.is-success { color: #1a8a4e; padding: 4px 0; }
.rd-auth-status.is-error ul { list-style: disc; margin: 0; padding-left: 18px; }
.rd-auth-status.is-error li { margin: 2px 0; }

.rd-auth-submit {
    background: #1a5fb4;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.rd-auth-submit:hover:not(:disabled) { background: #154f93; }
.rd-auth-submit:disabled { background: #9ab5d6; cursor: progress; }

.rd-auth-trigger {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: inherit;
}
.rd-auth-trigger:hover { color: #1a5fb4; }
