/* PiglinHost "Build your server" page. Uses tokens from modern.css (--ph-*). */

/* Screen-reader-only text (Bootstrap's .visually-hidden is not in the purged CSS) */
.sb-sr { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
/* Icon not present in main.purged.css */
.fa-screwdriver-wrench::before { content: "\f7d9"; }

.sb-hero { padding: 140px 0 110px; }
.sb-hero h1 { margin-bottom: .75rem; }
.sb-hero .lead { max-width: 40rem; margin: 0; }
.sb-crumbs { font-size: .88rem; margin-bottom: 1rem; color: rgba(255, 255, 255, .85); }
.sb-crumbs a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.sb-main { margin-top: -70px; position: relative; z-index: 2; padding-bottom: 80px; }
.sb-noscript { background: #fff; border-radius: var(--ph-radius); padding: 1.5rem; box-shadow: var(--ph-shadow); }
.sb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.75rem; align-items: start; }

/* Steps */
.sb-steps { display: grid; gap: 1.25rem; margin: 0; }
.sb-step { background: #fff; border: 1px solid var(--ph-line); border-radius: 20px; padding: 1.5rem; box-shadow: var(--ph-shadow); min-width: 0; margin: 0; }
.sb-step legend { float: left; width: 100%; display: flex; align-items: center; gap: .7rem; font-size: 1.2rem; font-weight: 800; color: var(--ph-ink); margin: 0 0 1rem; padding: 0; letter-spacing: -.01em; }
.sb-step legend ~ * { clear: both; }
.sb-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--ph-blue); color: #fff; font-size: .95rem; font-weight: 800; flex: 0 0 32px; }
.sb-help { color: var(--ph-muted); font-size: .95rem; margin: 0 0 1rem; }
.sb-help--small { font-size: .88rem; margin: 1rem 0 0; }
.sb-help a { color: var(--ph-blue); text-decoration: underline; text-underline-offset: 2px; }
.sb-note { margin: 0; padding: 1rem 1.1rem; border-radius: 14px; background: var(--ph-soft); color: var(--ph-ink); font-size: .95rem; border: 1px solid var(--ph-line); }

.sb-grid { display: grid; gap: .75rem; }
.sb-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sb-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sb-grid--1 { grid-template-columns: 1fr; }

/* Option cards: real radio inputs, visually hidden but focusable */
.sb-option { position: relative; display: block; margin: 0; cursor: pointer; min-width: 0; }
.sb-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.sb-card {
    position: relative; display: flex; align-items: center; gap: .85rem; height: 100%; min-height: 64px;
    padding: .9rem 3.1rem .9rem 1rem; border: 2px solid var(--ph-line); border-radius: 16px; background: #fff;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.sb-option:hover .sb-card { border-color: #b9c8e4; }
.sb-input:checked + .sb-card { border-color: var(--ph-blue); background: linear-gradient(180deg, rgba(9, 72, 179, .05), rgba(9, 72, 179, .02)); box-shadow: 0 10px 24px -16px rgba(9, 72, 179, .6); }
.sb-input:focus-visible + .sb-card { outline: 3px solid var(--ph-orange-600, #e8662a); outline-offset: 2px; }
.sb-tick { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; border: 2px solid #b9c8e4; display: grid; place-items: center; color: transparent; font-size: .7rem; background: #fff; }
.sb-input:checked + .sb-card .sb-tick { background: var(--ph-blue); border-color: var(--ph-blue); color: #fff; }
.sb-card-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-card-text strong { color: var(--ph-ink); font-size: 1rem; font-weight: 750; line-height: 1.25; }
.sb-card-text small { color: var(--ph-muted); font-size: .84rem; line-height: 1.35; margin-top: .15rem; }

.sb-ed-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(9, 72, 179, .1); color: var(--ph-blue); font-size: 1.15rem; }
.sb-grid--3 .sb-card { flex-direction: column; align-items: flex-start; padding: 1.1rem 3.1rem 1.1rem 1rem; }
.sb-grid--3 .sb-tick { top: 1rem; transform: none; }

.sb-plan-img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 40px; image-rendering: pixelated; }
.sb-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; margin-left: auto; }
.sb-price b { font-size: 1.1rem; color: var(--ph-ink); font-variant-numeric: tabular-nums; }
.sb-price small { font-size: .74rem; color: var(--ph-muted); max-width: 9rem; }
.sb-flag { position: absolute; top: -11px; left: 14px; padding: .15rem .55rem; border-radius: 99px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; background: var(--ph-blue); color: #fff; }
.sb-flag--best { background: #167a41; }

.sb-code { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--ph-soft); color: var(--ph-ink); font-size: .74rem; font-weight: 800; letter-spacing: .04em; }
.sb-ping { display: flex; flex-direction: column; align-items: flex-end; text-align: right; margin-left: auto; white-space: nowrap; }
.sb-ping b { font-size: .98rem; font-variant-numeric: tabular-nums; }
.sb-ping small { font-size: .74rem; color: var(--ph-muted); }
.sb-good .sb-ping b { color: #167a41; }
.sb-ok .sb-ping b { color: #8a5d00; }
.sb-bad .sb-ping b { color: #b42318; }
.sb-best .sb-code { background: rgba(22, 122, 65, .12); color: #167a41; }

.sb-soft-badge { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(9, 72, 179, .1); color: var(--ph-blue); font-weight: 800; }

/* Currency */
.sb-currency { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 1rem; }
.sb-currency-label { font-size: .85rem; font-weight: 700; color: var(--ph-muted); margin-right: .25rem; }
.sb-currency label { margin: 0; cursor: pointer; }
.sb-currency input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sb-currency span { display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .8rem; border: 1.5px solid var(--ph-line); border-radius: 10px; font-size: .86rem; font-weight: 700; color: var(--ph-ink); background: #fff; }
.sb-currency input:checked + span { background: var(--ph-blue); border-color: var(--ph-blue); color: #fff; }
.sb-currency input:focus-visible + span { outline: 3px solid var(--ph-orange-600, #e8662a); outline-offset: 2px; }

/* Summary */
.sb-summary { position: sticky; top: 100px; }
.sb-summary-card { background: #fff; border: 1px solid var(--ph-line); border-radius: 20px; padding: 1.5rem; box-shadow: var(--ph-shadow-lg); }
.sb-summary-card h2 { font-size: 1.25rem; margin: 0 0 1rem; }
.sb-summary-card dl { margin: 0 0 1rem; }
.sb-summary-card dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--ph-line); font-size: .92rem; }
.sb-summary-card dt { color: var(--ph-muted); font-weight: 600; }
.sb-summary-card dd { margin: 0; color: var(--ph-ink); font-weight: 700; text-align: right; }
.sb-total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; margin: .5rem 0 1rem; }
.sb-total span { font-weight: 700; color: var(--ph-ink); }
.sb-total strong { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--ph-ink); font-variant-numeric: tabular-nums; }
.sb-total small { grid-column: 1 / -1; text-align: right; color: var(--ph-muted); font-size: .82rem; }
.sb-perks { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .5rem; font-size: .88rem; color: var(--ph-muted); }
.sb-perks i { width: 1.25rem; color: var(--ph-blue); margin-right: .35rem; }
.sb-fineprint { font-size: .78rem; color: var(--ph-muted); margin: 1rem 0 0; }

/* Mobile bar */
.sb-bar { display: none; }

@media (max-width: 1199.98px) {
    .sb-layout { grid-template-columns: minmax(0, 1fr) 320px; }
    .sb-grid--3 { grid-template-columns: 1fr; }
    .sb-grid--3 .sb-card { flex-direction: row; align-items: center; }
    .sb-grid--3 .sb-tick { top: 50%; transform: translateY(-50%); }
}
@media (max-width: 991.98px) {
    .sb-layout { grid-template-columns: 1fr; }
    .sb-summary { position: static; }
    .sb-grid--2 { grid-template-columns: 1fr; }
    .sb-bar {
        display: flex; align-items: center; justify-content: space-between; gap: .75rem;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
        border-top: 1px solid var(--ph-line); box-shadow: 0 -10px 30px -18px rgba(15, 31, 61, .5);
    }
    .sb-bar-info { display: flex; flex-direction: column; min-width: 0; }
    .sb-bar-plan { font-size: .78rem; color: var(--ph-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sb-bar-info strong { font-size: 1.2rem; color: var(--ph-ink); font-variant-numeric: tabular-nums; }
    .sb-bar-info small { color: var(--ph-muted); }
    .sb-bar .btn { min-height: 48px; display: inline-flex; align-items: center; white-space: nowrap; }
    .sb-has-bar { padding-bottom: 76px; }
    .sb-has-bar .scroll-top { bottom: 90px !important; }
}
@media (max-width: 575.98px) {
    .sb-hero { padding: 110px 0 90px; }
    .sb-main { margin-top: -60px; }
    .sb-step { padding: 1.1rem; border-radius: 16px; }
    .sb-step legend { font-size: 1.08rem; }
    .sb-card { min-height: 56px; padding: .8rem 2.9rem .8rem .85rem; gap: .7rem; }
    .sb-price small { max-width: 7rem; }
    .sb-currency span { min-height: 44px; }
    .sb-summary-card { padding: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    .sb-card, .sb-currency span { transition: none; }
}

/* Location flags (assets/img/flags) */
.sb-flag-img { flex: 0 0 28px; width: 28px; height: 21px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(15, 31, 61, .12); }

/* Steps and summary rows that don't apply to an edition (e.g. software for Bedrock) */
.sb-step[hidden], #sb-sum-software-row[hidden] { display: none !important; }

/* Version icons (badge colour set per version in server-builder.js) */
.sb-soft-badge i { color: #fff; font-size: 1rem; }
.sb-soft-badge--logo { background: #fff; border: 1px solid var(--ph-line, #e3e9f3); overflow: hidden; padding: 3px; }
.sb-soft-badge--logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }

/* Seasonal sale (set in SALES in assets/js/server-builder.js) */
.sb-sale-tag { position: absolute; top: -11px; right: 14px; padding: .15rem .55rem; border-radius: 99px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; background: #c74a12; color: #fff; }
.sb-card--sale { border-color: #f0b48f; }
.sb-was { font-size: .74rem; color: var(--ph-muted); }
.sb-sale-note { margin: 0 0 .75rem; padding: .6rem .75rem; border-radius: 10px; background: #fff3ea; border: 1px solid #f0b48f; color: #7a2c08; font-size: .85rem; font-weight: 600; line-height: 1.4; }
.sb-sale-note[hidden] { display: none; }
