/* SigortaPartner AI Danışman (Hero) — Gemini anasayfası tarzı. Tüm renkler CSS değişkeni (WP config). */

#sp-hero-root.sph {
    --sph-bg-from: #ffffff;
    --sph-bg-to: #f0f4f9;
    --sph-surface: #ffffff;
    --sph-input-bg: #ffffff;
    --sph-input-border: #dfe1e5;
    --sph-text: #1f1f1f;
    --sph-accent: #1a73e8;
    --sph-accent2: #9b72f2;
    --sph-send-bg: #1a73e8;
    --sph-send-ico: #ffffff;
    --sph-user-bg: #e8f0fe;
    --sph-bot-bg: #f1f3f4;
    --sph-chip-bg: #ffffff;
    --sph-chip-text: #1f1f1f;
    --sph-chip-border: #dfe1e5;
    --sph-reset-bg: #ffffff;
    --sph-reset-text: #5f6368;
    --sph-reset-border: #dfe1e5;
    --sph-sub: #5f6368;
    --sph-placeholder: #9aa0a6;
    --sph-badge: #5f6368;
    --sph-badge-ico: #34a853;
    --sph-foot: #9aa0a6;
    --sph-kvkk: #5f6368;
    --sph-radius: 26px;
    --sph-maxwidth: 820px;
    --sph-minheight: 78vh;

    position: relative;
    box-sizing: border-box;
    background: linear-gradient(180deg, var(--sph-bg-from), var(--sph-bg-to));
    color: var(--sph-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

#sp-hero-root.sph *,
#sp-hero-root.sph *::before,
#sp-hero-root.sph *::after {
    box-sizing: border-box;
}

/* Tam genişlik: kısıtlı container içinde bile sayfa boyunca yay */
#sp-hero-root.sph-full {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.sph .sph-inner {
    max-width: var(--sph-maxwidth);
    margin: 0 auto;
    min-height: var(--sph-minheight);
    padding: 40px 20px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
}

/* Ana sayfa hero'sunda içerik daha dengeli bir optik merkezde dursun. */
.sph.sph-homepage .sph-inner {
    transform: translateY(-28px);
}
.sph.sph-homepage .sph-headline {
    font-size: clamp(32px, 5.2vw, 58px);
}

/* ── Karşılama ── */
.sph .sph-hello {
    text-align: center;
    transition: opacity .25s ease, transform .25s ease, max-height .3s ease;
}
.sph .sph-seo-title {
    margin: 0 0 10px;
    font-size: clamp(16px, 2.2vw, 22px);
    font-weight: 600;
    line-height: 1.3;
    color: var(--sph-sub);
}
.sph .sph-headline {
    margin: 0 0 8px;
    font-size: clamp(30px, 5vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, var(--sph-accent), var(--sph-accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.sph .sph-sub {
    margin: 0;
    font-size: clamp(15px, 2vw, 18px);
    color: var(--sph-sub);
    line-height: 1.5;
}

/* ── Konuşma alanı (ilk mesajdan sonra görünür) ── */
.sph .sph-convo {
    display: none;
    flex-direction: column;
    gap: 12px;
    max-height: 56vh;
    overflow-y: auto;
    padding: 6px 2px;
    scroll-behavior: smooth;
}
.sph.sph-active .sph-convo { display: flex; }
.sph.sph-active .sph-hello {
    opacity: 0;
    max-height: 0;
    margin: 0;
    pointer-events: none;
    overflow: hidden;
}
.sph.sph-active .sph-inner { justify-content: flex-start; }

.sph .sph-msg {
    max-width: 88%;
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: sph-pop .18s ease;
}
.sph .sph-msg.user {
    align-self: flex-end;
    background: var(--sph-user-bg);
    border-bottom-right-radius: 5px;
}
.sph .sph-msg.bot {
    align-self: flex-start;
    background: var(--sph-bot-bg);
    border-bottom-left-radius: 5px;
}
@keyframes sph-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Yazıyor animasyonu */
.sph .sph-typing { display: inline-flex; gap: 4px; align-items: center; }
.sph .sph-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa0a6; display: inline-block; animation: sph-bounce 1.2s infinite; }
.sph .sph-typing i:nth-child(2) { animation-delay: .2s; }
.sph .sph-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes sph-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ── Input ── */
.sph .sph-form { width: 100%; }
.sph .sph-inputwrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--sph-input-bg);
    border: 1px solid var(--sph-input-border);
    border-radius: var(--sph-radius);
    padding: 8px 8px 8px 20px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06), 0 8px 30px rgba(0, 0, 0, .05);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sph .sph-inputwrap:focus-within {
    border-color: var(--sph-accent);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}
