/* ================================================================== */
/*  Contact page — Converge-style                                      */
/*  Blue gradient hero with animated background + white form below    */
/* ================================================================== */

.contact-page {
    background: var(--bg);
    padding: 72px 0 0;
    min-height: calc(100vh - 64px);
}

@media (min-width: 768px) {
    .contact-page { padding: 108px 0 0; }
}

/* =========================== HERO =========================== */

.contact-hero {
    position: relative;
    margin: 0 16px;
    max-width: var(--container-max);
    overflow: hidden;
    border-radius: var(--radius-md);
    /* Match the closing CTA background: brand → near-black diagonal with two
       radial highlights stacked on top. */
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.10), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(167, 243, 208, 0.12), transparent 55%),
        linear-gradient(135deg, var(--brand-fill) 0%, #0b1220 100%);
    color: #ffffff;
    isolation: isolate;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 10px 24px -10px rgba(4, 44, 113, 0.45);
}
@media (min-width: 768px) {
    .contact-hero { margin: 0 auto; }
}

/* Same animated white silk-ribbon overlay as the closing CTA banners. */
.contact-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: url("../../assets/images/graphics/cta-flow-bg.svg") center / cover no-repeat;
    opacity: 0.55;
    animation: cta-flow-drift 12s ease-in-out infinite alternate;
    -webkit-mask-image: linear-gradient(20deg, #000 0%, transparent 45%);
            mask-image: linear-gradient(20deg, #000 0%, transparent 45%);
}
@keyframes cta-flow-drift {
    from { transform: translateX(-3%) scale(1); }
    to   { transform: translateX(3%) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
    .contact-hero::before { animation: none; }
}

/* Hide the legacy orbs + grid layer — replaced by the silk-ribbon overlay
   above so the contact hero matches every other CTA on the site. The markup
   still ships the .contact-hero__bg node, so this rule must stay. */
.contact-hero__bg { display: none; }

/* ---- Content layer ---- */

.contact-hero__inner {
    position: relative;
    z-index: 1;
    padding: 36px 24px 36px;
    margin: 0;
}

@media (min-width: 768px) {
    .contact-hero__inner { padding: 56px 24px 56px; }
}

.contact-hero__title {
    margin: 0 0 10px;
    font-size: var(--fs-h1);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-heading);
    color: #ffffff;
    text-wrap: balance;
}

/* No max-width cap: the lead is one sentence in every language and should
   render on a single line on desktop (a 640px cap forced ru/kk into two
   stubby balanced lines). It still wraps naturally on narrow screens. */
.contact-hero__lead {
    margin: 0 0 16px;
    font-size: var(--fs-lead);
    line-height: var(--lh-snug);
    color: var(--text-on-dark);
    text-wrap: balance;
}

.contact-hero__channels {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 520px;
}

.contact-hero__channel {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-on-dark);
    font-size: var(--fs-body);
    line-height: var(--lh-snug);
    transition: color var(--dur-fast) var(--ease-out);
    width: fit-content;
    margin: 0;
}

.contact-hero__channel:hover {
    color: #ffffff;
}

.contact-hero__channel svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.contact-hero__channel--address {
    align-items: flex-start;
}

.contact-hero__channel--address svg {
    margin-top: 2px;
}

/* =========================== FORM SECTION =========================== */

.contact-form-section {
    padding: 64px 0 96px;
    background: var(--bg);
}

@media (min-width: 768px) {
    .contact-form-section { padding: 88px 0 120px; }
}

.cform {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Hidden via clip-path instead of an off-screen offset: left: -9999px
   extends the scrollable canvas on RTL pages (Arabic) and breaks the
   layout, since RTL documents grow their overflow to the left. */
.cform__honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    pointer-events: none !important;
}

.cform__status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: var(--fs-body-sm);
    line-height: var(--lh-snug);
}

.cform__status[hidden] { display: none; }

.cform__status--success {
    background: var(--bg-success-subtle);
    color: var(--color-success);
    border: 1px solid var(--border-success);
}

