/* =========================================================================
 * Services checkout (AE)
 * ========================================================================= */

.svc-co {
    --co-ink: var(--brand-ink, #0F1F33);
    --co-ink-2: var(--brand-ink-2, #1A2C42);
    --co-accent: var(--brand-primary-bright, #5CB5E5);
    --co-accent-strong: var(--brand-primary-dark, #3D8AB8);
    /* --co-accent-strong is 3.8:1 against white — fine for a border or a filled tick,
       short of WCAG AA for text. This is the same hue two steps darker (5.6:1 on white,
       4.9:1 on the tint): use it wherever the accent IS the text, or carries white text. */
    --co-accent-deep: #2F6E93;
    /* Likewise --co-danger (#E53E3E) only reaches 3.9:1 on the card surface. */
    --co-danger-text: #C53030;
    --co-tint: var(--surface-blue-2, #E0F2FE);
    --co-line: var(--border-soft, #E2E8F0);
    --co-muted: var(--text-muted-3, #64748B);
    --co-surface: var(--surface-5, #F8FAFC);
    --co-danger: var(--brand-danger, #E53E3E);
    --co-radius: 16px;

    min-height: 60vh;
    padding-bottom: 80px;
    /* The page is white-only; say so, or iOS renders the native date and select
       popovers dark against white fields when the phone is in dark mode. */
    color-scheme: light;
    /* A long option label or service name must never widen the page. */
    overflow-x: clip;
    background: var(--co-surface);
    color: var(--text-strong-2, #1E293B);
    font-family: var(--font-primary, inherit);
}

.svc-co *,
.svc-co *::before,
.svc-co *::after {
    box-sizing: border-box;
}

.svc-co [hidden] {
    display: none !important;
}

.svc-co-wrap {
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 20px;
}

/* Header ----------------------------------------------------------------- */

.svc-co-head {
    margin-bottom: 32px;
    padding-block: 36px 40px;
    background:
        radial-gradient(700px 300px at 85% 0%, rgba(92, 181, 229, 0.25), transparent 60%),
        linear-gradient(160deg, var(--co-ink) 0%, var(--co-ink-2) 100%);
    color: #fff;
}

.svc-co-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.svc-co-back:hover {
    color: #fff;
}

.svc-co-back svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
}

.svc-co-title {
    margin: 0 0 20px;
    font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem);
    font-weight: 800;
    color: #fff;
}

.svc-co-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.55);
}

.svc-co-steps li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.svc-co-steps span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 800;
}

.svc-co-steps .is-done {
    color: rgba(255, 255, 255, 0.85);
}

.svc-co-steps .is-done span {
    border-color: var(--co-accent);
    background: rgba(92, 181, 229, 0.2);
    color: var(--co-accent);
}

.svc-co-steps .is-current {
    font-weight: 700;
    color: #fff;
}

.svc-co-steps .is-current span {
    border-color: var(--co-accent);
    background: var(--co-accent);
    color: var(--co-ink);
}

/* Notes and empty state -------------------------------------------------- */

.svc-co-preview {
    margin: 0 0 20px;
    padding: 12px 16px;
    border: 1px dashed var(--co-danger);
    border-radius: 12px;
    background: #fff;
    font-size: 0.9rem;
    color: var(--co-danger);
}

.svc-co-empty {
    max-width: 560px;
    margin: 40px auto;
    padding: 40px 28px;
    border: 1px solid var(--co-line);
    border-radius: var(--co-radius);
    background: #fff;
    text-align: center;
}

.svc-co-empty h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--co-ink);
}

.svc-co-empty p {
    margin: 0 0 22px;
    color: var(--co-muted);
    line-height: 1.8;
}

/* Layout ----------------------------------------------------------------- */

.svc-co-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
}

.svc-co-main {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.svc-co-card {
    padding: 24px;
    border: 1px solid var(--co-line);
    border-radius: var(--co-radius);
    background: #fff;
}

.svc-co-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 18px;
}

.svc-co-card-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--co-ink);
}

.svc-co-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--co-accent-deep);
    text-decoration: none;
}

.svc-co-link:hover {
    text-decoration: underline;
}

/* Items ------------------------------------------------------------------ */

.svc-co-items {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.svc-co-item {
    padding: 16px;
    border: 1px solid var(--co-line);
    border-radius: 12px;
    background: var(--co-surface);
}

.svc-co-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.svc-co-item-top h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--co-ink);
}