.sph textarea.sph-input {
    flex: 1;
    border: 0;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 17px;
    line-height: 1.5;
    color: var(--sph-text);
    max-height: 180px;
    padding: 10px 0;
    font-family: inherit;
}
.sph textarea.sph-input::placeholder { color: var(--sph-placeholder); }
/* Boşken (placeholder görünürken) tek satır + taşarsa "…"; yazınca normal sarar (mobilde 2 satıra taşıp kırpılmaz) */
.sph textarea.sph-input:placeholder-shown {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sph .sph-send {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--sph-send-bg);
    color: var(--sph-send-ico);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease, opacity .15s ease, background .15s ease;
}
.sph .sph-send:hover { transform: scale(1.06); }
.sph .sph-send:disabled { opacity: .45; cursor: default; transform: none; }

/* KVKK */
.sph .sph-kvkk {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 6px 0;
    font-size: 12.5px;
    color: var(--sph-kvkk);
    line-height: 1.4;
}
.sph .sph-kvkk input { margin-top: 2px; }
.sph .sph-kvkk a { color: var(--sph-accent); }

/* ── KVKK bilgilendirme modalı ── */
body.sph-kvkk-modal-open { overflow: hidden; }
.sph .sph-kvkk-trigger { cursor: pointer; }
.sph .sph-kvkk-modal[hidden] { display: none; }
.sph .sph-kvkk-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
}
.sph .sph-kvkk-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 10, 24, .08);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.sph .sph-kvkk-modal__panel {
    position: relative;
    width: min(740px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    background: #fff;
    color: #0b1730;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 28px;
    box-shadow: 0 34px 100px rgba(0, 0, 0, .36);
    animation: sph-kvkk-modal-rise .35s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes sph-kvkk-modal-rise {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.sph .sph-kvkk-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 17px;
    padding: 28px 34px 24px;
    border-bottom: 1px solid #e5ebf4;
}
.sph .sph-kvkk-modal__icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #0873d5;
    background: linear-gradient(145deg, #ddf9ff, #eaf1ff);
    font-size: 19px;
}
.sph .sph-kvkk-modal__eyebrow {
    margin: 1px 0 7px;
    color: #0c6edb;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 10px;
    font-weight: 750;
}
.sph .sph-kvkk-modal__header h2 {
    margin: 0 0 7px;
    color: #0b1730;
    font-size: 25px;
    line-height: 1.12;
    letter-spacing: -.035em;
}
.sph .sph-kvkk-modal__header p:last-child {
    margin: 0;
    color: #60708d;
    font-size: 14px;
    line-height: 1.55;
}
.sph .sph-kvkk-modal__close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: #f3f6fa;
    color: #6d7c94;
    cursor: pointer;
    font-size: 21px;
    line-height: 1;
}
.sph .sph-kvkk-modal__close:hover,
.sph .sph-kvkk-modal__close:focus-visible { background: #e8eef6; color: #0b1730; }
.sph .sph-kvkk-modal__body { padding: 22px 34px 26px; }
.sph .sph-kvkk-modal__reasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sph .sph-kvkk-modal__reasons article {
    padding: 17px 15px 16px;
    border: 1px solid #e5ebf4;
    border-radius: 17px;
    background: linear-gradient(180deg, #fff, #fbfdff);
}
.sph .sph-kvkk-modal__reasons article > span { color: #1677ff; font-size: 18px; }
.sph .sph-kvkk-modal__reasons h3 { margin: 12px 0 7px; color: #0b1730; font-size: 14px; letter-spacing: -.01em; }
.sph .sph-kvkk-modal__reasons p { margin: 0; color: #60708d; font-size: 12px; line-height: 1.55; }
.sph .sph-kvkk-modal__trust {
    display: flex;
    gap: 9px;
    margin: 22px 0 0;
    padding: 13px 15px;
    border-radius: 14px;
    background: #f1fbf6;
    color: #176a42;
    font-size: 12px;
    line-height: 1.45;
}
.sph .sph-kvkk-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 34px 24px;
    border-top: 1px solid #e5ebf4;
    background: #fbfcfe;
}
.sph .sph-kvkk-modal__footer a { color: #0c6edb; font-size: 13px; font-weight: 700; text-decoration: none; }
.sph .sph-kvkk-modal__footer a:hover,
.sph .sph-kvkk-modal__footer a:focus-visible { text-decoration: underline; }
.sph .sph-kvkk-modal__confirm {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    background: #0b1730;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(11, 23, 48, .16);
}
.sph .sph-kvkk-modal__confirm:hover,
.sph .sph-kvkk-modal__confirm:focus-visible { background: #142a50; transform: translateY(-1px); }
.sph .sph-kvkk-modal__close:focus-visible,
.sph .sph-kvkk-modal__confirm:focus-visible,
.sph .sph-kvkk-modal__footer a:focus-visible,
.sph .sph-kvkk-trigger:focus-visible { outline: 3px solid rgba(61, 216, 234, .55); outline-offset: 3px; }
@media (max-width: 620px) {
    .sph .sph-kvkk-modal { padding: 16px; }
    .sph .sph-kvkk-modal__panel { max-height: calc(100vh - 32px); border-radius: 22px; }
    .sph .sph-kvkk-modal__header,
    .sph .sph-kvkk-modal__body { padding-left: 22px; padding-right: 22px; }
    .sph .sph-kvkk-modal__header h2 { font-size: 22px; }
    .sph .sph-kvkk-modal__reasons { grid-template-columns: 1fr; }
    .sph .sph-kvkk-modal__reasons article { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; padding: 13px; }
    .sph .sph-kvkk-modal__reasons article > span { grid-row: span 2; }
    .sph .sph-kvkk-modal__reasons h3 { margin: 1px 0 4px; }
    .sph .sph-kvkk-modal__footer { align-items: stretch; flex-direction: column; padding-left: 22px; padding-right: 22px; }
    .sph .sph-kvkk-modal__confirm { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .sph .sph-kvkk-modal__panel { animation: none; }
    .sph .sph-kvkk-modal__confirm:hover,
    .sph .sph-kvkk-modal__confirm:focus-visible { transform: none; }
}

/* ── Öneri çipleri ── */
.sph .sph-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    transition: opacity .2s ease;
}
.sph.sph-active .sph-chips,
.sph.sph-active .sph-badges { display: none; }
.sph .sph-chip {
    border: 1px solid var(--sph-chip-border);
    background: var(--sph-chip-bg);
    color: var(--sph-chip-text);
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
    font-family: inherit;
}
.sph .sph-chip:hover {
    border-color: var(--sph-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transform: translateY(-1px);
}

/* ── "Yeni sohbet" (reset) butonu — sohbet başlayınca üstte çıkar; renkleri configden bağımsız ── */
.sph .sph-reset {
    align-self: center;
    margin-bottom: 6px;
    border: 1px solid var(--sph-reset-border);
    background: var(--sph-reset-bg);
    color: var(--sph-reset-text);
    border-radius: 16px;
    padding: 5px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sph .sph-reset:hover { border-color: var(--sph-accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }

/* ── Güven rozetleri ── */
.sph .sph-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
}
.sph .sph-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--sph-badge);
}
.sph .sph-badge svg { color: var(--sph-badge-ico); flex: 0 0 auto; }

.sph .sph-foot {
    text-align: center;
    font-size: 12px;
    color: var(--sph-foot);
    margin-top: 4px;
}

/* ── Mobil ── */
@media (max-width: 600px) {
    /* min-height'i EZME — webdeki gibi (config min_height, ör. %90) mobilde de ilk ekranı kaplasın */
    .sph .sph-inner { padding: 26px 14px 74px; gap: 18px; }
    .sph.sph-homepage .sph-inner { transform: translateY(-12px); }
    .sph .sph-headline { font-size: 28px; }
    .sph textarea.sph-input { font-size: 16px; }
    .sph .sph-convo { max-height: 62vh; }
    .sph .sph-chips { gap: 8px; }
    .sph .sph-chip { padding: 8px 13px; font-size: 13px; }
}
