/* ═══════════════════════════════════════════════════════════════
   فرم «همکاری با ما» (Pages/Shared/Components/CooperationForm) و صفحه‌ی /cooperation
   ═══════════════════════════════════════════════════════════════ */

.cof, .cop {
    --cof-red: #d71921;
    --cof-red-dark: #b3141b;
    --cof-ink: #16191d;
    --cof-body: #4b5563;
    --cof-mute: #8a939e;
    --cof-line: #e3e6ea;
    --cof-soft: #f6f7f8;
    --cof-ok: #15803d;
    --cof-radius: 14px;
}

/* اندازه‌ها مستقل از CSS صفحه‌ی میزبان (صفحه‌ی ساخته‌شده در پنل یا /cooperation) */
.cof, .cof *, .cof *::before, .cof *::after, .cop, .cop * { box-sizing: border-box; }

/* ─── بخش فرم ─── */
.cof {
    margin: 48px 0 8px;
    padding: clamp(20px, 4vw, 40px);
    border: 1px solid var(--cof-line);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff 0%, #fbfbfc 100%);
    box-shadow: 0 24px 48px -32px rgba(22, 25, 29, .25);
    scroll-margin-top: 90px;
}

.cof-head { margin-bottom: 24px; }
.cof-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--cof-red); font-size: .8rem; font-weight: 700; }
.cof-kicker::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.cof-title { margin: 8px 0 6px; color: var(--cof-ink); font-size: clamp(1.2rem, 2.4vw, 1.5rem); font-weight: 800; line-height: 1.5; }
.cof-lead { margin: 0; color: var(--cof-body); font-size: .92rem; line-height: 1.9; }

.cof-alert {
    margin-bottom: 18px; padding: 12px 16px; border-radius: 12px;
    background: #fff4f4; border: 1px solid #f6c9cb; color: #a3141a; font-size: .88rem; line-height: 1.8;
}

/* ─── نوع همکاری ─── */
.cof-kinds { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.cof-kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; }

.cof-kind { position: relative; display: block; cursor: pointer; text-decoration: none; color: inherit; }
.cof-kind input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cof-kind-box {
    display: flex; flex-direction: column; gap: 4px; height: 100%;
    padding: 14px 16px; border: 1.5px solid var(--cof-line); border-radius: var(--cof-radius); background: #fff;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.cof-kind-box b { color: var(--cof-ink); font-size: .92rem; font-weight: 700; }
.cof-kind-box small { color: var(--cof-mute); font-size: .76rem; line-height: 1.7; }
.cof-kind:hover .cof-kind-box { border-color: #c9ced6; }
.cof-kind input:checked + .cof-kind-box { border-color: var(--cof-red); background: #fff7f7; box-shadow: 0 0 0 3px rgba(215, 25, 33, .1); }
.cof-kind input:checked + .cof-kind-box b { color: var(--cof-red); }
.cof-kind input:focus-visible + .cof-kind-box { outline: 2px solid var(--cof-red); outline-offset: 2px; }
.cof-kind--link .cof-kind-box { border-style: dashed; background: var(--cof-soft); }
.cof-kind--link:hover .cof-kind-box { border-color: var(--cof-red); }
.cof-kind--link small { color: var(--cof-red); }

/* ─── فیلدها ─── */
.cof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.cof-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cof-field--wide { grid-column: 1 / -1; }
.cof-field[hidden] { display: none; }

/* با جاوااسکریپت: تا نوع همکاری انتخاب نشده، فیلدهای وابسته پنهان‌اند */
.cof-js:not(.has-kind) [data-cof-for] { display: none; }

.cof-label { color: var(--cof-ink); font-size: .85rem; font-weight: 700; }
.cof-req { color: var(--cof-red); }
.cof-opt { color: var(--cof-mute); font-weight: 400; font-size: .78rem; }

.cof-input {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--cof-line); border-radius: 12px; background: #fff;
    color: var(--cof-ink); font: inherit; font-size: .92rem; line-height: 1.7;
    transition: border-color .2s, box-shadow .2s;
}
textarea.cof-input { resize: vertical; min-height: 120px; }
.cof-input:focus { outline: none; border-color: var(--cof-red); box-shadow: 0 0 0 3px rgba(215, 25, 33, .12); }
.cof-ltr { direction: ltr; text-align: left; }
.cof-ltr::placeholder { text-align: left; }
.is-invalid .cof-kind-box, .cof-input.is-invalid, .cof-file.is-invalid { border-color: var(--cof-red); }
.cof-error { color: var(--cof-red); font-size: .78rem; line-height: 1.7; }

/* ─── رزومه ─── */
.cof-file {
    position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 6px; border: 1.5px dashed var(--cof-line); border-radius: 12px; background: var(--cof-soft); cursor: pointer;
}
.cof-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cof-file:focus-within { border-color: var(--cof-red); }
.cof-file-btn { flex: 0 0 auto; padding: 7px 14px; border-radius: 9px; background: var(--cof-ink); color: #fff; font-size: .8rem; font-weight: 700; }
.cof-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cof-body); font-size: .82rem; }

/* ─── تله‌ی ربات ─── */
.cof-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── رضایت و ارسال ─── */
.cof-consent { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 4px; color: var(--cof-body); font-size: .85rem; line-height: 1.8; cursor: pointer; }
.cof-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 4px; accent-color: var(--cof-red); }

