:root {
    --rm-auth-ink: #241b14;
    --rm-auth-muted: #76695d;
    --rm-auth-soft: #fffaf3;
    --rm-auth-card: rgba(255, 252, 248, 0.94);
    --rm-auth-line: #eadfce;
    --rm-auth-gold: #b47b38;
    --rm-auth-gold-dark: #8d5d25;
    --rm-auth-success: #1f6f43;
    --rm-auth-info: #2f6f9f;
    --rm-auth-warning: #b7791f;
    --rm-auth-error: #b94747;
    --rm-auth-body: "Montserrat", Arial, sans-serif;
    --rm-auth-shadow: 0 30px 90px rgba(48, 34, 21, 0.18);
}

.rmreg-page,
.rmreg-page *,
.rmreg-otp-modal,
.rmreg-otp-modal * {
    box-sizing: border-box;
}

.rmreg-page {
    min-height: calc(100vh - 88px);
    margin: 0;
    color: var(--rm-auth-ink);
    font-family: var(--rm-auth-body);
    background: #fffaf3;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rmreg-auth {
    position: relative;
    min-height: calc(100vh - 88px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(520px, 0.92fr);
    align-items: center;
    isolation: isolate;
    overflow: hidden;
}

.rmreg-auth-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(90deg, rgba(255, 250, 243, 0.04) 0%, rgba(255, 250, 243, 0.10) 42%, rgba(255, 250, 243, 0.70) 62%, rgba(255, 250, 243, 0.97) 100%),
        url('../images/auth_ring.jpg');
    background-size: cover;
    background-position: left center;
    transform: scale(1.01);
}

.rmreg-auth::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 22% 42%, transparent 0 24%, rgba(255, 250, 243, 0.08) 44%, rgba(255, 250, 243, 0.48) 100%),
        linear-gradient(180deg, rgba(255,255,255,.02), rgba(221, 191, 151, .13));
}

.rmreg-form-shell {
    grid-column: 2;
    width: min(760px, calc(100% - 76px));
    justify-self: center;
    padding: 44px 0;
}