.svc-co-remove {
    /* A destructive control on a phone: keep it at a full finger target. */
    min-height: 44px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--co-danger-text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.svc-co-remove:hover {
    background: rgba(229, 62, 62, 0.08);
    color: var(--co-danger-text);
}

.svc-co-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.svc-co-tier {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 60px;
    padding: 10px 12px;
    border: 1.5px solid var(--co-line);
    border-radius: 10px;
    background: #fff;
    color: var(--co-ink);
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color var(--transition-fast, 0.15s ease), background-color var(--transition-fast, 0.15s ease);
}

.svc-co-tier:hover {
    border-color: var(--co-accent);
    background: #fff;
    color: var(--co-ink);
}

.svc-co-tier.is-on {
    border-color: var(--co-accent-strong);
    background: var(--co-tint);
    box-shadow: inset 0 0 0 1px var(--co-accent-strong);
}

.svc-co-tier-name {
    font-size: 0.9rem;
    font-weight: 700;
}

.svc-co-tier-price {
    font-size: 0.85rem;
    color: var(--co-muted);
}

.svc-co-tier.is-on .svc-co-tier-price {
    color: var(--co-accent-deep);
    font-weight: 700;
}

.svc-co-tier small {
    font-size: 0.75rem;
}

/* Suggested packages ------------------------------------------------------ */

.svc-co-recos-head {
    margin-bottom: 16px;
}

.svc-co-recos-head h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--co-ink);
}

.svc-co-recos-intro {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--co-muted);
}

.svc-co-recos-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* One suggestion per row: the reason gets the full width to read as a sentence,
   and three cards never leave an orphan in a half-empty grid track. */
.svc-co-reco {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    /* Room for the dismiss button pinned in the corner. */
    padding: 14px 16px;
    padding-inline-end: 50px;
    border: 1px solid var(--co-line);
    border-radius: 12px;
    background: var(--co-surface);
}

.svc-co-reco-main {
    display: grid;
    gap: 4px;
    flex: 1 1 260px;
    min-width: 0;
}

.svc-co-reco-anchor {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--co-accent-deep);
}

.svc-co-reco-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--co-ink);
}

.svc-co-reco-tier {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--co-tint);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--co-accent-deep);
}

.svc-co-reco-why {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--co-muted);
}

.svc-co-reco-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    flex: 0 1 auto;
}

.svc-co-reco-price {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--co-ink);
    white-space: nowrap;
}

.svc-co-reco-price small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--co-muted);
}

.svc-co-reco-add {
    min-height: 44px;
    padding: 8px 18px;
    border: 1.5px solid var(--co-accent-deep);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--co-accent-deep);
    cursor: pointer;
    transition: background-color var(--transition-fast, 0.15s ease), color var(--transition-fast, 0.15s ease);
}

.svc-co-reco-add:hover {
    background: var(--co-accent-deep);
    color: #fff;
}

.svc-co-reco-skip {
    position: absolute;
    inset-block-start: 4px;
    inset-inline-end: 4px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--co-muted);
    cursor: pointer;
    transition: background-color var(--transition-fast, 0.15s ease), color var(--transition-fast, 0.15s ease);
}

.svc-co-reco-skip svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.svc-co-reco-skip:hover {
    background: var(--co-line);
    color: var(--co-ink);
}

.svc-co-reco-add:focus-visible,
.svc-co-reco-skip:focus-visible {
    outline: 3px solid var(--co-accent);
    outline-offset: 2px;
}

/* Fields ----------------------------------------------------------------- */

.svc-co-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.svc-co-field-wide {
    grid-column: 1 / -1;
}

.svc-co-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--co-ink);
}

.svc-co-field label span[aria-hidden] {
    color: var(--co-danger);
}

.svc-co-field input,
.svc-co-field select,
.svc-co-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1.5px solid var(--co-line);
    border-radius: 10px;
    background: #fff;
    color: var(--co-ink);
    font: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease);
}

.svc-co-field input[dir="ltr"] {
    text-align: end;
}

/* iOS draws a date field's value inside its own pseudo-element, which ignores the
   field's alignment and its own intrinsic height. Without this the date sits
   off-centre and a hair taller than every other field on the form. */
.svc-co-field input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
}

.svc-co-field input[type="date"]::-webkit-date-and-time-value {
    margin: 0;
    text-align: start;
}

/* Announced to assistive tech only: adding a package already shows itself in the
   list, the total and the pay bar. */
.svc-co-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.svc-co-field input:focus,
.svc-co-field select:focus,
.svc-co-field textarea:focus {
    border-color: var(--co-accent-strong);
    outline: none;
    box-shadow: 0 0 0 3px rgba(92, 181, 229, 0.25);
}

