/* Custom Plan static parity CSS.
   Scoped to /custom-plan because this file is only included by the Custom Plan layout. */

:root {
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-dim: #475569;
    --text-mute: #64748b;
    --primary: #2563eb;
    --primary-600: #1d4ed8;
    --primary-700: #1e40af;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --teal: #14b8a6;
    --teal-50: #ecfdf5;
    --violet: #7c3aed;
    --violet-50: #f5f3ff;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ba1a1a;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-full: 999px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, .05), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 6px 18px rgba(15, 23, 42, .06), 0 2px 6px rgba(15, 23, 42, .04);
    --shadow-glow: 0 12px 30px -10px rgba(37, 99, 235, .35);
    --container: 1240px;
    --gutter: clamp(20px, 4vw, 40px);
    --font: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

body.website-shell {
    color: var(--text);
    background: var(--bg);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
}

html[dir="rtl"] body.website-shell {
    font-family: "Tajawal", "Cairo", var(--font);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.website-main {
    background: var(--bg);
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--text);
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.15;
}

p {
    margin: 0;
    color: var(--text-dim);
}

.lead {
    font-size: clamp(16px, 1.3vw, 19px);
    color: var(--text-dim);
    line-height: 1.6;
}

.section {
    padding: clamp(64px, 8vw, 110px) 0;
}

.btn {
    --btn-bg: var(--primary);
    --btn-fg: #fff;
    --btn-bd: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: auto;
    padding: 12px 20px;
    border-radius: var(--r-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bd);
    font-weight: 550;
    font-size: 14.5px;
    letter-spacing: -.005em;
    box-shadow: var(--shadow-xs);
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn.ghost {
    --btn-bg: #fff;
    --btn-fg: var(--text);
    --btn-bd: var(--border);
}

.btn.link {
    --btn-bg: transparent;
    --btn-fg: var(--primary);
    --btn-bd: transparent;
    padding-inline: 4px;
    box-shadow: none;
}

.btn.sm {
    padding: 8px 14px;
    font-size: 13.5px;
}

.btn.block {
    width: 100%;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-xs);
}

.card.flat {
    box-shadow: none;
}

.grid {
    display: grid;
    gap: 18px;
}

/* These duplicate site.css's .grid.cols-* but load after it, so they win. Keep them in sync with
   site.css and use minmax(0, 1fr): a bare 1fr track has min-width:auto, so a wide child (plan card,
   code sample) forces the track past the viewport and scrolls the whole page sideways. */
.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.row-gap {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.muted {
    color: var(--text-mute);
}

.hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 40px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 550;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.badge.primary {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: #dbeafe;
}

.badge.violet {
    background: var(--violet-50);
    color: #6d28d9;
    border-color: #ddd6fe;
}

.badge.slate {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.crumbs {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    color: var(--text-mute);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.crumbs a {
    color: var(--text-mute);
}

.crumbs .sep {
    opacity: .5;
}

.crumbs .cur {
    color: var(--text);
    font-weight: 500;
}

.req-section {
    padding: 32px 0;
}

.req-section [hidden] {
    display: none !important;
}

.req-heading {
    margin-top: 10px;
    font-size: clamp(28px, 3vw, 40px);
}

.req-helper {
    margin-top: 8px;
    max-width: 720px;
}

.req-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
    margin-top: 24px;
}

.main-card,
.summary-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.req-layout > *,
.main-card,
.summary-card,
.builder-form {
    min-width: 0;
}

.main-card {
    padding: clamp(24px, 3vw, 36px);
    overflow-wrap: anywhere;
}

.limit-facts,
.limit-pricing-facts {
    display: grid;
    gap: 4px;
    color: var(--text-dim);
    font-size: 0.86rem;
}

.limit-pricing-facts .over {
    color: var(--text-dim);
    font-weight: 650;
}

.limit-pricing-facts .over.on {
    color: var(--primary-700);
}

.summary-card {
    padding: 24px;
    position: sticky;
    top: 92px;
}

.stepper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-xs);
    gap: 2px;
    margin-top: 28px;
    margin-bottom: 0;
    list-style: none;
}

.builder-progress-head {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    color: var(--text-mute);
    font-size: 13px;
    font-weight: 650;
}

.stepper .s-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: default;
    transition: background .15s ease;
    flex: none;
    color: inherit;
    user-select: none;
}

