:root {
    --rpms-primary: #b91c1c;
    --rpms-primary-hover: #991b1b;
    --rpms-text: #111827;
    --rpms-text-muted: #6b7280;
    --rpms-border: #e5e7eb;
    --rpms-card-bg: #ffffff;
    --rpms-page-bg: #f3f4f6;
    --rpms-danger: #b91c1c;
    --rpms-radius: 10px;
    --rpms-auth-shadow:
        0 20px 45px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background-color: var(--rpms-page-bg);
    color: var(--rpms-text);
}

button,
input {
    font: inherit;
}

.rpms-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    position: relative;
    isolation: isolate;
    background-color: var(--rpms-page-bg);
}

.rpms-auth-page.has-background {
    background-image: var(--rpms-auth-background);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.rpms-auth-page.has-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(17, 24, 39, 0.55);
}

.rpms-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px;
    border: 1px solid var(--rpms-border);
    border-radius: var(--rpms-radius);
    background: var(--rpms-card-bg);
    box-shadow: var(--rpms-auth-shadow);
}

.rpms-auth-brand {
    margin-bottom: 30px;
    text-align: center;
}

.rpms-auth-brand h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
}

.rpms-auth-heading {
    margin: 0 0 24px;
    font-size: 20px;
    line-height: 1.3;
}

.rpms-auth-alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.5;
}

.rpms-auth-field {
    margin-bottom: 20px;
}

.rpms-auth-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.rpms-auth-field input {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: var(--rpms-text);
    outline: none;
}

.rpms-auth-field input:focus {
    border-color: var(--rpms-primary);
    box-shadow:
        0 0 0 3px rgba(185, 28, 28, 0.12);
}

.rpms-auth-button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    background: var(--rpms-primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
}

.rpms-auth-button:hover {
    background: var(--rpms-primary-hover);
}

.rpms-auth-button:focus-visible {
    outline: 3px solid rgba(185, 28, 28, 0.25);
    outline-offset: 2px;
}

@media (max-width: 520px) {
    .rpms-auth-page {
        padding: 20px 14px;
    }

    .rpms-auth-card {
        padding: 28px 22px;
    }

    .rpms-auth-brand h1 {
        font-size: 21px;
    }
}

.rpms-auth-intro {
    margin-bottom: 24px;
}

.rpms-auth-intro .rpms-auth-heading {
    margin-bottom: 8px;
}

.rpms-auth-description {
    margin: 0;
    color: var(--rpms-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.rpms-auth-field-help {
    margin: 7px 0 0;
    color: var(--rpms-text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.rpms-auth-field .rpms-auth-code-input {
    min-height: 56px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-align: center;
}

.rpms-auth-code-input::placeholder {
    color: #d1d5db;
}

.rpms-auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0;
    color: var(--rpms-text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.rpms-auth-divider::before,
.rpms-auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--rpms-border);
}

.rpms-auth-recovery h3 {
    margin: 0 0 7px;
    font-size: 16px;
    line-height: 1.4;
}

.rpms-auth-recovery > p {
    margin: 0 0 18px;
    color: var(--rpms-text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.rpms-auth-button-secondary {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: var(--rpms-text);
}

.rpms-auth-button-secondary:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.rpms-auth-button-secondary:focus-visible {
    outline: 3px solid rgba(107, 114, 128, 0.2);
    outline-offset: 2px;
}