.svc-co-field [aria-invalid="true"] {
    border-color: var(--co-danger);
}

.svc-co-error {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--co-danger-text);
}

.svc-co-hp {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.svc-co-field select {
    appearance: none;
    padding-inline-end: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 16px;
    cursor: pointer;
}

.svc-co-field input[type="date"] {
    text-align: start;
}

/* Contact date note ------------------------------------------------------ */

.svc-co-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 -4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--co-tint);
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--co-ink-2);
}

.svc-co-note::before {
    content: 'i';
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--co-accent-strong);
    font-size: 0.75rem;
    font-weight: 800;
    font-style: normal;
    color: #fff;
}

/* Project brief ---------------------------------------------------------- */

.svc-co-brief-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--co-line);
}

.svc-co-brief-heading {
    flex: 1 1 320px;
    min-width: 0;
}

.svc-co-brief-heading h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--co-ink);
}

.svc-co-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border: 1px solid var(--co-line);
    border-radius: 999px;
    background: var(--co-surface);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--co-muted);
}

.svc-co-brief-intro {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--co-muted);
}

.svc-co-progress {
    flex: 0 1 220px;
    min-width: 180px;
}

.svc-co-progress-text {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--co-muted);
}

.svc-co-progress-text strong {
    font-weight: 800;
    color: var(--co-ink);
}

.svc-co-progress-track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--co-line);
}

.svc-co-progress-fill {
    display: block;
    inline-size: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(to left, var(--co-accent), var(--co-accent-strong));
    transition: inline-size 0.3s ease;
}

/* Groups */

.svc-co-bgs {
    display: grid;
    gap: 14px;
    counter-reset: svc-co-bg;
}

.svc-co-bg {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 1px solid var(--co-line);
    border-radius: 14px;
    background: var(--co-surface);
    counter-increment: svc-co-bg;
}

.svc-co-bg-legend {
    float: inline-start;
    width: 100%;
    margin: 0;
    padding: 0;
}

.svc-co-bg-legend + * {
    clear: both;
}

.svc-co-bg-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--co-ink);
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.svc-co-bg-toggle:hover {
    background: transparent;
    color: var(--co-ink);
}

.svc-co-bg-toggle:focus-visible {
    outline: 3px solid var(--co-accent);
    outline-offset: -3px;
}

.svc-co-bg-badge {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--co-line);
    border-radius: 10px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--co-accent-deep);
    transition: background-color var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease);
}

.svc-co-bg-badge::before {
    content: counter(svc-co-bg);
}

.svc-co-bg.is-complete .svc-co-bg-badge {
    border-color: var(--co-accent-strong);
    background: var(--co-accent-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.svc-co-bg.is-complete .svc-co-bg-badge::before {
    content: '';
}

.svc-co-bg-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

.svc-co-bg-toggle:hover .svc-co-bg-title {
    color: var(--co-accent-deep);
}

.svc-co-bg-tag {
    flex-shrink: 0;
    background: #fff;
}

.svc-co-bg-count {
    flex-shrink: 0;
    padding: 3px 10px;
    border: 1px solid var(--co-line);
    border-radius: 999px;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--co-muted);
    white-space: nowrap;
}

.svc-co-bg.is-complete .svc-co-bg-count {
    border-color: transparent;
    background: var(--co-tint);
    color: var(--co-accent-deep);
}

.svc-co-bg-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--co-muted);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--transition-fast, 0.15s ease);
}

.svc-co-bg-toggle[aria-expanded="true"] .svc-co-bg-chevron {
    transform: rotate(180deg);
}

.svc-co-bg-body {
    margin: 0 12px 12px;
    padding: 0 20px;
    border: 1px solid var(--co-line);
    border-radius: 12px;
    background: #fff;
}

/* Questions */

.svc-co-q {
    min-width: 0;
    margin: 0;
    padding: 20px 0;
    border: 0;
}

.svc-co-q + .svc-co-q {
    border-top: 1px solid var(--co-line);
}

.svc-co-q-label {
    display: block;
    margin: 0 0 12px;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--co-ink);
}

legend.svc-co-q-label {
    float: inline-start;
    width: 100%;
}

.svc-co-q-choice > legend + * {
    clear: both;
}

.svc-co-q-mode {
    display: inline-block;
    margin-inline-start: 4px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--co-muted);
}

.svc-co-hint {
    margin: -6px 0 12px;
    font-size: 0.83rem;
    line-height: 1.7;
    color: var(--co-muted);
}

/* Option cards: the real input covers its card, invisible but focusable. */

