/* Order window of /dedicated (ru, en, ro) for the provider configurations. Markup: assets/js/dedicated-order.js.
   The same layout as the order window of /rdp-dedicated-servers (assets/css/rdp-page.css) in the colours of the
   catalog table (assets/css/dedicated-catalog.css, which also declares the fonts): options on the left, the price,
   first payment and actions in a side column, a footer with the price and the main button on phones. */

.dso-dialog {
    --d-surface: #fff;
    --d-surface-2: #f8f9fb;
    --d-surface-3: #f1f3f6;
    --d-line: #e5e7eb;
    --d-line-2: #d1d5db;
    --d-ink: #111318;
    --d-ink-2: #4b5563;
    --d-ink-3: #6b7280;
    --d-dark: #111318;
    --d-on-dark: #fff;
    --d-on-soft: #f4f5f8;
    --d-accent: #c2185b;
    --d-accent-hover: #a3134c;
    --d-accent-text: #b0124f;
    --d-link: #2347c4;
    --d-ok: #1e7a35;
    --d-ok-soft: #e6f4ea;
    --d-ok-ink: #1e6b31;
    --d-build: #a85a00;
    --d-build-soft: #fff2db;
    --d-build-ink: #7a4100;
    --d-deal: #e8590c;
    --d-deal-soft: #fff1e8;
    --d-deal-text: #b8410f;
    --d-deal-ink: #7c2d06;
    --d-error-soft: #fdecec;
    --d-error-ink: #9b1c1c;
    --d-focus: #2f5cf5;
    --d-sans: "AbcdInter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --d-mono: "AbcdMono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    width: min(1040px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    background: var(--d-surface);
    box-shadow: 0 40px 100px rgba(5, 10, 30, 0.45);
    color: var(--d-ink);
    font-family: var(--d-sans);
    /* No "tnum" on text: in Inter it makes hyphens tabular; figures that line up get it below. */
    font-feature-settings: "cv11" 1;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

[data-background="dark"] .dso-dialog,
[data-background="modern"] .dso-dialog {
    --d-surface: #1c2230;
    --d-surface-2: #222938;
    --d-surface-3: #2a3242;
    --d-line: #343d4f;
    --d-line-2: #475268;
    --d-ink: #f3f5f9;
    --d-ink-2: #c3cad6;
    --d-ink-3: #9aa4b4;
    --d-dark: #f3f5f9;
    --d-on-dark: #111318;
    --d-on-soft: #2a3242;
    --d-accent: #d6336c;
    --d-accent-hover: #e04b80;
    --d-accent-text: #ff8fb4;
    --d-link: #9db4ff;
    --d-ok: #69db7c;
    --d-ok-soft: rgba(105, 219, 124, 0.14);
    --d-ok-ink: #a6f0b3;
    --d-build: #ffc078;
    --d-build-soft: rgba(255, 169, 77, 0.15);
    --d-build-ink: #ffd8a8;
    --d-deal-soft: rgba(232, 89, 12, 0.18);
    --d-deal-text: #ffad6b;
    --d-deal-ink: #ffc9a3;
    --d-error-soft: rgba(250, 82, 82, 0.16);
    --d-error-ink: #ffb3b3;
    --d-focus: #9db4ff;
}

.dso-opt__price,
.dso-sum,
.dso-dlg__foot-sum b {
    font-feature-settings: "tnum" 1, "cv11" 1;
}

html.dso-lock {
    overflow: hidden;
}

.dso-dialog[open] {
    display: flex;
    flex-direction: column;
}

.dso-dialog::backdrop {
    background: rgba(8, 14, 38, 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

/* The theme sets its own font on headings and controls with !important. */
html body .dso-dialog :is(h2, p, a, li, button, input, textarea, legend, summary, label, span, b, small, s) {
    font-family: var(--d-sans) !important;
}

.dso-dialog [hidden] {
    display: none !important;
}

.dso-dialog *,
.dso-dialog *::before,
.dso-dialog *::after {
    box-sizing: border-box;
}

.dso-dialog :is(h2, p, ol, fieldset) {
    margin: 0;
}

.dso-dialog ol {
    padding: 0;
    list-style: none;
}

.dso-dialog a {
    color: inherit;
    text-decoration: none;
}

/* !important: the theme removes outlines from links with a{outline:0!important}. */
.dso-dialog :is(a, button, summary, input, textarea):focus-visible,
.dso-dialog label:has(input:focus-visible) {
    outline: 2px solid var(--d-focus) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

.dso-vh {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --------------------------------------------------------------- layout -- */

.dso-dlg {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
}

.dso-dlg__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--d-line);
}

.dso-dlg__kicker {
    color: var(--d-accent-text);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dso-dlg__kicker.is-queue {
    color: var(--d-deal-text);
}

.dso-dialog h2 {
    margin-top: 4px !important;
    color: var(--d-ink);
    font-size: 23px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-transform: none;
}

.dso-dlg__sub {
    margin-top: 4px !important;
    color: var(--d-ink-2);
    font-size: 14px;
}

.dso-dialog .dso-dlg__close {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: -4px -8px 0 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--d-surface-3);
    color: var(--d-ink-2);
    font-size: 18px;
    cursor: pointer;
}

.dso-dialog .dso-dlg__close:hover {
    background: var(--d-line);
    color: var(--d-ink);
}

.dso-dlg__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.dso-dlg__main {
    display: grid;
    align-content: start;
    gap: 20px;
    padding: 20px 24px 24px;
}

.dso-dialog fieldset {
    min-width: 0;
    padding: 0;
    border: 0;
}

.dso-dialog legend,
.dso-dlg__label {
    display: block;
    float: none;
    width: auto;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    color: var(--d-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.dso-dlg__label {
    margin: 8px 0 0;
}

.dso-dlg__label small,
.dso-dlg__static {
    color: var(--d-ink-2);
    font-size: 13.5px;
    font-weight: 500;
}

.dso-dlg__static {
    color: var(--d-ink);
    font-size: 14.5px;
    font-weight: 600;
}

/* ------------------------------------------------------------- controls -- */

.dso-pills,
.dso-bill {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dso-bill .dso-pill {
    flex: 1;
}

.dso-dialog .dso-pill {
    min-height: 34px;
    margin: 0;
    padding: 5px 12px;
    border: 1px solid var(--d-line-2);
    border-radius: 9px;
    background: var(--d-surface);
    color: var(--d-ink);
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dso-dialog .dso-pill:hover {
    border-color: var(--d-ink-3);
}

.dso-dialog .dso-pill.is-on {
    border-color: var(--d-dark);
    background: var(--d-dark);
    color: var(--d-on-dark);
}

.dso-bill__note {
    margin-top: 6px !important;
    color: var(--d-ink-2);
    font-size: 12.5px;
}

.dso-opts {
    display: grid;
    gap: 6px;
}

.dso-opts--loc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dso-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--d-line-2);
    border-radius: 11px;
    background: var(--d-surface);
    color: var(--d-ink);
    font-weight: 400;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dso-opt:hover {
    border-color: var(--d-ink-3);
}

.dso-opt input {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--d-dark);
}

.dso-opt.is-on {
    border-color: var(--d-dark);
    background: var(--d-on-soft);
    box-shadow: inset 0 0 0 1px var(--d-dark);
}

.dso-opt__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.dso-opt__main small {
    color: var(--d-ink-3);
    font-size: 12.5px;
    font-weight: 500;
}

.dso-opt__main small.is-ok {
    color: var(--d-ok);
}

.dso-opt__main small.is-build {
    color: var(--d-build);
}

.dso-opt__price {
    flex: none;
    color: var(--d-ink);
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.dso-opt__price s {
    display: block;
    color: var(--d-ink-3);
    font-size: 12px;
    font-weight: 500;
}

.dso-opt.is-sold .dso-opt__main {
    color: var(--d-ink-2);
}

.dso-opt.is-sold:not(.is-on) {
    border-style: dashed;
}

.dso-dlg__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.dso-dlg__field > span {
    color: var(--d-ink);
    font-size: 14px;
    font-weight: 700;
}

.dso-dlg__field small {
    color: var(--d-ink-3);
    font-size: 12.5px;
    line-height: 1.45;
}

.dso-dialog :is(input[type="text"], textarea) {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--d-line-2);
    border-radius: 11px;
    background-color: var(--d-surface);
    color: var(--d-ink);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: none;
}

.dso-dialog :is(.dso-dlg__field, .dso-dlg__preview) textarea {
    height: auto;
    min-height: 74px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
}

/* ----------------------------------------------------------------- side -- */

.dso-dlg__side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px 24px;
    border-left: 1px solid var(--d-line);
    background: var(--d-surface-2);
}

.dso-sum {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--d-line);
    border-radius: 14px;
    background: var(--d-surface);
}

.dso-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

.dso-price b {
    color: var(--d-ink);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.dso-per {
    margin-left: -6px;
    color: var(--d-ink-3);
    font-size: 14px;
    font-weight: 600;
}

.dso-price s {
    color: var(--d-ink-3);
    font-size: 15px;
    font-weight: 500;
}

.dso-sum__line {
    color: var(--d-ink-2);
    font-size: 13.5px;
}

.dso-sum__line.is-deal {
    color: var(--d-deal-text);
    font-weight: 600;
}

.dso-sum__first {
    margin-top: 6px !important;
    padding-top: 10px !important;
    border-top: 1px dashed var(--d-line-2);
    color: var(--d-ink);
    font-size: 15px;
    font-weight: 700;
}

.dso-sum__first small {
    display: block;
    color: var(--d-ink-3);
    font-size: 12.5px;
    font-weight: 500;
}

.dso-note {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--d-surface-3);
    color: var(--d-ink-2);
    font-size: 13.5px;
    line-height: 1.5;
}

.dso-note i {
    margin-top: 3px;
}

.dso-note.is-ok {
    background: var(--d-ok-soft);
    color: var(--d-ok-ink);
}

.dso-note.is-build {
    background: var(--d-build-soft);
    color: var(--d-build-ink);
}

.dso-note.is-queue {
    background: var(--d-deal-soft);
    color: var(--d-deal-ink);
}

.dso-note.is-error {
    background: var(--d-error-soft);
    color: var(--d-error-ink);
}

.dso-dlg__actions {
    display: grid;
    gap: 8px;
}

.dso-dialog .dso-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--d-surface);
    color: var(--d-ink) !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.dso-dialog .dso-btn:hover {
    transform: translateY(-1px);
}

.dso-dialog .dso-btn:active {
    transform: translateY(0);
}

.dso-dialog .dso-btn--primary {
    background: var(--d-accent);
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(194, 24, 91, 0.26);
}

.dso-dialog .dso-btn--primary:hover {
    background: var(--d-accent-hover);
}

.dso-dialog .dso-btn--soft {
    border-color: var(--d-line-2);
}

.dso-dialog .dso-btn--soft:hover {
    border-color: var(--d-ink-3);
}

.dso-dialog .dso-btn--queue {
    border-color: var(--d-deal);
    background: var(--d-deal-soft);
    color: var(--d-deal-text) !important;
}

.dso-dlg__steps {
    display: grid;
    gap: 8px;
    counter-reset: dso-step;
}

.dso-dlg__steps li {
    position: relative;
    margin: 0;
    padding-left: 30px;
    color: var(--d-ink-2);
    font-size: 13.5px;
    line-height: 1.5;
    counter-increment: dso-step;
}

.dso-dlg__steps li::before {
    content: counter(dso-step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: var(--d-dark);
    color: var(--d-on-dark);
    font-size: 12px;
    font-weight: 700;
}

.dso-dlg__login {
    color: var(--d-ink-3);
    font-size: 12.5px;
}

.dso-dlg__preview summary {
    color: var(--d-ink-2);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.dso-dialog .dso-dlg__preview textarea {
    min-height: 220px;
    margin-top: 8px;
    font-family: var(--d-mono) !important;
    font-size: 12.5px;
}

.dso-dialog .dso-link {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    color: var(--d-link) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 3px;
}

.dso-dialog .dso-link:hover {
    text-decoration-color: currentColor;
}

.dso-dlg__foot {
    display: none;
}

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 991.98px) {
    .dso-dlg__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .dso-dlg__side {
        border-top: 1px solid var(--d-line);
        border-left: 0;
    }

    /* The summary sits below the options here: the price and the main button stay on screen in a footer. */
    .dso-dlg__foot {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--d-line);
        background: var(--d-surface);
        box-shadow: 0 -8px 20px rgba(13, 21, 48, 0.06);
    }

    .dso-dlg__foot-sum {
        display: flex;
        flex-direction: column;
        margin: 0;
        line-height: 1.25;
    }

    .dso-dlg__foot-sum b {
        color: var(--d-ink);
        font-size: 22px;
        font-weight: 800;
    }

    .dso-dlg__foot-sum small {
        margin-left: 2px;
        color: var(--d-ink-3);
        font-size: 13px;
        font-weight: 600;
    }

    .dso-dlg__foot-sum span {
        color: var(--d-ink-2);
        font-size: 12.5px;
    }

    .dso-dialog .dso-dlg__foot .dso-btn {
        width: auto;
        min-height: 46px;
        padding: 10px 16px;
    }
}

@media (max-width: 767.98px) {
    .dso-dialog {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .dso-dlg__head {
        padding: 16px 16px 12px;
    }

    .dso-dialog h2 {
        font-size: 20px;
    }

    .dso-dlg__main,
    .dso-dlg__side {
        padding: 16px;
    }

    .dso-opts--loc {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Tap targets of at least 40px. */
    .dso-dialog .dso-pill {
        min-height: 40px;
    }

    /* 16px: iOS Safari zooms the page into smaller text fields. */
    .dso-dialog :is(input[type="text"], textarea),
    .dso-dialog :is(.dso-dlg__field, .dso-dlg__preview) textarea {
        font-size: 16px;
    }
}

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