:root {
    --rmli-ink: #241b14;
    --rmli-muted: #817263;
    --rmli-line: #eadfce;
    --rmli-card: rgba(255, 252, 248, 0.94);
    --rmli-gold: #b47b38;
    --rmli-gold-dark: #8f5d26;
    --rmli-success: #1f6f43;
    --rmli-info: #2f6f9f;
    --rmli-warning: #b7791f;
    --rmli-error: #b94747;
    --rmli-font: "Montserrat", Arial, sans-serif;
    --rmli-shadow: 0 28px 78px rgba(48, 34, 21, 0.16);
}

.rmli-page,
.rmli-page * {
    box-sizing: border-box;
}

.rmli-page {
    min-height: calc(100vh - 1px);
    background: #fffaf3;
    color: var(--rmli-ink);
    font-family: var(--rmli-font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    overflow: hidden;
}

.rmli-auth {
    position: relative;
    min-height: calc(100vh - 88px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(500px, 0.9fr);
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.rmli-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(90deg, rgba(255, 250, 243, 0.06) 0%, rgba(255, 250, 243, 0.08) 44%, rgba(255, 250, 243, 0.72) 61%, rgba(255, 250, 243, 0.97) 100%),
        url('../images/auth_ring.jpg');
    background-size: cover;
    background-position: left center;
    transform: scale(1.01);
}

.rmli-auth::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 22% 46%, transparent 0 25%, rgba(255, 250, 243, .09) 45%, rgba(255, 250, 243, .55) 100%),
        linear-gradient(180deg, rgba(255,255,255,.02), rgba(221,191,151,.12));
    pointer-events: none;
}

.rmli-shell {
    position: relative;
    z-index: 2;
    grid-column: 2;
    justify-self: center;
    width: min(760px, calc(100% - 70px));
    padding: 42px 0;
}