.svc-co-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.svc-co-options.is-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.svc-co-opt {
    position: relative;
    display: flex;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.svc-co-opt-input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.svc-co-opt-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1.5px solid var(--co-line);
    border-radius: 12px;
    background: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--co-ink);
    transition: border-color var(--transition-fast, 0.15s ease), background-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease);
}

.svc-co-options.is-pills .svc-co-opt-box {
    padding-inline: 12px 18px;
    border-radius: 999px;
}

.svc-co-opt-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid #CBD5E1;
    border-radius: 50%;
    background: #fff;
    transition: border-color var(--transition-fast, 0.15s ease), background-color var(--transition-fast, 0.15s ease);
}

.svc-co-opt-input[type="checkbox"] + .svc-co-opt-box .svc-co-opt-mark {
    border-radius: 6px;
}

.svc-co-opt:hover .svc-co-opt-box {
    border-color: var(--co-accent);
}

.svc-co-opt:hover .svc-co-opt-mark {
    border-color: var(--co-accent);
}

.svc-co-opt-input:checked + .svc-co-opt-box {
    border-color: var(--co-accent-strong);
    background: var(--co-tint);
    box-shadow: inset 0 0 0 1px var(--co-accent-strong);
    font-weight: 700;
}

.svc-co-opt-input:checked + .svc-co-opt-box .svc-co-opt-mark {
    border-color: var(--co-accent-strong);
    background: var(--co-accent-strong);
}

/* The mark must say how many answers the question takes before it is answered:
   a round dot for one-of, a square tick for many-of. */

.svc-co-opt-input[type="radio"]:checked + .svc-co-opt-box .svc-co-opt-mark {
    box-shadow: inset 0 0 0 4px #fff;
}

