/* Contact form dialog (assets/js/contact-form.js) — website and console. */
.cf-overlay {
    --cf-accent: var(--k-primary, var(--mc-accent, #0A5BD3));
    --cf-ink: #161a23; --cf-muted: #667085; --cf-line: #dfe3ea; --cf-bg: #fff; --cf-soft: #f4f6f9; --cf-bad: #c8102e;
    position: fixed; inset: 0; z-index: 10000; background: rgba(12, 14, 20, .55); backdrop-filter: blur(3px);
    display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 6vh 16px 24px;
    font-family: var(--k-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
}
.cf-overlay[hidden] { display: none; }
html.cf-open { overflow: hidden; }
.cf-card {
    position: relative; width: 100%; max-width: 560px; background: var(--cf-bg); color: var(--cf-ink);
    border-radius: 18px; padding: 30px 30px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .28); text-align: left;
    animation: cf-in .18s ease-out;
}
@keyframes cf-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.cf-card h2 { font: 700 24px/1.2 var(--k-font-head, inherit); margin: 0 36px 6px 0; color: var(--cf-ink); letter-spacing: -.01em; }
.cf-sub { margin: 0 0 20px; color: var(--cf-muted); font-size: 15px; line-height: 1.5; }
.cf-close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--cf-muted); font-size: 26px; line-height: 1; cursor: pointer; }
.cf-close:hover { background: var(--cf-soft); color: var(--cf-ink); }
.cf-form[hidden], .cf-done[hidden], .cf-sub[hidden] { display: none; }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cf-field { margin-bottom: 14px; }
.cf-field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--cf-ink); }
.cf-field input, .cf-field textarea, .cf-cc {
    width: 100%; box-sizing: border-box; font-size: 15px; line-height: 1.4; font-family: inherit; color: var(--cf-ink); background: var(--cf-bg);
    border: 1px solid var(--cf-line); border-radius: 10px; padding: 10px 12px; min-height: 44px; margin: 0; box-shadow: none;
}
.cf-field textarea { resize: vertical; min-height: 104px; }
.cf-field input:focus, .cf-field textarea:focus, .cf-cc:focus, .cf-cc-search:focus { outline: none; border-color: var(--cf-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cf-accent) 20%, transparent); }
.cf-field.has-err input, .cf-field.has-err textarea, .cf-field.has-err .cf-cc { border-color: var(--cf-bad); }
.cf-err { color: var(--cf-bad); font-size: 13px; margin-top: 5px; min-height: 0; }
.cf-err:empty { display: none; }
.cf-hint { color: var(--cf-muted); font-size: 12.5px; margin-top: 4px; }
.cf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.cf-phone { display: flex; gap: 8px; }
.cf-phone > input { flex: 1; min-width: 0; }
.cf-cc-wrap { position: relative; flex: 0 0 auto; }
.cf-cc { display: inline-flex; align-items: center; gap: 6px; width: auto; cursor: pointer; white-space: nowrap; padding: 10px 10px; }
.cf-flag { font-size: 18px; line-height: 1; }
.cf-caret { color: var(--cf-muted); font-size: 11px; }
.cf-cc-pop { position: absolute; z-index: 2; top: calc(100% + 6px); left: 0; width: 300px; max-width: calc(100vw - 64px); background: var(--cf-bg); border: 1px solid var(--cf-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .16); padding: 8px; }
.cf-cc-pop[hidden] { display: none; }
.cf-cc-search { width: 100%; box-sizing: border-box; border: 1px solid var(--cf-line); border-radius: 8px; padding: 8px 10px; font-size: 14px; font-family: inherit; color: var(--cf-ink); background: var(--cf-bg); margin: 0 0 6px; }
.cf-cc-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.cf-cc-list li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--cf-ink); }
.cf-cc-list li.on, .cf-cc-list li:hover { background: var(--cf-soft); }
.cf-cc-list li[aria-selected=true] { font-weight: 600; }
.cf-cc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-cc-dial { color: var(--cf-muted); font-variant-numeric: tabular-nums; }
.cf-cc-none { color: var(--cf-muted); cursor: default !important; }

.cf-status:empty { display: none; }
.cf-status { border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.cf-status.bad { background: color-mix(in srgb, var(--cf-bad) 8%, transparent); color: var(--cf-bad); }
.cf-actions { display: flex; justify-content: flex-end; }
.cf-submit {
    border: 0; border-radius: 10px; background: var(--cf-accent); color: #fff; font-weight: 600; font-size: 15px; font-family: inherit;
    padding: 0 22px; height: 46px; min-width: 120px; cursor: pointer; transition: filter .15s;
}
.cf-submit:hover { filter: brightness(1.07); }
.cf-submit:disabled { opacity: .6; cursor: default; }
.cf-privacy { margin: 14px 0 0; font-size: 12.5px; color: var(--cf-muted); }
.cf-privacy a { color: inherit; text-decoration: underline; }
.cf-done { text-align: center; padding: 10px 0 8px; }
.cf-done h3 { font: 700 20px var(--k-font-head, inherit); margin: 12px 0 6px; color: var(--cf-ink); }
.cf-done p { color: var(--cf-muted); margin: 0 auto 20px; max-width: 400px; line-height: 1.5; }
.cf-check { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; background: var(--cf-accent); }

@media (prefers-color-scheme: dark) {
    html[data-theme=dark] .cf-overlay, .cf-overlay.cf-dark { --cf-ink: #eef0f4; --cf-muted: #a2aab8; --cf-line: #2f3542; --cf-bg: #171a21; --cf-soft: #222732; }
}
@media (max-width: 560px) {
    .cf-overlay { padding: 0; align-items: stretch; }
    .cf-card { border-radius: 0; min-height: 100%; padding: 24px 16px 20px; }
    .cf-grid { grid-template-columns: 1fr; }
    .cf-submit { width: 100%; }
}
