/* ==========================================================================
   İletişim sayfası. Bootstrap/design-system-v3 bu sayfada yüklenmez; form
   kontrolleri, uyarılar ve intl-tel-input teması burada .tn.ct altında.
   JS (js/pages/contact.js) yalnızca .ct-stage'in `data-active` + `style` (--w/--f)
   ile .ct-card'ın `data-sent` attribute'unu yazar.
   ========================================================================== */

.tn.ct { --ct-bad: #ff8d7a; --ct-field: #121212; --ct-field-line: rgba(236, 235, 230, .2); }

.ct-main { padding-bottom: clamp(64px, 12vh, 140px); }
.ct-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(28px, 4vw, 72px); align-items: start; }

/* ----------------------------- Form ----------------------------- */
.ct-formcol { min-width: 0; }
.ct-form { display: flex; flex-direction: column; gap: 22px; }
.ct-form-h { font-size: clamp(26px, 2.6vw, 40px); font-weight: 300; letter-spacing: -0.04em; line-height: 1.05; }
.ct-form-sub { margin-top: -10px; color: var(--tn-mute); font-size: 15px; line-height: 1.5; }
.ct-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.ct-field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ct-field > label, .ct-label {
    font-family: var(--tn-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--tn-mute);
}
.ct-req { margin-left: 4px; color: var(--tn-amber); }

.ct-input {
    display: block; width: 100%; min-height: 52px; padding: 14px 16px;
    border: 1px solid var(--ct-field-line); border-radius: 14px;
    background: var(--ct-field); color: var(--tn-bone);
    font: 400 16px/1.4 var(--tn-sans); letter-spacing: 0;
    -webkit-appearance: none; appearance: none;
    transition: border-color .2s ease, background-color .2s ease;
}
.ct-input::placeholder { color: rgba(236, 235, 230, .38); opacity: 1; }
.ct-input:hover { border-color: rgba(236, 235, 230, .36); }
.ct-input:focus { border-color: var(--tn-amber); }
.ct-input:focus-visible { outline: 2px solid var(--tn-amber); outline-offset: 2px; }
.ct-input:user-invalid { border-color: var(--ct-bad); }
.ct-textarea { min-height: 168px; resize: vertical; }
.ct-input:-webkit-autofill { -webkit-text-fill-color: var(--tn-bone); box-shadow: 0 0 0 100px var(--ct-field) inset; caret-color: var(--tn-bone); }