.cform__status--error {
    background: var(--bg-error-subtle);
    color: var(--color-error);
    border: 1px solid var(--border-error);
}

.cform__status svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ---- Rows & fields ---- */

.cform__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

@media (min-width: 720px) {
    .cform__row--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 28px;
    }
}

.cform__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* `display: flex` above defeats the HTML `hidden` attribute, which is how
   the plan dropdown is gated to pricing-page visitors. Restore it. */
.cform__field[hidden] { display: none; }

.cform__label {
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-medium);
    color: var(--text);
    letter-spacing: 0;
}

.cform__req {
    color: var(--color-error);
    margin-left: 3px;
}

[dir="rtl"] .cform__req {
    margin-left: 0;
    margin-right: 3px;
}

.cform__help {
    margin: -4px 0 2px;
    font-size: var(--fs-caption);
    color: var(--text-muted);
}

.cform__input {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: var(--fs-body);
    color: var(--text);
    transition: border-color var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.cform__input::placeholder {
    color: var(--text-muted);
}

.cform__input:hover {
    background: var(--input-bg-hover);
}

.cform__input:focus,
.cform__input:focus-visible {
    outline: 0;
    background: var(--input-bg-focus);
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(26, 75, 181, 0.15);
}

.cform__textarea {
    height: auto;
    min-height: 140px;
    padding: 14px;
    line-height: var(--lh-body);
    resize: vertical;
}

.cform__select {
    padding-right: 36px;
    background-image:
        linear-gradient(45deg,  transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

[dir="rtl"] .cform__select {
    padding-right: 14px;
    padding-left: 36px;
    /* Mirror of the LTR positions: the 45deg half stays on the left of the
       pair and the 135deg half on the right, so the caret keeps pointing down. */
    background-position:
        13px 50%,
        18px 50%;
}

/* ---- Phone (prefix + number) ---- */

.cform__phone {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 8px;
}

.cform__phone-prefix {
    padding-left: 10px;
    padding-right: 26px;
    font-size: var(--fs-body-sm);
}

[dir="rtl"] .cform__phone-prefix {
    padding-left: 26px;
    padding-right: 10px;
}

/* ---- Legal block + checkbox ---- */

.cform__legal {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0;
    font-size: var(--fs-caption);
    line-height: var(--lh-snug);
    color: var(--text-muted);
}

.cform__legal-text {
    margin: 0;
}

.cform__link {
    color: var(--brand-500);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cform__link:hover {
    color: var(--brand);
}

.cform__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0;
    cursor: pointer;
    font-size: var(--fs-body-sm);
    color: var(--text);
    user-select: none;
}

.cform__check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cform__check-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-xs);
    background: var(--bg-elevated);
    color: #ffffff;
    flex-shrink: 0;
    transition: background-color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}

.cform__check-box svg {
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-out);
}

.cform__check input:checked + .cform__check-box {
    background: var(--brand-fill-500);
    border-color: var(--brand-fill-500);
}

.cform__check input:checked + .cform__check-box svg {
    opacity: 1;
}

.cform__check input:focus-visible + .cform__check-box {
    box-shadow: 0 0 0 3px rgba(26, 75, 181, 0.2);
}

.cform__check-label {
    flex: 1;
    line-height: var(--lh-snug);
}

/* ---- Submit button ---- */

.cform__actions {
    margin-top: 8px;
}

.cform__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    min-height: 44px;
    padding: 10px 22px;
    background: var(--brand-fill);
    color: #ffffff;
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-tight);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 1px 2px rgba(4, 44, 113, 0.2);
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.cform__submit:hover {
    background: var(--brand-fill-600);
    border-color: var(--brand-fill-600);
}

.cform__submit:active {
    transform: translateY(1px);
}

.cform__submit:disabled {
    background: var(--brand-300);
    border-color: var(--brand-300);
    cursor: not-allowed;
}

.cform__submit:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .cform__submit {
        display: flex;
        width: 100%;
    }
}