.stepper .s-step .n {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--text-mute);
    font-size: 13px;
    font-weight: 650;
    border: 1.5px solid var(--border);
    flex: none;
}

.stepper .s-step .lbl {
    font-size: 13.5px;
    color: var(--text-mute);
    font-weight: 550;
    white-space: nowrap;
    letter-spacing: -.005em;
}

.stepper .s-step.active {
    background: linear-gradient(180deg, var(--primary-50) 0%, #fff 100%);
}

.stepper .s-step.active .n {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .16);
}

.stepper .s-step.active .lbl {
    color: var(--primary-700);
    font-weight: 600;
}

.stepper .s-step.done .n {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.stepper .s-step.done .lbl {
    color: var(--text);
}

.stepper .s-line {
    flex: 1;
    min-width: 18px;
    height: 2px;
    background: var(--border);
    border-radius: var(--r-full);
    margin: 0 4px;
}

.stepper .s-step.done + .s-line {
    background: var(--success);
}

.plan-card {
    padding: 22px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    text-align: start;
    width: 100%;
    font: inherit;
    /* A grid item defaults to min-width:auto, i.e. its min-content width. A long plan name therefore
       pushes the card past its minmax(0, 1fr) track and scrolls the whole page sideways. */
    min-width: 0;
    /* Inherited by every descendant, so a plan name or code with no space still breaks instead of
       overflowing. Normal text keeps wrapping at spaces because this only applies to words that cannot
       otherwise fit. */
    overflow-wrap: break-word;
}

/* Each nested flex/grid container needs its own min-width:0 for the same reason as the card: the
   default min-content floor would otherwise be re-established one level down. */
.plan-card__top,
.plan-card__body,
.plan-card__limits,
.plan-card__action {
    min-width: 0;
}

/* The badge falls back to the plan name when a plan has no badge text, so it must be allowed to wrap
   and must never exceed the card's content box. */
.plan-card .badge {
    min-width: 0;
    max-width: 100%;
}

.plan-card:hover {
    border-color: var(--border-strong);
}

.plan-card.selected {
    border-color: var(--primary);
    background: linear-gradient(180deg, #fff 0%, var(--primary-50) 100%);
    box-shadow: 0 12px 30px -10px rgba(37, 99, 235, .25);
}

.plan-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plan-card__top {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 28px;
}

.plan-card__hint,
.plan-card__meta {
    color: var(--text-mute);
    font-size: 13px;
    line-height: 1.45;
}

.plan-card__hint {
    max-width: 120px;
    text-align: end;
}

.plan-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.plan-card__name {
    color: var(--text);
    font-size: 17px;
    font-weight: 650;
    line-height: 1.25;
}

.plan-card__desc {
    color: var(--text-mute);
    font-size: 14px;
    line-height: 1.55;
}

.plan-card__meta {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.plan-card__limits {
    display: grid;
    gap: 4px;
    color: var(--text-dim);
    font-size: 12.5px;
    line-height: 1.4;
}

.plan-card__limits span {
    display: block;
}

.plan-card__action {
    margin-top: auto;
}

.plan-card .price,
.price {
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.plan-card .price small,
.price small {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mute);
    margin-inline-start: 4px;
}

.feature-toggle {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s;
    color: inherit;
    font: inherit;
    text-align: start;
    width: 100%;
}

.feature-toggle:hover {
    border-color: var(--border-strong);
}

.feature-toggle.checked {
    border-color: var(--primary);
    background: var(--primary-50);
}

.feature-toggle.available {
    cursor: pointer;
}

.feature-toggle.locked {
    cursor: default;
}

.feature-toggle.locked .ft-tag {
    background: #ecfdf5;
    color: #047857;
    border-color: #bbf7d0;
}

.feature-toggle.disabled,
.feature-toggle[aria-disabled="true"] {
    opacity: .64;
    cursor: not-allowed;
}

.feature-toggle .ic {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 10px;
    background: var(--primary-50);
    color: var(--primary-700);
    display: grid;
    place-items: center;
    border: 1px solid #dbeafe;
}

.feature-toggle.checked .ic {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.feature-toggle .grow {
    flex: 1;
    min-width: 0;
}

.feature-toggle .ttl,
.ttl {
    font-size: 14.5px;
    font-weight: 600;
}

.feature-toggle .desc {
    font-size: 13px;
    color: var(--text-mute);
    margin-top: 4px;
}

.feature-group-name {
    display: block;
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
}

.limit-group-card {
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: inherit;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 14px;
    padding: 18px;
    text-align: start;
    width: 100%;
}

.limit-group-card:hover,
.limit-group-card.selected {
    border-color: var(--primary);
}

.limit-group-card.selected {
    background: var(--primary-50);
}

.limit-group-card__check {
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: transparent;
    display: flex;
    flex: none;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.limit-group-card.selected .limit-group-card__check {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.limit-group-card .grow {
    min-width: 0;
}

.limit-group-card .desc,
.limit-group-card__count {
    color: var(--text-mute);
    display: block;
    font-size: 13px;
    margin-top: 7px;
}

.feature-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ft-price,
.ft-tag {
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.ft-price {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    font-family: var(--font-mono);
}

.ft-price.on {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.ft-tag {
    background: var(--bg-soft);
    color: var(--text-mute);
    border: 1px solid var(--border);
}

.limit-row {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    min-width: 0;
}

.limit-grid {
    gap: 14px;
}

.limit-row .row-between {
    margin-bottom: 14px;
    align-items: flex-start;
}

.limit-row__copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.limit-row__copy strong {
    font-size: 14.5px;
    font-weight: 600;
}

.limit-row__copy .muted,
.limit-row__copy small {
    font-size: 12.5px;
    line-height: 1.45;
}

.limit-row__copy small {
    color: var(--text-mute);
}

.limit-row__copy .muted {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.limit-row__value {
    align-items: flex-end;
    display: flex;
    flex: none;
    flex-direction: column;
    gap: 4px;
    text-align: end;
}

.limit-row .v {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-700);
    background: var(--primary-50);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    white-space: nowrap;
}

.limit-row .over {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-mute);
    display: inline-block;
}

.limit-row .over.on {
    color: var(--warning);
}

.limit-row__control {
    display: block;
    margin-top: auto;
    width: 100%;
}

.limit-row--toggle {
    color: inherit;
    cursor: pointer;
    display: block;
    font: inherit;
    text-align: start;
    width: 100%;
}

.limit-row--toggle:hover {
    border-color: var(--border-strong);
}

.limit-row--toggle.checked {
    background: var(--primary-50);
    border-color: var(--primary);
}

.limit-row--toggle .row-between {
    margin-bottom: 0;
    width: 100%;
}

.limit-toggle {
    align-items: center;
    align-self: flex-start;
    background: transparent;
    border: 0;
    color: var(--text-mute);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    gap: 10px;
    min-height: 44px;
    padding: 0;
}

.limit-toggle__track {
    background: var(--border-strong);
    border-radius: var(--r-full);
    display: inline-flex;
    padding: 3px;
    transition: background-color .18s ease;
    width: 42px;
}

.limit-toggle__thumb {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
    height: 18px;
    transition: transform .18s ease;
    width: 18px;
}

.limit-row--toggle.checked .limit-toggle__track {
    background: var(--primary);
}

.limit-row--toggle.checked .limit-toggle__thumb {
    transform: translateX(18px);
}

[dir="rtl"] .limit-row--toggle.checked .limit-toggle__thumb {
    transform: translateX(-18px);
}

.limit-number {
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    min-height: 44px;
    padding: 8px 10px;
    width: 100%;
}

.range {
    display: block;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: var(--r-full);
    outline: none;
}

.range::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, .5);
    cursor: pointer;
}

.range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, .5);
    cursor: pointer;
}

.range:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.sum-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
    padding: 8px 0;
}

.sum-row.head {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sum-row .lbl {
    color: var(--text-dim);
}

.sum-row .val {
    color: var(--text);
    font-weight: 550;
    text-align: end;
}

.sum-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.sum-total {
    background: linear-gradient(135deg, #0b1320, #1e3a8a);
    color: #fff;
    padding: 16px 18px;
    border-radius: 12px;
    margin-top: 14px;
}

.sum-total .row-between {
    color: rgba(255, 255, 255, .7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}

.sum-total .row-between span:last-child {
    color: #5eead4;
}

.sum-total .big {
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.sum-total .big small {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, .7);
    margin-inline-start: 4px;
}

.sum-total .strike {
    text-decoration: line-through;
    color: rgba(255, 255, 255, .5);
    font-size: 13px;
    margin-inline-end: 6px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label,
.field > span {
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
}

.field .hint {
    font-size: 12.5px;
    color: var(--text-mute);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14.5px;
}

.duration-note {
    justify-content: center;
    min-height: 112px;
}

.duration-note strong {
    color: var(--text);
    display: block;
    font-size: 19px;
    font-weight: 650;
    margin-top: 6px;
}

.duration-note p {
    margin-top: 8px;
}

.check {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.check input {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    flex: none;
    margin-top: 2px;
    position: relative;
}

.check input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.check input:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.upload {
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    background: var(--bg-soft);
    cursor: pointer;
}

.upload:hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.upload .ic {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
    border: 1px solid var(--border);
}

.review-card,
.auth-required,
.auth-ready {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.final-review,
.submit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 18px;
}

.review-kicker,
.auth-required span,
.auth-ready span {
    display: block;
    color: var(--text-mute);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}

.auth-required {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 18px;
    background: #fffbeb;
    border-color: #fde68a;
}

.auth-ready {
    margin-top: 18px;
    background: var(--teal-50);
    border-color: #ccfbf1;
}

.auth-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.req-actions {
    margin-top: 32px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.builder-step-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    margin-top: 22px;
    padding: 12px 14px;
}

.pricing-context-card {
    display: grid;
    gap: 13px;
}

.pricing-context-card > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.discount-controls {
    align-items: flex-end;
    display: flex;
    gap: 10px;
}

.discount-controls .grow {
    flex: 1;
}

.discount-result {
    color: var(--text-dim);
    min-height: 22px;
}

.review-price-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 12px;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
}

.builder-step[hidden] {
    display: none !important;
}

.builder-empty {
    text-align: center;
}

.builder-help-card {
    align-items: flex-start;
    background: var(--bg-soft);
}

.builder-help-card > svg {
    color: var(--primary);
    flex: none;
}

/* `asp-validation-summary` never leaves the element truly empty: with no errors it still renders
   `<ul><li style="display:none"></li></ul>`, so `:empty` alone never matched and every clean page load
   showed an empty red error box. ASP.NET Core marks the no-error state with `validation-summary-valid`,
   which is the state to hide on. `:empty` is kept for summaries rendered without the tag helper. */
.builder-validation:empty,
.builder-validation.validation-summary-valid {
    display: none;
}

.builder-validation:not(:empty) {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
}

.plan-card:focus-visible,
.feature-toggle:focus-visible,
.limit-group-card:focus-visible,
.limit-row--toggle:focus-visible,
.range:focus-visible,
.limit-toggle:focus-visible,
.limit-number:focus-visible {
    outline: 3px solid #bfdbfe;
    outline-offset: 3px;
}

.stepper .s-step {
    border: 0;
    font: inherit;
}

.summary-head {
    margin-bottom: 14px;
    font-size: 15px;
}

.summary-note {
    font-size: 12px;
}

.plan-grid {
    gap: 14px;
}

.feature-grid {
    gap: 12px;
}

.review-grid {
    gap: 14px;
}

.final-banner {
    padding: 22px;
    background: linear-gradient(135deg, #fff, var(--primary-50));
    border-color: var(--primary-100);
}

.final-banner h3 {
    margin-top: 10px;
    font-size: 20px;
}

.final-banner p {
    margin-top: 6px;
}

.modal-back {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
}

.modal-back.open {
    display: flex;
}

.modal-back .modal {
    width: 92%;
    max-width: 480px;
    padding: 32px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .4);
}

.modal-back .modal h3 {
    margin-top: 16px;
    font-size: 22px;
}

.modal-back .modal p {
    margin-top: 8px;
}

.modal-back .ic-large {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    color: var(--primary-700);
    background: var(--primary-50);
    border-radius: 14px;
}

.modal-back .auth-actions {
    margin-top: 24px;
}

.modal-back .auth-actions .btn {
    flex: 1;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4 {
    letter-spacing: 0;
}

[dir="rtl"] .crumbs .sep,
[dir="rtl"] .arr {
    display: inline-block;
    transform: scaleX(-1);
}

[dir="rtl"] .sum-row .val {
    text-align: left;
}

[dir="rtl"] .check input:checked::after {
    left: auto;
    right: 5px;
}

[dir="rtl"] .profile-meta {
    text-align: right;
}

@media (max-width: 1024px) {
    .req-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .summary-card {
        position: static;
    }
}

@media (max-width: 900px) {
    .stepper {
        gap: 4px;
        padding: 10px;
    }

    .stepper .s-line {
        display: none;
    }

    .stepper .s-step {
        flex: 1 1 calc(33.333% - 8px);
        min-width: 0;
        padding: 8px 10px;
    }

    .stepper .s-step .lbl {
        font-size: 12.5px;
    }

    /* Must out-specify the base `.grid.cols-3` (0,2,0) or the 3-column track set survives here. */
    .grid.cols-3.plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .stepper .s-step {
        flex: 1 1 calc(50% - 8px);
    }

    .stepper .s-step .lbl {
        white-space: normal;
        line-height: 1.2;
    }

    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-3.plan-grid,
    .plan-grid,
    .final-review,
    .submit-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .row-between.req-actions,
    .req-actions .row-gap,
    .auth-required,
    .discount-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .req-actions .btn,
    .auth-actions .btn {
        width: 100%;
    }
}

/* Company logo: local preview only. The image is a blob URL created in the browser and revoked on
   replacement or navigation; nothing is uploaded until the form itself is submitted. */
/* An author `display` rule beats the user-agent `[hidden] { display: none }` rule, so the hidden
   attribute must be honoured explicitly or the empty preview would always show. */
.company-logo-preview[hidden] {
    display: none;
}

.company-logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-soft);
}

.company-logo-preview img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: var(--r-sm);
    background: var(--card);
    border: 1px solid var(--border);
    flex: none;
}

/* Standard Plan confirmation: the duration choices, the plan contents, and the administrator notice. */
/* 240px rather than 200px: the form column is ~678px wide on a desktop layout, where a 200px track
   fitted three cards and orphaned the fourth on its own row. A 240px floor lands a clean two-by-two
   grid there, and still widens to three or four tracks when the container has room. */
.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.term-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
}

.term-card {
    position: relative;
    display: block;
    padding: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    background: var(--card);
    cursor: pointer;
}

.term-card:hover {
    border-color: var(--border-strong);
}

.term-card:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.term-card:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.term-card input {
    position: absolute;
    inset-inline-start: 12px;
    inset-block-start: 12px;
    margin: 0;
}

.term-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-inline-start: 26px;
}

/* "Semiannual" is one word with no break opportunity a reader would accept; left to wrap it split as
   "Semiannu / al". The term name and its month count each stay on one line, and the head is allowed to
   wrap as a whole if a narrow viewport cannot fit both. */
.term-card__name {
    font-weight: 650;
    font-size: 15px;
    white-space: nowrap;
}

.term-card__head {
    flex-wrap: wrap;
}

.term-card__head .muted,
.term-card__meta s {
    white-space: nowrap;
}

.term-card__total {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 700;
}

.term-card__total small {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mute);
    margin-inline-start: 4px;
}

/* The struck original total and the "works out to X per month" line are two separate facts. Left in
   inline flow they ran together and broke mid-sentence inside a card, so each one gets its own line. */
.term-card__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-mute);
}

.term-card__saving {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-50);
    color: var(--primary-700);
}

.plan-contents {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.plan-contents ul {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.plan-contents li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.plan-contents li:last-child {
    border-bottom: 0;
}

.admin-notice ul {
    margin: 10px 0 0;
    padding-inline-start: 20px;
    color: var(--text-mute);
    font-size: 13.5px;
}

.admin-notice ul li {
    margin-top: 6px;
}

.admin-notice__account {
    display: block;
    margin-top: 6px;
    font-weight: 650;
    font-size: 15px;
    word-break: break-all;
}

/* `.visually-hidden` is defined once for the whole public website in
   assets/site/css/custom/site.css, which every website page loads. It used to live here, but the
   Pricing page does not load this builder stylesheet, so its screen-reader label rendered as visible
   text. Keep the utility in the base bundle so every view that uses it behaves the same. */