.rmli-card {
    width: 100%;
    padding: 50px 58px 46px;
    border-radius: 24px;
    background: var(--rmli-card);
    border: 1px solid rgba(234, 223, 206, .96);
    box-shadow: var(--rmli-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.rmli-head {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 22px;
    align-items: start;
    margin-bottom: 30px;
}

.rmli-logo {
    width: 58px;
    height: 58px;
    display: inline-flex;
    overflow: hidden;
    background: #050505;
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 10px 22px rgba(0,0,0,.12);
    text-decoration: none;
}

.rmli-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rmli-title {
    text-align: right;
    min-width: 0;
}

.rmli-title h1 {
    margin: 0;
    color: var(--rmli-ink);
    font-family: var(--rmli-font);
    font-size: clamp(42px, 4vw, 58px);
    line-height: .96;
    font-weight: 900;
    letter-spacing: -0.045em;
}

.rmli-title p {
    margin: 10px 0 10px;
    color: var(--rmli-muted);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.rmli-title strong {
    display: block;
    margin-bottom: 13px;
    color: #6f563d;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.rmli-title > span {
    position: relative;
    display: inline-block;
    width: 230px;
    max-width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, #dbc6ad 18%, #c79b65 50%, #dbc6ad 82%, transparent);
}

.rmli-title > span::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    border: 1px solid #c79b65;
    background: #fffaf3;
    transform: translate(-50%, -50%) rotate(45deg);
}

.rmli-field {
    margin-bottom: 22px;
}

.rmli-field label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.rmli-control {
    position: relative;
    min-height: 68px;
    display: flex;
    align-items: center;
    border-radius: 14px;
    background: rgba(255,255,255,.74);
    border: 1px solid var(--rmli-line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
    transition: border-color .24s ease, box-shadow .24s ease, background .24s ease;
}

.rmli-control:focus-within {
    background: #fff;
    border-color: rgba(180,123,56,.55);
    box-shadow: 0 0 0 4px rgba(180,123,56,.09), inset 0 1px 0 rgba(255,255,255,.92);
}

.rmli-icon {
    width: 48px;
    height: 48px;
    margin-left: 9px;
    border-radius: 12px;
    color: #8f6f46;
    background: #f7efe6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
}

.rmli-icon svg,
.rmli-eye svg,
.rmli-toast-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rmli-control input {
    width: 100%;
    min-width: 0;
    height: 66px;
    padding: 0 58px 0 18px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--rmli-ink);
    font-family: var(--rmli-font);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.rmli-control input::placeholder {
    color: #a09082;
    font-weight: 700;
}

.rmli-eye {
    position: absolute;
    right: 16px;
    top: 50%;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #77736f;
    transform: translateY(-50%);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rmli-eye:hover {
    color: var(--rmli-gold-dark);
    background: #f8f0e7;
}

.rmli-eye .rmli-eye-close,
.rmli-eye.rmli-showing .rmli-eye-open {
    display: none;
}

.rmli-eye.rmli-showing .rmli-eye-close {
    display: block;
}

.rmli-error {
    display: block;
    min-height: 17px;
    margin-top: 7px;
    color: #9a7c68;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: 0.015em;
}

.rmli-field.rmli-field-ok .rmli-control {
    border-color: rgba(31,111,67,.36);
    box-shadow: 0 0 0 3px rgba(31,111,67,.06);
}

.rmli-field.rmli-field-ok .rmli-icon {
    color: var(--rmli-success);
    background: #f0fbf3;
}

.rmli-field.rmli-field-error .rmli-control {
    border-color: rgba(185,71,71,.52);
    box-shadow: 0 0 0 3px rgba(185,71,71,.07);
}

.rmli-field.rmli-field-error .rmli-icon {
    color: var(--rmli-error);
    background: #fff0ef;
}

.rmli-field.rmli-field-error .rmli-error {
    color: var(--rmli-error);
}

.rmli-options {
    margin: 2px 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.rmli-check {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    cursor: pointer;
    color: #716253;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
    user-select: none;
}

.rmli-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rmli-check > span {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 8px;
    border: 1.5px solid #d9c8b3;
    background: #fffaf4;
    position: relative;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.rmli-check > span::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .2s ease;
}

.rmli-check input:checked + span {
    background: var(--rmli-gold);
    border-color: var(--rmli-gold);
    box-shadow: 0 0 0 4px rgba(180,123,56,.09);
}

.rmli-check input:checked + span::after {
    transform: rotate(45deg) scale(1);
}

.rmli-check b {
    font-weight: 800;
}

.rmli-forgot {
    color: var(--rmli-gold-dark);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.rmli-forgot:hover {
    text-decoration: underline;
}

.rmli-submit {
    width: 100%;
    min-height: 66px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #c28b48 0%, #a56c2f 100%);
    box-shadow: 0 18px 38px rgba(169,107,47,.28);
    font-family: var(--rmli-font);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease, opacity .22s ease;
}

.rmli-submit:hover {
    transform: translateY(-2px);
    filter: saturate(1.04);
    box-shadow: 0 22px 44px rgba(169,107,47,.34);
}

.rmli-submit:disabled {
    opacity: .72;
    cursor: not-allowed;
    transform: none;
}

.rmli-submit i {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.48);
    border-top-color: #fff;
    display: none;
    animation: rmliSpin .75s linear infinite;
}

.rmli-submit.rmli-loading i {
    display: inline-block;
}

.rmli-divider {
    position: relative;
    margin: 30px 0 22px;
    text-align: center;
    color: #938578;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rmli-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, #e1d3c1 15%, #e1d3c1 85%, transparent);
}

.rmli-divider span {
    position: relative;
    padding: 0 26px;
    background: rgba(255,252,248,.96);
}

.rmli-signup {
    margin: 0;
    text-align: center;
    color: #827466;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.rmli-signup a {
    color: var(--rmli-gold-dark);
    font-weight: 900;
    text-decoration: none;
}

.rmli-signup a:hover {
    text-decoration: underline;
}

.rmli-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;
}

.rmli-toast {
    pointer-events: auto;
    position: relative;
    min-height: 82px;
    display: grid;
    grid-template-columns: 54px 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(--rmli-line);
    box-shadow: 0 18px 42px rgba(47,35,24,.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: rmliToastIn .26s ease both;
    overflow: hidden;
}

.rmli-toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--rmli-info);
}

.rmli-toast-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--rmli-info);
    background: #eef7ff;
    border: 1px solid rgba(47,111,159,.18);
}

.rmli-toast-title {
    margin: 0 0 5px;
    color: var(--rmli-ink);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1.05;
}

.rmli-toast-message {
    margin: 0;
    color: #746555;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.005em;
}

.rmli-toast-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8c7b69;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.rmli-toast-success::before { background: var(--rmli-success); }
.rmli-toast-success .rmli-toast-icon { color: var(--rmli-success); background: #f0fbf3; border-color: rgba(31,111,67,.22); }
.rmli-toast-error::before { background: var(--rmli-error); }
.rmli-toast-error .rmli-toast-icon { color: var(--rmli-error); background: #fff2f1; border-color: rgba(185,71,71,.22); }
.rmli-toast-warning::before { background: var(--rmli-warning); }
.rmli-toast-warning .rmli-toast-icon { color: var(--rmli-warning); background: #fff7e8; border-color: rgba(183,121,31,.22); }
.rmli-toast-info::before { background: var(--rmli-info); }
.rmli-toast-info .rmli-toast-icon { color: var(--rmli-info); background: #eef7ff; border-color: rgba(47,111,159,.22); }

@keyframes rmliSpin {
    to { transform: rotate(360deg); }
}

@keyframes rmliToastIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1100px) {
    .rmli-auth {
        grid-template-columns: 1fr;
    }

    .rmli-bg {
        background-image:
            linear-gradient(180deg, rgba(255,250,243,.44) 0%, rgba(255,250,243,.86) 54%, rgba(255,250,243,.98) 100%),
            url('../images/auth_ring.jpg');
        background-position: center;
    }

    .rmli-shell {
        grid-column: 1;
        width: min(720px, calc(100% - 32px));
        padding: 54px 0;
    }
}

@media (max-width: 720px) {
    .rmli-auth {
        min-height: calc(100vh - 76px);
    }

    .rmli-shell {
        width: min(560px, calc(100% - 22px));
        padding: 38px 0;
    }

    .rmli-card {
        padding: 30px 20px 28px;
        border-radius: 20px;
    }

    .rmli-head {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rmli-title {
        text-align: left;
    }

    .rmli-title h1 {
        font-size: 40px;
    }

    .rmli-title p,
    .rmli-forgot,
    .rmli-check {
        font-size: 14px;
    }

    .rmli-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .rmli-control {
        min-height: 58px;
    }

    .rmli-control input {
        height: 56px;
        font-size: 15px;
    }

    .rmli-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .rmli-submit {
        min-height: 58px;
        font-size: 16px;
    }

    .rmli-signup {
        font-size: 15px;
    }

    .rmli-toast-wrap {
        left: 12px;
        right: 12px;
        bottom: 16px;
        width: auto;
    }
}

@media (max-width: 430px) {
    .rmli-title h1 {
        font-size: 34px;
    }

    .rmli-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    .rmli-control input {
        padding-left: 12px;
    }
}