/* Proje türü çipleri */
.ct-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ct-chip {
    min-height: 44px; padding: 0 18px; border-radius: 999px;
    border: 1px solid var(--ct-field-line); background: transparent; color: var(--tn-bone);
    font: 400 15px/1.2 var(--tn-sans); letter-spacing: -0.005em; text-align: left;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.ct-chip:hover { border-color: rgba(236, 235, 230, .5); }
.ct-chip[aria-pressed="true"] { background: var(--tn-amber); border-color: var(--tn-amber); color: var(--tn-ink); }
.ct-chip:focus-visible { outline: 2px solid var(--tn-amber); outline-offset: 3px; }

/* Onay */
.ct-consent { display: flex; flex-direction: column; gap: 6px; }
.ct-note { font-size: 13px; line-height: 1.6; color: var(--tn-mute); }
.ct-note a, .ct-check a { border-bottom: 1px solid currentColor; }
.ct-note a:hover, .ct-check a:hover { color: var(--tn-amber); }
.ct-check { display: flex; align-items: flex-start; gap: 14px; min-height: 44px; padding: 8px 0; cursor: pointer; font-size: 14px; line-height: 1.55; color: var(--tn-mute); }
.ct-check input {
    flex: none; width: 24px; height: 24px; margin: 0; margin-top: 1px; display: grid; place-content: center;
    border: 1px solid var(--ct-field-line); border-radius: 7px; background: var(--ct-field);
    -webkit-appearance: none; appearance: none; cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}
.ct-check input::after { content: ""; width: 11px; height: 6px; margin-top: -2px; border-left: 2px solid var(--tn-ink); border-bottom: 2px solid var(--tn-ink); transform: rotate(-45deg) scale(0); transition: transform .15s ease; }
.ct-check input:checked { background: var(--tn-amber); border-color: var(--tn-amber); }
.ct-check input:checked::after { transform: rotate(-45deg) scale(1); }
.ct-check input:focus-visible { outline: 2px solid var(--tn-amber); outline-offset: 3px; }

.ct-submit { align-self: flex-start; margin-top: 4px; }
.ct-submit:focus-visible { outline: 2px solid var(--tn-bone); outline-offset: 3px; }
.ct-submit:disabled { opacity: .6; cursor: progress; }

/* App.razor'daki jQuery işleyicisi `.form-message` içine bootstrap sınıflı uyarı basar. */
.ct-msg:empty { display: none; }
.ct-msg { margin-bottom: 22px; }
.ct .alert {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 16px 8px 16px 20px; border: 1px solid var(--tn-line); border-radius: 14px;
    font-size: 15px; line-height: 1.5; color: var(--tn-bone);
}
.ct .alert-success { border-color: rgba(255, 125, 34, .55); background: var(--tn-amber-soft); }
.ct .alert-danger { border-color: rgba(255, 141, 122, .55); background: rgba(255, 141, 122, .1); }
.ct .alert .msg-text { padding-top: 10px; padding-bottom: 10px; }
.ct .alert .btn-close {
    position: relative; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: inherit; font-size: 0; opacity: .7;
}
.ct .alert .btn-close::before { content: "\00d7"; font-size: 26px; line-height: 44px; display: block; text-align: center; }
.ct .alert .btn-close:hover { opacity: 1; }
.ct .alert .btn-close:focus-visible { outline: 2px solid var(--tn-amber); outline-offset: 0; opacity: 1; }

/* intl-tel-input (v17) koyu tema. Açılır liste mobilde body altına taşınabilir → .ct'ye bağlı olmayan seçici. */
.ct .iti { display: block; width: 100%; }
.ct .iti__selected-flag { border-radius: 14px 0 0 14px; background: transparent; }
.ct .iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag,
.ct .iti__selected-flag:focus { background: rgba(236, 235, 230, .06); }
.ct .iti__selected-flag:focus-visible { outline: 2px solid var(--tn-amber); outline-offset: -2px; }
.ct .iti__selected-dial-code { color: var(--tn-bone); }
.ct .iti__arrow { border-top-color: var(--tn-mute); }
.ct .iti__arrow--up { border-top-color: transparent; border-bottom-color: var(--tn-mute); }
body:has(.tn.ct) .iti__country-list {
    background: #161616; color: var(--tn-bone); border: 1px solid var(--tn-line); border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .65); max-height: 264px;
}
body:has(.tn.ct) .iti__country { padding: 11px 12px; min-height: 44px; display: flex; align-items: center; }
body:has(.tn.ct) .iti__country.iti__highlight, body:has(.tn.ct) .iti__country:hover { background: rgba(255, 125, 34, .14); }
body:has(.tn.ct) .iti__divider { border-bottom-color: var(--tn-line); }
body:has(.tn.ct) .iti__dial-code { color: var(--tn-mute); }

/* ----------------------------- Brief özeti ----------------------------- */
.ct-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ct-card { position: relative; padding: 22px 24px 24px; border-radius: 22px; background: var(--tn-ink-2); overflow: hidden; }
.ct-card::before {
    content: ""; position: absolute; width: 70%; aspect-ratio: 1; right: -22%; top: -30%; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 125, 34, .2), transparent); opacity: 0; transition: opacity .8s ease; pointer-events: none;
}
.ct-card[data-sent="1"]::before { opacity: 1; }
.ct-card-top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--tn-mute); }
.ct-status { display: inline-flex; align-items: center; gap: 8px; color: var(--tn-bone); }
.ct-light { width: 7px; height: 7px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1px var(--tn-mute); transition: background-color .4s ease, box-shadow .4s ease; }
.ct-st-on { display: none; color: var(--tn-amber); }
.ct-card[data-sent="1"] .ct-st-on { display: inline; }
.ct-card[data-sent="1"] .ct-st-off { display: none; }
.ct-card[data-sent="1"] .ct-light { background: var(--tn-amber); box-shadow: 0 0 10px 1px var(--tn-amber); }

