/**
 * Contact Section — Premium Glass / Monochrome
 *
 * @package Bargtunes
 */

/* ========================================
   TOKENS
======================================== */

.ct-section {
    --ct-bg: #050505;
    --ct-surface: rgba(255, 255, 255, 0.03);
    --ct-border: rgba(255, 255, 255, 0.08);
    --ct-text: #ffffff;
    --ct-muted: rgba(255, 255, 255, 0.55);
    --ct-hover: rgba(255, 255, 255, 0.05);
    --ct-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ct-max: 1600px;
    --ct-gap: clamp(40px, 5vw, 80px);
}

/* ========================================
   SECTION
======================================== */

.bargtunes-contact-section.ct-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(64px, 8vw, 120px) clamp(20px, 4vw, 48px);
    background: var(--ct-bg);
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

/* ========================================
   BACKGROUND
======================================== */

.ct-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.ct-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 72%);
    opacity: 0.55;
}

.ct-bg__noise {
    position: absolute;
    inset: 0;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

.ct-bg__spotlight {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.ct-bg__spotlight--1 {
    width: min(55vw, 640px);
    height: min(55vw, 640px);
    top: -8%;
    left: 8%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.045) 0%, transparent 68%);
}

.ct-bg__spotlight--2 {
    width: min(45vw, 520px);
    height: min(45vw, 520px);
    bottom: 5%;
    right: 10%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.035) 0%, transparent 70%);
}

/* ========================================
   LAYOUT
======================================== */

.ct-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--ct-max);
    margin: 0 auto;
}

.ct-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: var(--ct-gap);
    align-items: center;
}

/* ========================================
   LEFT COLUMN
======================================== */

.ct-left {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vw, 32px);
}

.ct-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--ct-muted);
    width: fit-content;
    font-family: inherit;
}

.ct-headline {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2.8rem, 8vw, 8rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--ct-text);
}

.ct-headline__line {
    display: block;
}

.ct-desc {
    margin: 0;
    max-width: 450px;
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    line-height: 1.75;
    color: var(--ct-muted);
    font-family: inherit;
}

/* Contact cards 2x2 */
.ct-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 520px;
}

.ct-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 24px;
    border-radius: 24px;
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    text-decoration: none;
    color: inherit;
    transition:
        transform 0.3s var(--ct-ease),
        background 0.3s ease,
        border-color 0.3s ease;
}

.ct-card:hover {
    transform: translateY(-4px) scale(1.01);
    background: var(--ct-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.ct-card__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.ct-card__icon svg {
    width: 100%;
    height: 100%;
}

.ct-card__icon svg path,
.ct-card__icon svg rect,
.ct-card__icon svg circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ct-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ct-card__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    font-family: inherit;
}

.ct-card__value {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    word-break: break-word;
    line-height: 1.4;
    font-family: inherit;
}

/* Social */
.ct-social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.ct-social__btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition:
        transform 0.3s var(--ct-ease),
        background 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease;
}

.ct-social__btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.ct-social__btn:hover {
    transform: translateY(-3px);
    background: var(--ct-hover);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* ========================================
   FORM SHELL
======================================== */

.ct-form-shell {
    position: relative;
    border-radius: 32px;
    padding: 1px;
    overflow: hidden;
}

.ct-form-beam {
    position: absolute;
    inset: -120%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.07) 40deg,
        rgba(255, 255, 255, 0.03) 80deg,
        transparent 120deg
    );
    animation: ctBeamSpin 10s linear infinite;
    opacity: 0.55;
    pointer-events: none;
}

.ct-form-inner {
    position: relative;
    z-index: 1;
    padding: clamp(28px, 4vw, 48px);
    border-radius: 31px;
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ct-form-title {
    margin: 0 0 clamp(24px, 3vw, 32px);
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ct-text);
}

/* ========================================
   FORM
======================================== */

.ct-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ct-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ct-field__label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.04em;
    font-family: inherit;
}

.ct-input {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ct-text);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--ct-border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
    resize: vertical;
}

.ct-input--area {
    min-height: 220px;
    padding: 16px 18px;
    line-height: 1.6;
}

.ct-input::placeholder {
    color: rgba(255, 255, 255, 0.28);
    font-family: inherit;
}

.ct-input:focus {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.035);
}

.ct-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    margin-top: 8px;
    padding: 0 24px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ct-text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ct-border);
    border-radius: 12px;
    cursor: pointer;
    transition:
        transform 0.3s var(--ct-ease),
        background 0.3s ease,
        border-color 0.3s ease;
}

.ct-submit__text {
    font-family: inherit;
}

.ct-submit__arrow {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s var(--ct-ease);
}

body.rtl .ct-submit__arrow {
    transform: scaleX(-1);
}

.ct-submit:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
}

.ct-submit:hover .ct-submit__arrow {
    transform: translateX(3px);
}

body.rtl .ct-submit:hover .ct-submit__arrow {
    transform: scaleX(-1) translateX(3px);
}

.ct-submit.is-sent {
    pointer-events: none;
    opacity: 0.85;
}

.ct-submit.is-sending {
    pointer-events: none;
    opacity: 0.75;
}

.ct-field--hp {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
}

.ct-form__status {
    margin: 0 0 12px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    min-height: 1.2em;
}

.ct-form__status.is-error {
    color: #ff8f8f;
}

