:root {
    color-scheme: dark;
    --ri-bg: #050a13;
    --ri-card: #0d192b;
    --ri-card-soft: #11223a;
    --ri-border: rgba(132, 184, 235, 0.2);
    --ri-text: #f4f8ff;
    --ri-muted: #92a8c0;
    --ri-blue: #1aa8ff;
    --ri-cyan: #42ddff;
    --ri-danger: #ff7690;
    --ri-success: #78eea0;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: var(--ri-bg);
}

body {
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ri-text);
    overflow-x: hidden;
}

[hidden] {
    display: none !important;
}

button,
input {
    font: inherit;
}

.ri-page {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
    background:
        radial-gradient(circle at 15% 15%, rgba(24, 126, 255, 0.22), transparent 34%),
        radial-gradient(circle at 88% 84%, rgba(24, 215, 255, 0.13), transparent 31%),
        linear-gradient(145deg, #040913, #071422 58%, #06101c);
}

.ri-card {
    width: min(100%, 620px);
    padding: clamp(22px, 5vw, 36px);
    border: 1px solid var(--ri-border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(17, 34, 58, 0.97), rgba(9, 20, 36, 0.98));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ri-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: left;
}

.ri-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--ri-cyan), #0879dd);
    color: #03111e;
    font-size: 19px;
    font-weight: 950;
    letter-spacing: -1px;
    box-shadow: 0 12px 28px rgba(0, 157, 255, 0.26);
}

.ri-header h1 {
    margin: 0;
    font-size: clamp(26px, 5vw, 38px);
    line-height: 1.05;
    letter-spacing: -1px;
}

.ri-header p {
    margin: 7px 0 0;
    color: var(--ri-muted);
    font-size: 13px;
}

.ri-login {
    margin-top: 30px;
}

.ri-login label {
    display: block;
    margin-bottom: 9px;
    color: #d8e8f8;
    font-size: 13px;
    font-weight: 750;
}

.ri-password-row {
    position: relative;
}

.ri-password-row input {
    width: 100%;
    height: 54px;
    padding: 0 78px 0 15px;
    border: 1px solid var(--ri-border);
    border-radius: 13px;
    outline: none;
    background: #071426;
    color: #fff;
}

.ri-password-row input:focus {
    border-color: var(--ri-cyan);
    box-shadow: 0 0 0 3px rgba(66, 221, 255, 0.12);
}

.ri-password-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    height: 40px;
    min-width: 60px;
    border: 0;
    border-radius: 9px;
    background: #172a44;
    color: #cae1f8;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.ri-button {
    width: 100%;
    min-height: 50px;
    margin-top: 15px;
    border-radius: 13px;
    cursor: pointer;
    font-weight: 850;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.ri-button:disabled {
    cursor: wait;
    opacity: 0.68;
}

.ri-button:not(:disabled):active {
    transform: translateY(1px);
}

.ri-button-primary {
    border: 0;
    background: linear-gradient(180deg, #20bbff, #087fdc);
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 143, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.ri-button-primary:hover:not(:disabled) {
    filter: brightness(1.08);
}

.ri-button-secondary {
    border: 1px solid var(--ri-border);
    background: #172a44;
    color: #dcecff;
}

.ri-status-row {
    width: max-content;
    margin: 25px auto 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a9bdd2;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.ri-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ri-success);
    box-shadow: 0 0 0 5px rgba(120, 238, 160, 0.1), 0 0 18px rgba(120, 238, 160, 0.75);
}

.ri-result-box {
    margin-top: 16px;
    padding: 30px 18px;
    border: 1px solid rgba(66, 221, 255, 0.24);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 37%, rgba(18, 183, 255, 0.2), transparent 56%),
        linear-gradient(180deg, #132844, #0b1b30);
    text-align: center;
}

.ri-result-label {
    display: block;
    color: #a2b9d0;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.ri-final-result {
    display: block;
    margin-top: 9px;
    font-size: clamp(58px, 16vw, 92px);
    line-height: 0.96;
    letter-spacing: -5px;
    text-shadow: 0 0 34px rgba(66, 221, 255, 0.35);
}

.ri-phase {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ri-cyan);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.ri-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ri-grid article {
    min-height: 82px;
    padding: 15px;
    border: 1px solid var(--ri-border);
    border-radius: 14px;
    background: rgba(6, 18, 34, 0.7);
}

.ri-grid span {
    display: block;
    color: var(--ri-muted);
    font-size: 11px;
}

.ri-grid strong {
    display: block;
    margin-top: 9px;
    color: #fff;
    font-size: 18px;
}

.ri-message {
    min-height: 20px;
    margin: 11px 0 0;
    color: var(--ri-danger);
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
}

.ri-message.is-success {
    color: var(--ri-success);
}

.ri-notice {
    margin-top: 26px;
    padding: 15px 16px;
    border: 1px solid var(--ri-border);
    border-radius: 13px;
    background: rgba(7, 20, 38, 0.72);
    color: #c4d7ea;
    line-height: 1.55;
}

.ri-notice-error {
    border-color: rgba(255, 118, 144, 0.35);
    color: #ffd0d9;
}

@media (max-width: 520px) {
    .ri-page {
        align-items: start;
        padding: 14px 10px;
    }

    .ri-card {
        padding: 22px 15px;
        border-radius: 20px;
    }

    .ri-header {
        justify-content: flex-start;
    }

    .ri-grid {
        grid-template-columns: 1fr;
    }
}