/* Sahne: on iki proje çizimi (ProjectDrawing, 400×300) üst üste; yalnızca `data-active` olan render
   edilir. Teller --w ile çizilir (pathLength=1 + sırayla artan --o), yüzeyler gönderim başarısında
   --f ile aynı sırayla dolar. --w/--f verilmezse çizim tam görünür (JS'siz). */
.ct-stage { --w: 1; --f: 0; position: relative; aspect-ratio: 4 / 3; margin: 6px 0 4px; }
.ct-bp { display: none; position: absolute; inset: 0; }
.ct-stage[data-active="web"] [data-kind="web"],
.ct-stage[data-active="mobile"] [data-kind="mobile"],
.ct-stage[data-active="game"] [data-kind="game"],
.ct-stage[data-active="api"] [data-kind="api"],
.ct-stage[data-active="crm"] [data-kind="crm"],
.ct-stage[data-active="erp"] [data-kind="erp"],
.ct-stage[data-active="database"] [data-kind="database"],
.ct-stage[data-active="analysis"] [data-kind="analysis"],
.ct-stage[data-active="planning"] [data-kind="planning"],
.ct-stage[data-active="cloud"] [data-kind="cloud"],
.ct-stage[data-active="ai"] [data-kind="ai"],
.ct-stage[data-active="other"] [data-kind="other"] { display: block; }

.pd { display: block; width: 100%; height: 100%; overflow: visible; }
.pd path { stroke-linecap: round; stroke-linejoin: round; }
.pd-ln, .pd-acc, .pd-dim {
    fill: none; stroke-width: 1.4;
    stroke-dasharray: 1 1;
    stroke-dashoffset: calc(1 - clamp(0, (var(--w) - var(--o, 0)) / (1 - var(--o, 0)), 1));
}
.pd-ln { stroke: rgba(236, 235, 230, .8); }
.pd-acc { stroke: var(--tn-amber); stroke-width: 1.6; }
.pd-dim { stroke: rgba(255, 125, 34, .7); stroke-width: 1; }
.pd-plus { fill: none; stroke: rgba(236, 235, 230, .5); stroke-width: 1; opacity: clamp(0, calc(var(--w) * 4), 1); }
.pd-ghost { fill: none; stroke: rgba(236, 235, 230, .45); stroke-width: 1; stroke-dasharray: 3 6; opacity: calc(1 - var(--w)); }
.pd text { font-family: var(--tn-mono); font-size: 12px; letter-spacing: .04em; opacity: clamp(0, calc((var(--w) - .45) * 3), 1); }
.pd-lbl { fill: var(--tn-amber); }
.pd-tx { fill: var(--tn-bone); }
.pd-mu { fill: var(--tn-mute); font-size: 10px; }
.pd .pd-gl { fill: var(--tn-bone); font-size: 26px; letter-spacing: 0; }
.pd-sf { fill: var(--tn-amber); opacity: calc(clamp(0, (var(--f) - var(--o, 0)) * 3, 1) * .24); }
.pd-fill > * { opacity: clamp(0, calc((var(--w) - .5) * 3), 1); }
.pd-dot { fill: rgba(236, 235, 230, .8); }
.pd-am { fill: var(--tn-amber); }
.pd-prog { fill: rgba(255, 125, 34, .5); }
.pd-faint { fill: none; stroke: rgba(236, 235, 230, .08); stroke-width: 1; }
.pd-grid { fill: rgba(236, 235, 230, .28); }
.pd-dash { fill: none; stroke: var(--tn-amber); stroke-width: 1.2; stroke-dasharray: 3 5; }
/* Ürün oturunca: ölçüler çekilir, teller biraz söner, yüzeyler kalır. */
.pd-frame { opacity: calc(1 - var(--f) * .7); }
.pd-wire { opacity: calc(1 - var(--f) * .25); }