.cof-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }
.cof-submit {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 13px 26px; border: 0; border-radius: 12px; background: var(--cof-red); color: #fff;
    font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 12px 24px -12px rgba(215, 25, 33, .6);
    transition: background-color .2s, transform .2s, box-shadow .2s;
}
.cof-submit:hover { background: var(--cof-red-dark); transform: translateY(-1px); }
.cof-submit:focus-visible { outline: 2px solid var(--cof-ink); outline-offset: 3px; }
.cof-submit.is-busy { opacity: .7; cursor: progress; transform: none; }
.cof-submit.is-busy svg { animation: cof-nudge .8s ease-in-out infinite alternate; }
.cof-note { color: var(--cof-mute); font-size: .78rem; }

@keyframes cof-nudge { to { transform: translateX(-4px); } }

@media (max-width: 640px) {
    .cof { margin-top: 32px; border-radius: 16px; }
    .cof-grid { grid-template-columns: 1fr; }
    .cof-submit { width: 100%; justify-content: center; }
}

/* ═══ صفحه‌ی /cooperation ═══ */
.cop { padding: clamp(24px, 5vw, 56px) 16px 64px; background: var(--cof-soft, #f6f7f8); }
.cop-shell { max-width: 880px; margin: 0 auto; }
.cop-title { margin: 0 0 4px; color: #16191d; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
.cop .cof { margin-top: 18px; background: #fff; }
.cop-back { display: inline-flex; gap: 6px; margin-top: 18px; color: #4b5563; font-size: .88rem; text-decoration: none; }
.cop-back:hover { color: #d71921; }

.cop-done {
    padding: clamp(28px, 5vw, 48px); border: 1px solid #e3e6ea; border-radius: 20px; background: #fff; text-align: center;
    box-shadow: 0 24px 48px -32px rgba(22, 25, 29, .25);
}
.cop-done-icon {
    display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 14px;
    border-radius: 50%; background: #ecfdf3; color: #15803d;
    animation: cop-pop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.cop-done-title { margin: 0 0 8px; color: #16191d; font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 800; }
.cop-done-text, .cop-done-hint { margin: 0 auto; max-width: 52ch; color: #4b5563; font-size: .92rem; line-height: 1.9; }
.cop-done-hint { margin-top: 10px; color: #8a939e; font-size: .82rem; }
.cop-code {
    display: inline-flex; flex-direction: column; gap: 4px; margin-top: 20px; padding: 14px 28px;
    border: 1.5px dashed #d71921; border-radius: 14px; background: #fff7f7;
}
.cop-code span { color: #8a939e; font-size: .78rem; }
.cop-code b { color: #d71921; font-size: 1.6rem; font-weight: 800; letter-spacing: .12em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@keyframes cop-pop { from { transform: scale(.4); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .cof-kind-box, .cof-input, .cof-submit { transition: none; }
    .cof-submit.is-busy svg, .cop-done-icon { animation: none; }
}