.rmreg-card {
    width: 100%;
    padding: 34px 38px 32px;
    border: 1px solid rgba(234, 223, 206, .96);
    border-radius: 24px;
    background: var(--rm-auth-card);
    box-shadow: var(--rm-auth-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.rmreg-head {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    margin-bottom: 20px;
}

.rmreg-logo,
.rmreg-otp-logo {
    width: 62px;
    height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: #050505;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 12px 26px rgba(0,0,0,.14);
    text-decoration: none;
}

.rmreg-logo img,
.rmreg-otp-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.rmreg-title-block {
    text-align: right;
    min-width: 0;
}

.rmreg-eyebrow,
.rmreg-otp-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    margin: 0 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(180, 123, 56, .24);
    color: var(--rm-auth-gold-dark);
    background: rgba(255, 248, 238, .86);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.rmreg-title-block h1,
.rmreg-otp-box h2 {
    margin: 0;
    color: var(--rm-auth-ink);
    font-family: var(--rm-auth-body);
    font-size: clamp(38px, 4vw, 54px);
    line-height: .98;
    font-weight: 900;
    letter-spacing: -.045em;
}

.rmreg-title-block p,
.rmreg-otp-copy {
    margin: 10px 0 0;
    color: var(--rm-auth-muted);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 700;
}

.rmreg-title-block > span:last-child {
    display: inline-block;
    width: min(230px, 100%);
    height: 1px;
    margin-top: 14px;
    background: linear-gradient(to right, transparent, #dbc6ad 18%, #c79b65 50%, #dbc6ad 82%, transparent);
}

.rmreg-progress {
    display: grid;
    grid-template-columns: 36px 1fr 36px 1fr 36px;
    align-items: center;
    gap: 10px;
    margin: 4px 0 22px;
}

.rmreg-progress-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0d1bf;
    background: rgba(255,255,255,.72);
    color: #9b8b7c;
    font-size: 13px;
    font-weight: 900;
}

.rmreg-progress i {
    height: 1px;
    display: block;
    background: linear-gradient(to right, #e8d8c4, #c99b62, #e8d8c4);
}

.rmreg-progress-active,
.rmreg-progress-done {
    border-color: rgba(180, 123, 56, .46);
    color: #fff;
    background: linear-gradient(135deg, #c28b48 0%, #a56c2f 100%);
    box-shadow: 0 10px 24px rgba(169, 107, 47, .18);
}

.rmreg-step-title {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid rgba(234, 223, 206, .92);
    border-radius: 16px;
    background: rgba(255, 248, 238, .72);
}

.rmreg-step-title strong {
    display: block;
    color: var(--rm-auth-gold-dark);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.rmreg-step-title p {
    margin: 5px 0 0;
    color: var(--rm-auth-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.rmreg-field {
    margin: 0 0 13px;
}

.rmreg-field label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.rmreg-control {
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    border: 1px solid var(--rm-auth-line);
    border-radius: 15px;
    background: rgba(255,255,255,.75);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease, transform .22s ease;
}

.rmreg-control:focus-within {
    background: #fff;
    border-color: rgba(180, 123, 56, .58);
    box-shadow: 0 0 0 4px rgba(180, 123, 56, .10), inset 0 1px 0 rgba(255,255,255,.92);
}

.rmreg-control-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #9a744b;
    background: #f7efe6;
}

.rmreg-control-icon svg,
.rmreg-eye svg,
.rmreg-toast-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rmreg-control input {
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 0 18px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--rm-auth-ink);
    font-family: var(--rm-auth-body);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .01em;
}

.rmreg-control input::placeholder {
    color: #a89a8c;
    font-weight: 700;
}

.rmreg-count,
.rmreg-country {
    padding-right: 16px;
    white-space: nowrap;
    color: #8d765f;
    font-size: 12px;
    font-weight: 900;
}

.rmreg-phone input {
    padding-right: 8px;
}

.rmreg-hint,
.rmreg-error {
    display: block;
    min-height: 15px;
    margin-top: 5px;
    padding-left: 4px;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: .006em;
}

.rmreg-hint {
    color: #8f8173;
}

.rmreg-error {
    color: var(--rm-auth-error);
}

.rmreg-field-ok .rmreg-control {
    border-color: rgba(31, 111, 67, .38);
    box-shadow: 0 0 0 3px rgba(31, 111, 67, .07);
}

.rmreg-field-ok .rmreg-control-icon {
    color: var(--rm-auth-success);
    background: #edf8f1;
}

.rmreg-field-error .rmreg-control,
.rmreg-term-error label {
    border-color: rgba(185, 71, 71, .52);
    box-shadow: 0 0 0 3px rgba(185, 71, 71, .08);
}

.rmreg-field-error .rmreg-control-icon {
    color: var(--rm-auth-error);
    background: #fff0ef;
}

.rmreg-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: #817263;
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rmreg-eye:hover {
    color: var(--rm-auth-gold-dark);
    background: #f8f0e7;
}

.rmreg-eye .rmreg-eye-close,
.rmreg-eye.rmreg-showing .rmreg-eye-open {
    display: none;
}

.rmreg-eye.rmreg-showing .rmreg-eye-close {
    display: block;
}

.rmreg-rules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 4px 0 14px;
}

.rmreg-rule {
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 13px;
    border: 1px solid #e9ddcc;
    background: rgba(255,255,255,.56);
    color: #6f6255;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
}

.rmreg-rule-ok {
    color: var(--rm-auth-success);
    border-color: rgba(31,111,67,.30);
    background: #f0fbf3;
}

.rmreg-terms {
    margin: 2px 0 14px;
}

.rmreg-terms label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #7b6a59;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.rmreg-terms input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rmreg-terms label > span {
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dccdbc;
    border-radius: 7px;
    background: #fff;
}

.rmreg-terms label > span::after {
    content: "✓";
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    transform: scale(0);
    transition: transform .16s ease;
}

.rmreg-terms input:checked + span {
    border-color: var(--rm-auth-gold);
    background: linear-gradient(135deg, #c28b48 0%, #a56c2f 100%);
}

.rmreg-terms input:checked + span::after {
    transform: scale(1);
}

.rmreg-terms a,
.rmreg-signin a {
    color: var(--rm-auth-gold-dark);
    text-decoration: none;
}

.rmreg-terms a:hover,
.rmreg-signin a:hover {
    text-decoration: underline;
}

.rmreg-actions {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.rmreg-submit,
.rmreg-back,
.rmreg-resend {
    border: 0;
    font-family: var(--rm-auth-body);
    cursor: pointer;
}

.rmreg-submit {
    position: relative;
    width: 100%;
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, #c28b48 0%, #a56c2f 100%);
    box-shadow: 0 16px 32px rgba(169, 107, 47, .24);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.rmreg-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(169, 107, 47, .30);
}

.rmreg-submit:disabled,
.rmreg-back:disabled,
.rmreg-resend:disabled {
    cursor: not-allowed;
    opacity: .72;
}

.rmreg-submit i {
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.rmreg-submit.rmreg-loading i,
.rmreg-submit.rmreg-loading::after {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    transform: none;
    animation: rmregSpin .8s linear infinite;
}

.rmreg-submit.rmreg-loading i {
    border-right-color: rgba(255,255,255,.45);
}

.rmreg-back,
.rmreg-resend {
    min-height: 52px;
    border-radius: 14px;
    color: var(--rm-auth-gold-dark);
    background: rgba(255, 248, 238, .88);
    border: 1px solid rgba(180, 123, 56, .22);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.rmreg-divider {
    position: relative;
    margin: 22px 0 14px;
    text-align: center;
}

.rmreg-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5d8c8, transparent);
}

.rmreg-divider span {
    position: relative;
    z-index: 1;
    display: inline-flex;
    padding: 0 14px;
    color: #9a8a7a;
    background: rgba(255,250,243,.95);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .14em;
}

.rmreg-signin {
    margin: 0;
    color: #776858;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

.rmreg-otp-modal[hidden],
.rmreg-step-panel[hidden] {
    display: none !important;
}

.rmreg-otp-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    font-family: var(--rm-auth-body);
}

.rmreg-otp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 20, 14, .62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.rmreg-otp-box {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    padding: 34px 34px 30px;
    border-radius: 24px;
    border: 1px solid rgba(234, 223, 206, .98);
    background: rgba(255, 252, 248, .98);
    box-shadow: 0 30px 90px rgba(10, 8, 5, .28);
    text-align: center;
}

.rmreg-otp-logo {
    margin: 0 auto 18px;
}

.rmreg-otp-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    color: #7d6d5c;
    background: #f7efe6;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.rmreg-dev-otp {
    margin: 16px 0 0;
    padding: 11px 14px;
    border-radius: 14px;
    color: #815416;
    background: #fff1d8;
    border: 1px dashed rgba(180,123,56,.42);
    font-size: 13px;
    font-weight: 900;
}

.rmreg-otp-form {
    margin-top: 20px;
}

.rmreg-otp-digits {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
    margin: 0 0 8px;
}

.rmreg-otp-digit {
    width: 100%;
    height: 56px;
    border: 1px solid var(--rm-auth-line);
    border-radius: 14px;
    background: rgba(255,255,255,.86);
    color: var(--rm-auth-ink);
    font-family: var(--rm-auth-body);
    font-size: 24px;
    font-weight: 900;
    text-align: center;
    outline: 0;
}

.rmreg-otp-digit:focus {
    border-color: rgba(180,123,56,.58);
    box-shadow: 0 0 0 4px rgba(180, 123, 56, .10);
}

.rmreg-otp-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 12px 0 16px;
    color: #806f5d;
    font-size: 12px;
    font-weight: 800;
}

.rmreg-resend {
    width: 100%;
    margin-top: 10px;
}

.rmreg-toast-wrap {
    position: fixed;
    left: 38px;
    bottom: 34px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(420px, calc(100vw - 28px));
    pointer-events: none;
}

.rmreg-toast {
    pointer-events: auto;
    position: relative;
    min-height: 82px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 28px;
    gap: 14px;
    align-items: center;
    padding: 14px 14px 14px 16px;
    border-radius: 14px;
    background: rgba(255, 253, 249, .96);
    border: 1px solid var(--rm-auth-line);
    box-shadow: 0 18px 42px rgba(47, 35, 24, .14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: rmregToastIn .26s ease both;
    transition: opacity .18s ease, transform .18s ease;
    overflow: hidden;
}

.rmreg-toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--rm-auth-info);
}

.rmreg-toast-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--rm-auth-info);
    background: #eef7ff;
    border: 1px solid rgba(47, 111, 159, .18);
    overflow: hidden;
}