.ct-form__status.is-ok {
    color: #d6ff4b;
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes ctBeamSpin {
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 1100px) {
    .ct-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
        gap: clamp(32px, 4vw, 56px);
    }

    .ct-cards {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .bargtunes-contact-section.ct-section {
        min-height: auto;
        align-items: flex-start;
        padding-top: clamp(56px, 10vw, 88px);
        padding-bottom: calc(clamp(80px, 12vw, 120px) + var(--fn-dock-clearance, 88px));
    }

    .ct-layout {
        grid-template-columns: 1fr;
        gap: clamp(40px, 6vw, 56px);
    }

    .ct-left {
        align-items: center;
        text-align: center;
    }

    .ct-desc {
        max-width: 36rem;
    }

    .ct-cards {
        width: 100%;
        max-width: 560px;
    }

    .ct-social {
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .ct-cards {
        grid-template-columns: 1fr;
    }

    .ct-card {
        padding: 20px;
        border-radius: 20px;
    }

    .ct-form-inner {
        padding: 24px 20px;
        border-radius: 24px;
    }

    .ct-form-shell {
        border-radius: 25px;
    }

    .ct-form-inner {
        border-radius: 24px;
    }

    .ct-headline {
        font-size: clamp(2.2rem, 12vw, 3rem);
    }
}

@media (max-width: 380px) {
    .ct-social__btn {
        width: 44px;
        height: 44px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ct-form-beam {
        animation: none;
    }

    .ct-card,
    .ct-social__btn,
    .ct-submit {
        transition: none !important;
    }

    .ct-card:hover,
    .ct-social__btn:hover,
    .ct-submit:hover {
        transform: none !important;
    }
}

/* ========================================
   PERSIAN / RTL
======================================== */

body.lang-persian .bargtunes-contact-section.ct-section,
body.rtl .bargtunes-contact-section.ct-section {
    font-family: ModamWeb, 'Vazirmatn', sans-serif;
    direction: rtl;
}

body.lang-persian .bargtunes-contact-section.ct-section :where(
    .ct-label,
    .ct-headline,
    .ct-headline__line,
    .ct-desc,
    .ct-card,
    .ct-card__label,
    .ct-card__value,
    .ct-form-title,
    .ct-field__label,
    .ct-input,
    .ct-submit,
    .ct-submit__text
),
body.rtl .bargtunes-contact-section.ct-section :where(
    .ct-label,
    .ct-headline,
    .ct-headline__line,
    .ct-desc,
    .ct-card,
    .ct-card__label,
    .ct-card__value,
    .ct-form-title,
    .ct-field__label,
    .ct-input,
    .ct-submit,
    .ct-submit__text
) {
    font-family: ModamWeb, 'Vazirmatn', sans-serif;
}

body.lang-persian .bargtunes-contact-section.ct-section :is(
    .ct-label,
    .ct-form-title,
    .ct-card__label,
    .ct-submit
),
body.rtl .bargtunes-contact-section.ct-section :is(
    .ct-label,
    .ct-form-title,
    .ct-card__label,
    .ct-submit
) {
    letter-spacing: 0;
    text-transform: none;
}

/* Headline FA — h2 + inner spans (Poppins must not stay in stack) */
body.lang-persian .bargtunes-contact-section h2.ct-headline,
body.lang-persian .bargtunes-contact-section h2.ct-headline .ct-headline__line,
body.rtl .bargtunes-contact-section h2.ct-headline,
body.rtl .bargtunes-contact-section h2.ct-headline .ct-headline__line,
.bargtunes-contact-section[lang="fa-IR"] h2.ct-headline,
.bargtunes-contact-section[lang="fa-IR"] h2.ct-headline .ct-headline__line,
.ct-headline--fa,
.ct-headline--fa .ct-headline__line {
    font-family: ModamWeb, 'Vazirmatn', sans-serif !important;
    font-weight: 700 !important;
    font-synthesis: none;
    letter-spacing: 0 !important;
    text-transform: none !important;
    line-height: 1.2;
}

body.lang-persian .bargtunes-contact-section .ct-form-title,
body.rtl .bargtunes-contact-section .ct-form-title,
.bargtunes-contact-section[lang="fa-IR"] .ct-form-title {
    font-family: ModamWeb, 'Vazirmatn', sans-serif !important;
    font-weight: 600;
}

body.lang-persian .bargtunes-contact-section .ct-left,
body.rtl .bargtunes-contact-section .ct-left {
    text-align: right;
    align-items: flex-start;
}

body.lang-persian .bargtunes-contact-section .ct-form-inner,
body.rtl .bargtunes-contact-section .ct-form-inner {
    text-align: right;
}

body.lang-persian .bargtunes-contact-section .ct-input,
body.lang-persian .bargtunes-contact-section .ct-input--area,
body.rtl .bargtunes-contact-section .ct-input,
body.rtl .bargtunes-contact-section .ct-input--area {
    text-align: right;
}

body.lang-persian .bargtunes-contact-section .ct-card__value,
body.rtl .bargtunes-contact-section .ct-card__value {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: left;
}

@media (max-width: 900px) {
    body.lang-persian .bargtunes-contact-section .ct-left,
    body.rtl .bargtunes-contact-section .ct-left {
        align-items: center;
        text-align: center;
    }

    body.lang-persian .bargtunes-contact-section .ct-card__value,
    body.rtl .bargtunes-contact-section .ct-card__value {
        text-align: center;
    }
}

/* Fallback — no JS */
.no-js .ct-left > *,
.no-js .ct-form-shell,
body:not(.js-loaded) .ct-left > *,
body:not(.js-loaded) .ct-form-shell {
    opacity: 1 !important;
    transform: none !important;
}
