/* Hipernet KYC - Yönerge / animasyon katmanı + dil seçici + RTL
   create_ocr.blade.php içindeki :root değişkenlerini kullanır (fallback'li). */

:root {
    --kg-p: var(--p, #4f46e5);
    --kg-ps: var(--ps, #7c3aed);
    --kg-card: var(--card, #ffffff);
    --kg-txt: var(--txt, #1e293b);
    --kg-muted: var(--muted, #94a3b8);
    --kg-border: var(--border, #e2e8f0);
    --kg-ok: var(--ok, #22c55e);
    --kg-lang-blue: #1b67bb;
    --kg-lang-orange: #ec751b;
}

/* ============ DİL SEÇİCİ (yalnızca intro adımı — üst şerit) ============ */
.kintro-lang-band .kyc-lang-picker,
.kintro-lang-mount .kyc-lang-picker {
    position: relative;
    display: flex;
    justify-content: flex-end;
    width: auto;
}
.kintro-lang-band .kyc-lang-picker-wrap {
    position: relative;
    z-index: 2;
}
.kintro-lang-band .kyc-lang-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    min-width: 96px;
    padding: 4px 10px;
    border: 1px solid var(--kg-border, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    color: var(--kg-txt, #1e293b);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.kintro-lang-band .kyc-lang-picker-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.kintro-lang-band .kyc-lang-picker-btn:focus-visible {
    outline: 2px solid var(--kg-lang-blue);
    outline-offset: 2px;
}
.kintro-lang-band .kyc-lang-picker-wrap.is-open .kyc-lang-picker-btn {
    background: #fff;
    border-color: var(--kg-lang-blue);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .1);
}
.kintro-lang-band .kyc-lang-picker-flag {
    font-size: 16px;
    line-height: 1;
}
.kintro-lang-band .kyc-lang-picker-code {
    min-width: 1.4em;
    text-align: center;
}
.kintro-lang-band .kyc-lang-picker-chevron {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--kg-lang-orange);
    margin-left: 1px;
    transition: transform .18s ease;
    flex-shrink: 0;
}
.kintro-lang-band .kyc-lang-picker-wrap.is-open .kyc-lang-picker-chevron {
    transform: rotate(180deg);
}
.kintro-lang-band .kyc-lang-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 180px;
    transform: none;
}
.kintro-lang-band .kyc-lang-picker-wrap.is-open .kyc-lang-picker-menu {
    transform: none;
}
.kyc-lang-picker-wrap {
    position: relative;
    z-index: 2;
}
.kyc-lang-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    min-width: 118px;
    padding: 8px 14px;
    border: 1.5px solid rgba(255, 255, 255, .42);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.kyc-lang-picker-btn:hover {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .58);
}
.kyc-lang-picker-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .75);
    outline-offset: 2px;
}
.kyc-lang-picker-wrap.is-open .kyc-lang-picker-btn {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .62);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
}
.kyc-lang-picker-flag {
    font-size: 18px;
    line-height: 1;
}
.kyc-lang-picker-code {
    min-width: 1.6em;
    text-align: center;
}
.kyc-lang-picker-chevron {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--kg-lang-orange);
    margin-left: 2px;
    transition: transform .18s ease;
    flex-shrink: 0;
}
.kyc-lang-picker-wrap.is-open .kyc-lang-picker-chevron {
    transform: rotate(180deg);
}
.kyc-lang-picker-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 196px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
    padding: 6px 0;
    z-index: 99999;
    overflow: hidden;
}
.kyc-lang-picker-menu[hidden] {
    display: none !important;
}
.kyc-lang-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.kyc-lang-picker-item:hover,
.kyc-lang-picker-item:focus-visible {
    background: #f1f5f9;
    outline: none;
}
.kyc-lang-picker-item.is-active {
    background: #eef5fc;
    color: var(--kg-lang-blue);
}
.kyc-lang-picker-item-flag {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.kyc-lang-picker-item-name {
    line-height: 1.2;
}
body.kyc-intro-dismissed .kintro-top,
body.kyc-intro-dismissed .kintro-lang-band,
body.kyc-flow-active .kintro-top,
body.kyc-flow-active .kintro-lang-band {
    display: none !important;
}

/* ============ YÖNERGE KARTI (Nasıl yapılır?) ============ */
.kyc-guide {
    max-width: 440px;
    margin: 0 auto 14px;
    width: 100%;
    border: 1px solid var(--kg-border);
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--kg-p) 5%, #fff), #fff);
    overflow: hidden;
}
.kyc-guide-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--kg-p);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 14px;
    cursor: pointer;
    text-align: start;
}
.kyc-guide-toggle .kg-q {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--kg-p);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.kyc-guide-toggle .kg-label { flex: 1 1 auto; }
.kyc-guide-toggle .kg-caret { transition: transform .2s; }
.kyc-guide.is-open .kyc-guide-toggle .kg-caret { transform: rotate(180deg); }

.kyc-guide-body {
    display: none;
    padding: 4px 16px 16px;
    animation: kgFade .25s ease;
}
.kyc-guide.is-open .kyc-guide-body { display: block; }

.kyc-guide-illus {
    display: flex;
    justify-content: center;
    margin: 6px auto 14px;
}
.kyc-guide-illus svg { width: 168px; height: 120px; max-width: 70%; }