.rmreg-toast-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rmreg-toast-title {
    margin: 0 0 5px;
    color: var(--rm-auth-ink);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1.05;
    text-transform: none;
}

.rmreg-toast-message {
    margin: 0;
    color: #746555;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.005em;
}

.rmreg-toast-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8c7b69;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.rmreg-toast-close:hover {
    background: #f4eadc;
    color: #5b4632;
    transform: scale(1.04);
}

.rmreg-toast-success::before { background: var(--rm-auth-success); }
.rmreg-toast-success .rmreg-toast-icon { color: var(--rm-auth-success); background: #f0fbf3; border-color: rgba(31,111,67,.22); }

.rmreg-toast-error::before { background: var(--rm-auth-error); }
.rmreg-toast-error .rmreg-toast-icon { color: var(--rm-auth-error); background: #fff2f1; border-color: rgba(185,71,71,.22); }

.rmreg-toast-warning::before { background: var(--rm-auth-warning); }
.rmreg-toast-warning .rmreg-toast-icon { color: var(--rm-auth-warning); background: #fff7e8; border-color: rgba(183,121,31,.22); }

.rmreg-toast-info::before { background: var(--rm-auth-info); }
.rmreg-toast-info .rmreg-toast-icon { color: var(--rm-auth-info); background: #eef7ff; border-color: rgba(47,111,159,.22); }

@keyframes rmregToastIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rmregSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 992px) {
    .rmreg-auth {
        grid-template-columns: 1fr;
    }

    .rmreg-auth-bg {
        background-position: center;
    }

    .rmreg-auth::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: rgba(255, 250, 243, .78);
    }

    .rmreg-form-shell {
        grid-column: 1;
        width: min(620px, calc(100% - 34px));
    }
}

@media (max-width: 680px) {
    .rmreg-page,
    .rmreg-auth {
        min-height: calc(100vh - 76px);
    }

    .rmreg-form-shell {
        width: min(560px, calc(100% - 22px));
        padding: 34px 0 28px;
    }

    .rmreg-card {
        padding: 26px 18px 24px;
        border-radius: 20px;
    }

    .rmreg-head {
        grid-template-columns: 56px 1fr;
        gap: 14px;
    }

    .rmreg-logo {
        width: 52px;
        height: 52px;
        border-radius: 13px;
    }

    .rmreg-title-block h1,
    .rmreg-otp-box h2 {
        font-size: 34px;
    }

    .rmreg-title-block p,
    .rmreg-otp-copy {
        font-size: 13px;
    }

    .rmreg-control {
        min-height: 56px;
    }

    .rmreg-control input {
        height: 54px;
        font-size: 14px;
    }

    .rmreg-rules {
        grid-template-columns: 1fr;
    }

    .rmreg-actions {
        grid-template-columns: 1fr;
    }

    .rmreg-back {
        order: 2;
    }

    .rmreg-toast-wrap {
        left: 12px;
        right: 12px;
        bottom: 16px;
        width: auto;
    }

    .rmreg-toast {
        grid-template-columns: 50px minmax(0, 1fr) 34px;
        min-height: 70px;
        padding: 10px 12px 10px 10px;
    }

    .rmreg-toast-icon {
        width: 46px;
        height: 46px;
    }

    .rmreg-otp-box {
        padding: 28px 18px 24px;
    }

    .rmreg-otp-digits {
        gap: 6px;
    }

    .rmreg-otp-digit {
        height: 48px;
        border-radius: 12px;
        font-size: 20px;
    }
}

@media (max-width: 430px) {
    .rmreg-head {
        grid-template-columns: 1fr;
    }

    .rmreg-title-block {
        text-align: left;
    }

    .rmreg-progress {
        grid-template-columns: 32px 1fr 32px 1fr 32px;
        gap: 7px;
    }

    .rmreg-progress-dot {
        width: 32px;
        height: 32px;
    }

    .rmreg-control-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .rmreg-control input {
        padding-left: 12px;
        padding-right: 10px;
    }

    .rmreg-count,
    .rmreg-country {
        padding-right: 12px;
        font-size: 11px;
    }

    .rmreg-otp-meta {
        flex-direction: column;
        gap: 4px;
    }
}