.svc-co-opt-input[type="checkbox"]:checked + .svc-co-opt-box .svc-co-opt-mark {
    background: var(--co-accent-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.svc-co-opt-input:focus-visible + .svc-co-opt-box {
    outline: 3px solid var(--co-accent);
    outline-offset: 2px;
}

.svc-co-q-clear {
    display: block;
    width: fit-content;
    min-height: 32px;
    margin: 8px 0 0;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: var(--co-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.svc-co-q-clear:hover {
    background: transparent;
    color: var(--co-accent-deep);
}

.svc-co-q-clear:focus-visible {
    outline: 3px solid var(--co-accent);
    outline-offset: 2px;
}

/* Native controls kept for long lists and free text */

.svc-co-control {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1.5px solid var(--co-line);
    border-radius: 12px;
    background-color: #fff;
    color: var(--co-ink);
    font: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease);
}

select.svc-co-control {
    max-width: 480px;
    appearance: none;
    padding-inline-end: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 16px;
    cursor: pointer;
}

textarea.svc-co-control {
    min-height: 96px;
    resize: vertical;
}

.svc-co-control:hover {
    border-color: var(--co-accent);
}

.svc-co-control:focus {
    border-color: var(--co-accent-strong);
    outline: none;
    box-shadow: 0 0 0 3px rgba(92, 181, 229, 0.25);
}

/* Summary ---------------------------------------------------------------- */

.svc-co-aside {
    position: sticky;
    top: 96px;
}

.svc-co-summary {
    padding: 24px;
    border-radius: var(--co-radius);
    background: var(--co-ink);
    color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 50px rgba(15, 31, 51, 0.2);
}

.svc-co-summary h2 {
    margin: 0 0 16px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.svc-co-lines {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    list-style: none;
}

.svc-co-lines li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* "<service> — <package>" has no natural break opportunity in Arabic; let it wrap
   anywhere rather than push the price off a narrow summary. */
.svc-co-lines li span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.svc-co-lines strong {
    flex-shrink: 0;
    color: #fff;
    white-space: nowrap;
}

.svc-co-totals {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
}

.svc-co-totals div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.92rem;
}

.svc-co-totals dt,
.svc-co-totals dd {
    margin: 0;
}

.svc-co-totals dd {
    white-space: nowrap;
}


.svc-co-totals .is-total {
    padding-top: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}


.svc-co-form-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(229, 62, 62, 0.16);
    font-size: 0.9rem;
    color: #FFB4B4;
}

.svc-co-form-error p {
    margin: 0;
    line-height: 1.7;
}

.svc-co-error-wa {
    display: inline-block;
    margin-top: 6px;
    font-weight: 700;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.svc-co-error-wa:hover {
    color: var(--co-accent);
}

/* Buttons ---------------------------------------------------------------- */

.svc-co-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 24px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition-fast, 0.15s ease), background-color var(--transition-fast, 0.15s ease), opacity var(--transition-fast, 0.15s ease);
}

.svc-co-btn-primary {
    /* Carries white text, so it needs the AA-safe tone, not the border tone. */
    background: var(--co-accent-deep);
    color: #fff;
}

.svc-co-btn-primary:hover {
    background: var(--co-ink-2);
    color: #fff;
}

.svc-co-summary .svc-co-btn-primary {
    background: #fff;
    color: var(--co-ink);
}

.svc-co-summary .svc-co-btn-primary:hover {
    background: var(--co-tint);
    color: var(--co-ink);
    transform: translateY(-2px);
}

.svc-co-submit {
    width: 100%;
}

.svc-co-submit:disabled,
.svc-co-paybar-btn:disabled {
    cursor: progress;
    opacity: 0.7;
    transform: none;
}

.svc-co .is-busy .svc-co-arrow {
    animation: svc-co-spin 0.9s linear infinite;
}

@keyframes svc-co-spin {
    to {
        transform: rotate(-360deg);
    }
}

/* Mobile pay bar ----------------------------------------------------------
 * Below 1025px the summary stops being sticky and lands after three long cards,
 * so the total and the pay button are two screens away while the form is filled.
 * This bar carries both, and hides itself whenever the real summary is on screen
 * so only one pay button is ever focusable.
 */

.svc-co-paybar {
    display: none;
}

@media (max-width: 1024px) {
    .svc-co {
        padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    }

    .svc-co-paybar {
        position: fixed;
        inset-inline: 0;
        inset-block-end: 0;
        z-index: 900;
        display: block;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--co-line);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -6px 24px rgba(15, 31, 51, 0.1);
        backdrop-filter: blur(8px);
    }

    /* Set by the observer in services-checkout.js when the summary is in view. */
    .svc-co-paybar.is-off {
        display: none;
    }

    .svc-co-paybar-inner {
        display: flex;
        align-items: center;
        gap: 12px;
        max-width: 1180px;
        margin-inline: auto;
    }

    .svc-co-paybar-info {
        display: grid;
        gap: 2px;
        min-width: 0;
    }

    .svc-co-paybar-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--co-muted);
    }

    .svc-co-paybar-total {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--co-ink);
        white-space: nowrap;
    }

    .svc-co-paybar-btn {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.svc-co-arrow {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.svc-co-btn:focus-visible,
.svc-co-tier:focus-visible,
.svc-co-remove:focus-visible,
.svc-co-link:focus-visible,
.svc-co-back:focus-visible {
    outline: 3px solid var(--co-accent);
    outline-offset: 3px;
}

.svc-co-trust {
    display: grid;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.svc-co-trust li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.svc-co-trust li::before {
    content: '';
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--co-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F1F33' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.svc-co-help {
    margin: 16px 0 0;
    font-size: 0.85rem;
}

.svc-co-help a {
    color: var(--co-accent);
    font-weight: 700;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1024px) {
    .svc-co-grid {
        grid-template-columns: 1fr;
    }

    .svc-co-aside {
        position: static;
    }
}

@media (max-width: 768px) {
    .svc-co-head {
        padding-block: 28px 30px;
    }

    .svc-co-card,
    .svc-co-summary {
        padding: 18px;
    }

    .svc-co-fields {
        grid-template-columns: 1fr;
    }

    .svc-co-brief-head {
        gap: 14px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .svc-co-progress {
        flex: 1 1 100%;
    }

    .svc-co-bgs {
        gap: 10px;
    }

    .svc-co-bg-toggle {
        gap: 10px;
        min-height: 58px;
        padding: 10px 12px;
    }

    .svc-co-bg-badge {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .svc-co-bg-title {
        font-size: 0.95rem;
    }

    .svc-co-bg-body {
        margin: 0 8px 8px;
        padding: 0 14px;
    }

    .svc-co-q {
        padding: 16px 0;
    }

    .svc-co-options.is-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .svc-co-bg-tag {
        display: none;
    }

    .svc-co-options.is-pills .svc-co-opt {
        flex: 1 1 auto;
    }

    .svc-co-options.is-pills .svc-co-opt-box {
        white-space: nowrap;
        padding-inline: 12px;
        border-radius: 12px;
    }

    select.svc-co-control {
        max-width: none;
    }

    .svc-co-tiers {
        grid-template-columns: 1fr;
    }

    .svc-co-reco-foot {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .svc-co-reco-add {
        flex: 0 1 auto;
    }

    .svc-co-tier {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .svc-co *,
    .svc-co *::before,
    .svc-co *::after {
        transition: none !important;
        animation: none !important;
    }
}