/* Canlı ayrıntılar: çizim bitmeye yakın belirir, kısa oynar ve son durumda kalır (sürekli döngü yok).
   Varsayılan (animasyonsuz) hâl = son durum; geçici parçalar (paket, halka) varsayılan görünmez. */
.pd-live { opacity: clamp(0, calc((var(--w) - .9) * 10), 1); }
.pd-a > * { transform-box: fill-box; transform-origin: center; }
.pd-pk { fill: var(--tn-amber); opacity: 0; }
.pd-ring { fill: none; stroke: var(--tn-amber); stroke-width: 1.4; opacity: 0; }
.pd-cur { fill: var(--tn-ink-2); stroke: var(--tn-bone); stroke-width: 1.2; }
.pd-px { fill: var(--tn-bone); }
.pd-coin { fill: none; stroke: var(--tn-amber); stroke-width: 1.6; }
.pd-hl { fill: rgba(255, 125, 34, .16); stroke: var(--tn-amber); stroke-width: 1; }
.pd-glass { fill: none; stroke: var(--tn-amber); stroke-width: 1.6; }
.pd-led { fill: var(--tn-amber); }
.pd-node { fill: var(--tn-amber); }
.pd-caret { fill: var(--tn-amber); }
.pd-spark { fill: none; stroke: var(--tn-amber); stroke-width: 1.4; }

@media (prefers-reduced-motion: no-preference) {
    .pd-a-cursor > * { animation: pd-cursor .9s var(--tn-ease) 1s both; }
    .pd-a-click > *, .pd-a-tap > * { animation: pd-ring .7s ease-out 1.75s 2; }
    .pd-a-tap > * { animation-delay: 1.1s; animation-duration: .9s; }
    .pd-a-hop > * { animation: pd-hop .55s cubic-bezier(.3, 0, .4, 1) 1.1s 2; }
    .pd-a-coin > * { animation: pd-spin .5s linear 1.2s 2; }
    .pd-a-req > * { --dx: 36px; animation: pd-go .55s ease-in-out 1.1s 2; }
    .pd-a-fan > * { --dx: 32px; animation: pd-go .45s ease-in-out 1.5s 2; }
    .pd-a-res > * { --dx: -34px; animation: pd-go .55s ease-in-out 1.85s 2; }
    .pd-a-drop > * { --dy: 160px; animation: pd-drop 1.2s cubic-bezier(.4, 0, .7, 1) 1.1s 2; }
    .pd-a-drop > :nth-child(2) { animation-delay: 1.3s; }
    .pd-a-drop > :nth-child(3) { animation-delay: 1.5s; }
    .pd-a-up > * { --dy: -32px; animation: pd-go .6s ease-in-out 1.1s 2; }
    .pd-a-down > * { --dy: 32px; animation: pd-go .6s ease-in-out 1.4s 2; }
    .pd-a-scan > * { animation: pd-scan 1.1s steps(1, end) 1.05s both; }
    .pd-a-lens > * { animation: pd-lens 1.1s var(--tn-ease) .9s both; }
    .pd-a-grow > * { transform-origin: left center; animation: pd-grow 1.2s var(--tn-ease) 1s both; }
    .pd-a-led > * { animation: pd-blink 1.2s steps(2, jump-none) 1.1s 3; }
    .pd-a-led > :nth-child(2) { animation-delay: 1.5s; }
    .pd-a-led > :nth-child(3) { animation-delay: 1.9s; }
    .pd-a-fire > * { opacity: 0; animation: pd-fire 1.6s ease-out 1.1s 2; }
    .pd-a-fire > :nth-child(2) { animation-delay: 1.3s; }
    .pd-a-fire > :nth-child(3) { animation-delay: 1.5s; }
    .pd-a-fire > :nth-child(4) { animation-delay: 1.7s; }
    .pd-a-caret > * { animation: pd-blink 1s steps(2, jump-none) 1.1s 4; }
    .pd-a-spark > * { animation: pd-twinkle .8s var(--tn-ease) 1.1s 2; }
    .pd-a-spark > :nth-child(2) { animation-delay: 1.35s; }
}
@keyframes pd-cursor { from { transform: translate(120px, 64px); } }
@keyframes pd-ring { from { opacity: .9; transform: scale(.3); } to { opacity: 0; transform: scale(1.5); } }
@keyframes pd-hop { 50% { transform: translateY(-16px); } }
@keyframes pd-spin { 50% { transform: scaleX(.15); } }
@keyframes pd-go { 0% { opacity: 0; transform: none; } 15%, 85% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)); } }
@keyframes pd-drop { 0% { opacity: 0; transform: none; } 15% { opacity: 1; } 80% { opacity: 1; transform: translateY(calc(var(--dy) * .9)) scale(.7); } 100% { opacity: 0; transform: translateY(var(--dy)) scale(.5); } }
@keyframes pd-scan { 0% { transform: translateY(-48px); } 30% { transform: translateY(-24px); } 60% { transform: translateY(24px); } 80% { transform: none; } }
@keyframes pd-lens { from { transform: translate(-96px, 70px); } }
@keyframes pd-grow { from { transform: scaleX(0); } }
@keyframes pd-blink { 50% { opacity: .15; } }
@keyframes pd-fire { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(1); } }
@keyframes pd-twinkle { 40% { transform: scale(1.35) rotate(15deg); } }

