/* Redful public pages v4. Scoped to .rf-page to avoid changing the global shell. */
:root {
    --rf-red: #ef2d36;
    --rf-red-strong: #c91d26;
    --rf-green: #38d26b;
    --rf-amber: #f3b53f;
    --rf-page-text: #eef3f8;
    --rf-page-muted: #9aa6b5;
    --rf-page-panel: rgba(11, 17, 24, .88);
    --rf-page-panel-raised: rgba(19, 27, 37, .94);
    --rf-page-input-bg: rgba(0, 0, 0, .24);
    --rf-page-border: rgba(255, 255, 255, .11);
    --rf-page-focus: #75baff;
    --rf-page-shadow: 0 20px 55px rgba(0, 0, 0, .24);
}

.rf-page { color: var(--rf-page-text); }
.rf-page *, .rf-auth-page * { box-sizing: border-box; }
.rf-page a, .rf-auth-page a { text-underline-offset: .2em; }
.rf-page :where(a, button, input, select, textarea, summary):focus-visible,
.rf-auth-page :where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--rf-page-focus) !important;
    outline-offset: 3px;
}
.rf-page button, .rf-page .button, .rf-auth-page button, .rf-auth-page .button { min-height: 44px; }
.rf-page-heading { max-width: 760px; margin-bottom: clamp(24px, 4vw, 44px); }
.rf-page-heading h1 { max-width: 18ch; text-wrap: balance; }
.rf-page-heading p { max-width: 66ch; color: var(--rf-page-muted); }
.rf-breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; color: var(--rf-page-muted); font-size: .92rem; }
.rf-breadcrumbs a { color: inherit; }
.rf-breadcrumbs a:hover { color: #fff; }

.rf-catalog-tools {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: center;
    gap: 14px 20px;
    padding: 16px;
    margin-bottom: 22px;
    border: 1px solid var(--rf-page-border);
    border-radius: var(--rf-radius);
    background: var(--rf-page-panel);
    box-shadow: var(--rf-page-shadow);
}
.rf-search { position: relative; display: flex; align-items: center; min-width: 0; margin: 0; }
.rf-search > i { position: absolute; left: 15px; z-index: 1; color: var(--rf-page-muted); pointer-events: none; }
.rf-search input {
    width: 100%; min-height: 46px; padding: 0 42px !important;
    color: var(--rf-page-text) !important; background: var(--rf-page-input-bg) !important;
    border: 1px solid var(--rf-page-border) !important; border-radius: 12px !important;
}
.rf-search input::placeholder { color: #8e9aa8; opacity: 1; }
.rf-filter-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 !important; }
.rf-filter-list button {
    appearance: none; padding: 0 15px; border: 1px solid var(--rf-page-border); border-radius: 999px;
    color: #c8d0da; background: rgba(255, 255, 255, .04); cursor: pointer;
}
.rf-filter-list button:hover { color: #fff; border-color: rgba(255, 255, 255, .24); }
.rf-filter-list button.active, .rf-filter-list button[aria-pressed="true"] { color: #fff; border-color: var(--rf-red); background: rgba(239, 45, 54, .19); }
.rf-results-count { grid-column: 1 / -1; min-height: 1.2em; margin: 0; color: var(--rf-page-muted); font-size: .88rem; }

.rf-server-catalog { align-items: stretch; }
.rf-server-card { position: relative; overflow: clip; min-width: 0; border-color: var(--rf-page-border) !important; box-shadow: var(--rf-page-shadow); }
.rf-server-card[data-server-state="online"] { border-color: rgba(56, 210, 107, .28) !important; }
.rf-server-card[data-server-state="offline"] { --build-accent: #7a8490; }
.rf-server-card[data-server-state="unavailable"] { --build-accent: #c28b35; }
.rf-server-card h2 a { color: inherit; }
.rf-server-card h2 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.rf-server-card :where(.redful-server-card-actions a, .redful-server-card-image, details, button) { position: relative; z-index: 1; }
.status-unavailable { color: var(--rf-amber) !important; }
.offline { color: #aab3be !important; }
.online { color: var(--rf-green) !important; }
.rf-filter-empty { margin-top: 24px; }
.rf-empty-state {
    grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px;
    padding: clamp(28px, 6vw, 64px); text-align: center;
    color: var(--rf-page-muted); border: 1px dashed rgba(255, 255, 255, .17);
    border-radius: var(--rf-radius); background: rgba(255, 255, 255, .025);
}
.rf-empty-state > i { margin: 0 !important; color: var(--rf-red); font-size: 2rem; }
.rf-empty-state h2, .rf-empty-state h3, .rf-empty-state p { margin: 0; }
.rf-empty-state h2, .rf-empty-state h3 { color: #eef3f8; }

/* Server-rendered status is immediate; this hook is ready for future live refreshes. */
.rf-server-catalog[aria-busy="true"] .rf-server-card { pointer-events: none; }
.rf-server-catalog[aria-busy="true"] .rf-server-card-body > * {
    color: transparent !important; border-radius: 7px;
    background: linear-gradient(100deg, rgba(255,255,255,.05) 20%, rgba(255,255,255,.11) 40%, rgba(255,255,255,.05) 60%);
    background-size: 220% 100%; animation: rf-skeleton 1.25s ease-in-out infinite;
}
@keyframes rf-skeleton { to { background-position-x: -220%; } }

.rf-news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rf-news-card { min-width: 0; box-shadow: var(--rf-page-shadow); }
.rf-news-card .redful-news-cover { aspect-ratio: 16 / 9; overflow: hidden; }
.rf-news-card .redful-news-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.rf-news-card:hover .redful-news-cover img { transform: scale(1.035); }
.rf-news-card h3 { text-wrap: balance; }
.rf-news-card p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.rf-news-card.is-featured { grid-column: span 2; }
.rf-news-card.is-featured .redful-news-cover { aspect-ratio: 2 / 1; }

.rf-shop-panel, .rf-shop-categories, .rf-product-card, .redful-order-history { border-color: var(--rf-page-border) !important; box-shadow: var(--rf-page-shadow); }
.rf-shop-categories { position: sticky; top: 76px; z-index: 12; display: flex; gap: 8px; overflow-x: auto; padding: 10px !important; scrollbar-width: thin; background: rgba(10, 15, 22, .94) !important; backdrop-filter: blur(16px); }
.rf-shop-categories a { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; padding: 0 15px; border-radius: 10px; color: #c5cfdb; }
.rf-shop-categories a:hover, .rf-shop-categories a.is-active { color: #fff; background: rgba(239, 45, 54, .16); }
.rf-product-card { display: flex; flex-direction: column; overflow: clip; }
.rf-product-card .redful-product-body { display: flex; flex: 1; flex-direction: column; }
.rf-product-card .redful-product-buy, .rf-product-card .redful-product-body > .button { margin-top: auto; }
.redful-product-buy :where(input, select), .redful-promo-redeem :where(input, select) { min-height: 44px; }
.rf-case-disclosure { max-width: 70ch; margin: 8px 0 0; color: var(--rf-page-muted); }
[data-rf-submit-form].is-submitting { opacity: .78; pointer-events: none; }
[data-rf-submit-form] button[aria-busy="true"] i:not(.spinner) { display: none; }

.rf-copy-code {
    display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin-top: 16px; padding: 0 14px;
    border: 1px solid var(--rf-page-border); border-radius: 10px; color: #dce4ed; background: rgba(255,255,255,.05); cursor: pointer;
}
.rf-copy-code:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.09); }
.rf-kb-empty { margin-top: 16px; }

.rf-auth-page { width: min(100% - 32px, 760px); min-height: min(720px, calc(100vh - 140px)); display: grid; place-items: center; margin: 0 auto; padding: clamp(28px, 7vw, 70px) 0; color: #eef3f8; }
.rf-auth-card { width: min(100%, 520px); padding: clamp(22px, 5vw, 42px); border: 1px solid var(--rf-page-border); border-radius: 22px; background: var(--rf-page-panel); box-shadow: var(--rf-page-shadow); backdrop-filter: blur(18px); }
.rf-auth-card-wide { width: min(100%, 680px); }
.rf-auth-heading { margin-bottom: 26px; }
.rf-auth-heading h1 { margin: 5px 0 8px; color: #fff; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.05; text-wrap: balance; }
.rf-auth-heading p { margin: 0; color: var(--rf-page-muted); }
.rf-auth-form .field > label { color: #dce4ed !important; font-weight: 700; }
.rf-auth-form input, .rf-auth-form textarea, .rf-auth-form select {
    min-height: 48px !important; color: var(--rf-page-text) !important; background: var(--rf-page-input-bg) !important;
    border: 1px solid var(--rf-page-border) !important; border-radius: 11px !important;
}
.rf-auth-form textarea { min-height: 112px !important; padding-top: 13px !important; resize: vertical; }
.rf-password-field { position: relative; }
.rf-password-field input { width: 100%; padding-right: 52px !important; }
.rf-password-field button { position: absolute; top: 2px; right: 2px; width: 44px; border: 0; color: #aab6c3; background: transparent; cursor: pointer; }
.rf-auth-options, .rf-auth-actions, .rf-auth-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.rf-auth-options { margin: 8px 0 22px; }
.rf-auth-options label { color: #cbd4dd !important; }
.rf-auth-submit { min-height: 50px !important; }
.rf-auth-footer { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--rf-page-border); color: var(--rf-page-muted); }
.rf-oauth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rf-oauth-grid img { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.rf-choice-group { display: grid; gap: 8px; }
.rf-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rf-page-border); border-radius: 10px; cursor: pointer; }
.rf-choice input { width: 18px !important; min-height: 18px !important; }
.rf-terms { margin: 18px 0 !important; }

.redful-status-light.unavailable {
    background: var(--rf-amber);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--rf-amber) 14%, transparent);
}
.redful-status-state.unavailable {
    color: var(--rf-amber);
    background: color-mix(in srgb, var(--rf-amber) 10%, transparent);
}
.redful-status-state small { color: inherit; opacity: .76; font-size: .7rem; font-weight: 650; }

@media (max-width: 980px) {
    .rf-catalog-tools { grid-template-columns: 1fr; }
    .rf-results-count { grid-column: auto; }
    .rf-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rf-news-card.is-featured { grid-column: span 2; }
}
@media (max-width: 767px) {
    .rf-page { padding-inline: 16px !important; }
    .rf-catalog-tools { padding: 12px; }
    .rf-filter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rf-filter-list button:first-child { grid-column: 1 / -1; }
    .rf-news-grid { grid-template-columns: 1fr; }
    .rf-news-card.is-featured { grid-column: auto; }
    .rf-news-card.is-featured .redful-news-cover { aspect-ratio: 16 / 9; }
    .rf-shop-categories { top: 62px; margin-inline: -8px; border-radius: 12px !important; }
    .rf-auth-page { width: min(100% - 20px, 760px); padding-block: 20px; }
    .rf-auth-card { padding: 22px 16px; border-radius: 16px; }
    .rf-oauth-grid { grid-template-columns: 1fr; }
    .rf-auth-options, .rf-auth-actions, .rf-auth-footer { align-items: stretch; flex-direction: column; }
    .rf-auth-options > *, .rf-auth-actions > *, .rf-auth-footer > * { width: 100%; }
}
@media (max-width: 380px) {
    .rf-page { padding-inline: 10px !important; }
    .rf-filter-list { grid-template-columns: 1fr; }
    .rf-filter-list button:first-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .rf-page *, .rf-auth-page * { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
    .rf-page :where(.online, .offline, .status-unavailable) { forced-color-adjust: none; }
    .rf-filter-list button.active { outline: 2px solid ButtonText; }
}

/* RedFul: semantic hidden state wins over empty-state layout. */
[data-rf-filter-empty][hidden],
[data-rf-kb-empty][hidden] { display: none !important; }
