/*
 * VPS/VPN checkout promo-code feedback (ConfiguratorWidget::orderPromocode, model Vps).
 * Shared by every brand: registered by common\configurator\widget\ConfiguratorAsset, which
 * every configurator page loads (after the 'common' bundle, so it wins ties with common.css).
 * Opt-in: legacy markup has none of these classes.
 * --color-red-600 is defined only in themes/standart/css/root.css (not loaded by standart_legacy),
 * hence the fallback.
 */
.promocode-wrapper--feedback .promocode-btn,
.promocode-wrapper--feedback + .order_btn .order__doorder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 40px;
    border: 0;
    padding: 6px 12px;
    font: inherit;
    line-height: 20px;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere;
}
.promocode-wrapper--feedback .promocode-btn {
    flex: 0 0 calc((100% - 12px) / 2);
    min-width: 0;
}
.promocode-wrapper--feedback + .order_btn .order__doorder {
    width: calc((100% - 12px) / 2);
}
.promocode-wrapper--feedback .promocode-add-on {
    margin-bottom: 0;
    align-items: stretch;
}
.promocode-wrapper--feedback #promocode-wrapper {
    display: flex;
    min-width: 0;
}
.promocode-wrapper--feedback #promocode-wrapper input[name="promocode"] {
    box-sizing: border-box;
    min-height: 40px;
    height: auto;
    padding: 6px 34px 6px 8px !important;
}
.promocode-wrapper--feedback #promocode-wrapper input[name="promocode"]:placeholder-shown {
    padding-right: 8px !important;
}
.promocode-wrapper--feedback + .order_btn {
    margin: 8px 0 12px;
}
.promocode-wrapper--feedback.promocode-entered + .order_btn {
    display: none;
}
.promocode-wrapper--feedback.promocode-applied .promocode-btn {
    background: #E1E31A !important;
    color: #000000 !important;
}
.promocode-wrapper--feedback.promocode-rejected input[name="promocode"] {
    color: var(--color-red-600, #c13757) !important;
    text-decoration: line-through;
    text-decoration-color: var(--color-red-600, #c13757);
}
.promocode-wrapper--feedback #promocode-wrapper .close {
    background: #888888;
}
.promocode-wrapper--feedback .promocode-feedback-message {
    margin: 8px 0 12px;
    min-height: 40px;
    color: #787e8c;
    font-size: 14px;
    line-height: 20px;
    font-weight: 300;
    text-transform: uppercase;
    text-align: left;
    overflow-wrap: anywhere;
}
.promocode-wrapper--feedback .promocode-feedback-message[hidden] {
    display: none;
}
/* The hint replaces the lower CTA's space as soon as a visitor enters a code. */
.promocode-wrapper--feedback.promocode-entered .promocode-feedback-message[hidden] {
    display: block;
    visibility: hidden;
}
.promocode-wrapper--feedback .promocode-feedback-message > span {
    display: block;
}
.promocode-wrapper--feedback.promocode-applied .promocode-feedback-message > span {
    display: inline;
    text-decoration: underline;
    text-decoration-color: #E1E31A;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/*
 * Theme "simple" (justvps.pro) only. simple.css gives .promocode-btn 50px side padding (it sized
 * itself) and style.css pins the close button with left: calc(100% - 171px) for a wide field;
 * in the fixed half-width feedback layout the label would wrap letter by letter and the cross
 * would sit on top of the typed code. Higher specificity than those rules, same visual style.
 */
.order-section .order_form .configurator .promocode-wrapper--feedback .promocode-btn {
    padding: 6px 12px;
}
.order-section .order_form .configurator .promocode-wrapper--feedback #promocode-wrapper .close {
    left: auto;
    right: 8px;
    top: 50%;
    bottom: auto;
}

/*
 * jvps.hosting (theme standart_legacy) only, scoped by the theme's own stylesheet, which no other
 * brand loads. Its common.css narrows the input to calc(100% - 35px) and puts the close cross in
 * that gap, so with the reserved 34px right padding an applied code showed as "ORC…". Full width
 * with the padding the cross actually needs keeps the code visible. Browsers without :has() keep
 * the previous look.
 */
html:has(link[href*="/standart_legacy/css/jvpshosting-vps.css"]) .promocode-wrapper--feedback #promocode-wrapper input[name="promocode"] {
    width: 100%;
    padding-right: 22px !important;
}