.ct-type { position: relative; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding-top: 16px; border-top: 1px solid var(--tn-line); color: var(--tn-mute); }
.ct-type b { font-weight: 400; color: var(--tn-bone); text-transform: none; letter-spacing: .02em; font-size: 13px; overflow-wrap: anywhere; }
.ct-sent { display: none; position: relative; margin-top: 14px; font-size: 15px; line-height: 1.5; color: var(--tn-bone); }
.ct-card[data-sent="1"] .ct-sent { display: block; }

.ct-info { padding: 22px 24px; border-radius: 22px; border: 1px solid var(--tn-line); }
.ct-info-h { color: var(--tn-amber); margin-bottom: 8px; font-size: 11px; }
.ct-info li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 4px 16px; align-items: baseline; padding: 13px 0; border-top: 1px solid var(--tn-line); }
.ct-info li:first-child { border-top: 0; }
.ct-info li > .tn-mono { color: var(--tn-mute); font-size: 11px; }
.ct-info a, .ct-info address, .ct-info p { font-style: normal; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.ct-info a { display: inline-block; padding: 8px 0; margin: -8px 0; transition: color .2s; }
.ct-info a:hover { color: var(--tn-amber); }

.ct-map { margin-top: clamp(28px, 5vw, 56px); height: clamp(260px, 36vw, 400px); border-radius: 22px; overflow: hidden; background: var(--tn-ink-2); }
.ct-map iframe { display: block; width: 100%; height: 100%; border: 0; filter: grayscale(1) invert(.92) contrast(.88); }

/* ----------------------------- Duyarlı ----------------------------- */
@media (min-width: 901px) and (min-height: 760px) {
    .ct-side { position: sticky; top: 92px; }
}
@media (max-width: 900px) {
    .ct-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    /* Aside kutusu kalkar: çizim kartı formun üstüne, iletişim bilgisi altına sıralanır. */
    .ct-side { display: contents; }
    .ct-card { order: -1; padding: 16px 18px 18px; }
    .ct-formcol { order: 0; }
    .ct-info { order: 1; }
    /* Kart formun üstünde: çizim ekranı kaplamasın. */
    .ct-stage { max-height: min(340px, 46vh); margin: 2px auto; }
    .ct-sent { margin-top: 10px; }
}
@media (max-width: 640px) {
    .ct-row { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .ct-submit { align-self: stretch; }
    .ct-info li { grid-template-columns: minmax(0, 1fr); }
    /* Sahne ~.6 ölçekte: ince teller ve etiketler kaybolmasın. */
    .pd-ln, .pd-acc { stroke-width: 2; }
    .pd text { font-size: 14px; }
    .pd .pd-gl { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    .ct *, .ct *::before, .ct *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