.kyc-guide-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: kg;
}
.kyc-guide-step {
    position: relative;
    padding: 8px 0 8px 40px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--kg-txt);
    border-bottom: 1px dashed var(--kg-border);
}
.kyc-guide-step:last-child { border-bottom: 0; }
.kyc-guide-step::before {
    counter-increment: kg;
    content: counter(kg);
    position: absolute;
    inset-inline-start: 0;
    top: 7px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--kg-p) 12%, #fff);
    color: var(--kg-p);
    font-weight: 800;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.kyc-guide-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--kg-ok) 10%, #fff);
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}
.kyc-guide-tip i { margin-top: 1px; }

@keyframes kgFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ============ COACH OVERLAY ============ */
.kyc-coach-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    animation: kgFade .2s ease;
}
.kyc-coach-card {
    background: #fff;
    border-radius: 20px;
    max-width: 360px;
    width: 100%;
    padding: 22px 20px 18px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
}
.kyc-coach-card .kg-coach-illus { margin: 0 auto 12px; }
.kyc-coach-card h3 { font-size: 18px; font-weight: 800; margin: 0 0 6px; color: var(--kg-txt); }
.kyc-coach-card p { font-size: 14px; color: #475569; margin: 0 0 6px; line-height: 1.5; }
.kyc-coach-actions { margin-top: 14px; display: flex; gap: 10px; }
.kyc-coach-actions button {
    flex: 1;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--kg-border);
    background: #fff;
    color: var(--kg-txt);
}
.kyc-coach-actions .kg-coach-primary {
    border-color: var(--kg-p);
    background: var(--kg-p);
    color: #fff;
}

/* ============ SVG ANİMASYONLARI ============ */
.kg-scan-line { animation: kgScan 2.2s ease-in-out infinite; transform-origin: center; }
@keyframes kgScan { 0%,100% { transform: translateY(-22px); opacity: .25; } 50% { transform: translateY(22px); opacity: 1; } }

.kg-phone { animation: kgBob 2.4s ease-in-out infinite; transform-origin: center; }
@keyframes kgBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.kg-wave { transform-origin: center; animation: kgWave 1.8s ease-out infinite; }
.kg-wave.w2 { animation-delay: .35s; }
.kg-wave.w3 { animation-delay: .7s; }
@keyframes kgWave { 0% { opacity: .85; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.35); } }

.kg-face-oval { animation: kgOval 2s ease-in-out infinite; transform-origin: center; }
@keyframes kgOval { 0%,100% { stroke-opacity: .5; } 50% { stroke-opacity: 1; } }
.kg-face-turn { animation: kgTurn 3s ease-in-out infinite; transform-origin: center; }
@keyframes kgTurn { 0%,100% { transform: rotate(0deg); } 30% { transform: rotate(9deg); } 70% { transform: rotate(-9deg); } }

.kg-pin { animation: kgDrop 1.8s ease-in-out infinite; transform-origin: center bottom; }
@keyframes kgDrop { 0%,100% { transform: translateY(-6px); } 50% { transform: translateY(0); } }

.kg-dot { animation: kgBlink 1.4s ease-in-out infinite; }
.kg-dot.d2 { animation-delay: .2s; }
.kg-dot.d3 { animation-delay: .4s; }
@keyframes kgBlink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.kg-check { stroke-dasharray: 36; stroke-dashoffset: 36; animation: kgDraw 1.4s ease forwards infinite; }
@keyframes kgDraw { 0% { stroke-dashoffset: 36; } 60%,100% { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    .kg-scan-line, .kg-phone, .kg-wave, .kg-face-oval, .kg-face-turn, .kg-pin, .kg-dot, .kg-check { animation: none !important; }
    .kyc-lang-picker-chevron { transition: none; }
}

@media (max-width: 480px) {
    .kintro-lang-band .kyc-lang-picker-btn {
        min-height: 34px;
        padding: 4px 9px;
        gap: 5px;
        font-size: 12px;
        min-width: 88px;
    }
    .kintro-lang-band .kyc-lang-picker-menu {
        min-width: min(180px, 78vw);
    }
    .kyc-lang-picker-btn {
        min-height: 44px;
        padding: 8px 12px;
        gap: 7px;
        font-size: 13px;
    }
    .kyc-lang-picker-menu {
        min-width: min(196px, 88vw);
    }
    .kyc-lang-picker-item {
        padding: 11px 14px;
        font-size: 14px;
    }
}

/* ============ RTL (Arapça) ============ */
body.kyc-rtl { direction: rtl; }
body.kyc-rtl .kyc-guide-toggle { text-align: right; }
body.kyc-rtl .kyc-guide-step { padding: 8px 40px 8px 0; }
body.kyc-rtl .kintro-trustline { direction: rtl; }
body.kyc-rtl .kyc-guide-toggle .kg-caret { transform: scaleX(-1); }
body.kyc-rtl .kyc-guide.is-open .kyc-guide-toggle .kg-caret { transform: scaleX(-1) rotate(180deg); }
body.kyc-rtl .kintro-lang-band {
    flex-direction: row-reverse;
}
body.kyc-rtl .kintro-lang-band .kyc-lang-picker-menu,
body.kyc-rtl .kintro-lang-mount .kyc-lang-picker-menu {
    left: 0;
    right: auto;
    transform: none;
}
body.kyc-rtl .kyc-lang-picker-item { text-align: right; flex-direction: row-reverse; }
