/* ==========================================================================
   Reos YZ Asistanı (Views/Shared/_ReosAssistant.cshtml)
   Source: reos-chatbot.html in Re-os/AI-Chatbot. Every class carries the "ra-" prefix
   and every rule hangs off .ra, so nothing here reaches the rest of the site and the
   site's generic classes (.message, .chat-*) cannot reach the widget.
   Stacking: the launcher sits under the cookie banner and the social bar (9999), the
   open window above everything.
   ========================================================================== */

.ra,
.ra *,
.ra *::before,
.ra *::after {
    box-sizing: border-box;
}

.ra h3,
.ra p {
    margin: 0;
}

/* AI PILOT AVATAR — copied verbatim from ai-pilot-avatar.svg (variant A2+K1).
   An approved brand asset shared with other products: colours, geometry and
   motion are not edited here. Only its size changes. */
.ra .aipilot-svg *{transform-box:fill-box;transform-origin:center}
.ra .p-govde{animation:pNefes 4.4s ease-in-out infinite}
.ra .p-radar{animation:pDon 11s linear infinite}
.ra .p-tarama{animation:pTara 3.6s ease-in-out infinite}
.ra .p-antenUc{animation:pSinyal 2.2s ease-in-out infinite}
.ra .p-antenHalka{animation:pSinyalHalka 2.2s ease-out infinite}
.ra .p-goz{animation:pKirp 7s ease-in-out infinite}
.ra .p-gozSag{animation-delay:.07s}
@keyframes pNefes{0%,100%{transform:scale(1)}50%{transform:scale(1.035)}}
@keyframes pDon{to{transform:rotate(360deg)}}
@keyframes pTara{0%,100%{transform:translateX(0);opacity:.15}50%{transform:translateX(19px);opacity:.8}}
@keyframes pSinyal{0%,100%{transform:scale(1);opacity:.9}50%{transform:scale(1.15);opacity:1}}
@keyframes pSinyalHalka{0%{transform:scale(.7);opacity:.9}100%{transform:scale(1.6);opacity:0}}
@keyframes pKirp{0%,90%,100%{transform:scaleY(1)}94%{transform:scaleY(.1)}}
@keyframes pKonusNod{0%{transform:translateY(0) scale(1)}18%{transform:translateY(1px) scale(1.02)}36%{transform:translateY(0) scale(1)}54%{transform:translateY(.8px) scale(1.015)}72%{transform:translateY(0) scale(1)}86%{transform:translateY(.4px) scale(1.008)}100%{transform:translateY(0) scale(1)}}
@keyframes pSuzul{0%{transform:translateX(0);opacity:0}14%{opacity:.95}86%{opacity:.9}100%{transform:translateX(28px);opacity:0}}
@keyframes pGozIsik{0%,100%{opacity:.85;transform:scale(1)}50%{opacity:1;transform:scale(1.14)}}
@keyframes pAtim{0%{transform:scale(.86);opacity:.42}100%{transform:scale(1.24);opacity:0}}
@keyframes pGulumse{0%,100%{transform:scaleY(1) translateY(0)}28%{transform:scaleY(1.4) translateY(.4px)}58%{transform:scaleY(1.08) translateY(0)}80%{transform:scaleY(1.24) translateY(.3px)}}
.ra .p-konusma{animation:pKonusNod 1.9s cubic-bezier(.34,.6,.3,1) 1 both}
.ra .p-konusma .p-suzul{animation:pSuzul .62s ease-in-out 3 both}
.ra .p-konusma .p-goz{animation:pGozIsik .62s ease-in-out 3 both}
.ra .p-konusma .p-agiz{animation:pGulumse .95s ease-in-out 2 both}
.ra .p-konusma .p-tarama{animation:none;opacity:.12}
.ra .p-konusma .p-atim{animation:pAtim 1.1s ease-out 1 both}
.ra .p-kucuk .p-ayrinti{display:none}
@keyframes pVizorParla{0%,100%{fill:#06323d}50%{fill:#0d5568}}
.ra .p-kucuk.p-konusma .p-vizor{animation:pVizorParla 1.9s ease-in-out 1 both}
@media (prefers-reduced-motion:reduce){
.ra .p-tarama,.ra .p-suzul,.ra .p-atim{animation:none!important;opacity:0!important}
.ra .p-antenUc,.ra .p-antenHalka,.ra .p-goz,.ra .p-vizor{animation:none!important}
.ra .p-konusma{animation:none!important}
}
.ra .pilot { display: inline-block; line-height: 0; }
.ra .pilot > svg { display: block; width: 100%; height: 100%; }

/* ── Launcher (follows the AI Pilot FAB, aipilot.css .aip-fab) ── */
/* --ra-lift: the cookie banner's height while it is on screen (set by the script). */
.ra .ra-toggle {
    position: fixed;
    bottom: calc(25px + var(--ra-lift, 0px));
    right: 25px;
    width: 65px;
    height: 65px;
    padding: 0;
    background: linear-gradient(180deg, #4a6b86, #1d3448);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(29, 52, 72, .32);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    border: 1px solid #2a8fa8;
    outline: none;
    transition: transform 0.2s ease, bottom 0.5s cubic-bezier(.4, 0, .2, 1);
}

.ra .ra-toggle:focus-visible {
    outline: 3px solid #0a5566;
    outline-offset: 3px;
}

.ra .ra-toggle:hover {
    transform: scale(1.05);
}

.ra .ra-toggle.active {
    transform: scale(0.95);
}

.ra .ra-toggle-icon {
    position: absolute;
    transition: all 0.3s ease;
}

.ra .ra-fab-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #5df0b4;
    border: 2px solid #1d3448;
    transition: opacity 0.3s ease;
}

.ra .ra-close-icon {
    position: absolute;
    color: #ffffff;
    opacity: 0;
    transform: rotate(180deg) scale(0.8);
    transition: all 0.3s ease;
}

.ra .ra-toggle.active .ra-toggle-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
}

.ra .ra-toggle.active .ra-close-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.ra .ra-toggle.active .ra-fab-dot {
    opacity: 0;
}

/* ── Hover tooltip ── */
.ra .ra-tooltip {
    position: absolute;
    right: 85px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    color: #111111;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    border: 1.2px solid rgba(27, 181, 204, 0.22);
    pointer-events: none;
}

.ra .ra-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #ffffff;
}

.ra .ra-tooltip-icon {
    color: #1bb5cc;
}

.ra .ra-toggle:hover .ra-tooltip {
    opacity: 1;
    visibility: visible;
}

.ra .ra-toggle.active .ra-tooltip {
    display: none;
}

/* ── Chat window ── */
.ra .ra-window {
    position: fixed;
    bottom: calc(105px + var(--ra-lift, 0px));
    right: 25px;
    width: 400px;
    height: 550px;
    max-height: calc(100vh - 130px - var(--ra-lift, 0px));
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(17, 17, 17, 0.15);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    border: 2px solid rgba(27, 181, 204, 0.1);
    font-family: inherit;
    color: #111111;
    text-align: left;
}

@supports (height: 100dvh) {
    .ra .ra-window {
        max-height: calc(100dvh - 130px - var(--ra-lift, 0px));
    }
}

.ra .ra-window.active {
    display: flex;
    animation: raSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes raSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header ── */
.ra .ra-header {
    background: linear-gradient(135deg, #1bb5cc, #064a97);
    padding: 24px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.ra .ra-header-icon {
    width: 42px;
    height: 42px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ra .ra-header-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.ra .ra-header-text {
    flex: 1;
}

.ra .ra-header-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.ra .ra-header-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.85;
    font-weight: 400;
}

.ra .ra-online-dot {
    color: #00ff00;
    font-size: 10px;
    display: inline-block;
    animation: raOnlinePulse 2s infinite ease-in-out;
}

@keyframes raOnlinePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1.1);
    }
    50% {
        opacity: 0.9;
        transform: scale(0.6);
    }
}

/* ── Messages ── */
.ra .ra-messages {
    flex: 1;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #ffffff;
}

.ra .ra-messages::-webkit-scrollbar {
    width: 4px;
}

.ra .ra-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ra .ra-messages::-webkit-scrollbar-thumb {
    background: #1bb5cc;
    border-radius: 2px;
}

.ra .ra-welcome {
    text-align: center;
    color: #666;
    font-size: 15px;
    margin-top: 60px;
    padding: 0 20px;
}

.ra .ra-welcome-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(180deg, #4a6b86, #1d3448);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(27, 181, 204, 0.25);
}

.ra .ra-welcome h3 {
    color: #111111;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.ra .ra-welcome p {
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

.ra .ra-msg {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
    gap: 8px;
}

.ra .ra-msg--user {
    justify-content: flex-end;
}

.ra .ra-msg--bot {
    justify-content: flex-start;
}

/* The avatar's light head barely separates from a light page (the package's own
   measurement), so it sits in the dark pod-coloured container, as on the launcher. */
.ra .ra-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    background: linear-gradient(180deg, #4a6b86, #1d3448);
}

.ra .ra-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.ra .ra-msg--user .ra-bubble {
    background: #1bb5cc;
    color: #ffffff;
    border-bottom-right-radius: 6px;
}

.ra .ra-msg--bot .ra-bubble {
    background: #f8f9fa;
    color: #111111;
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(27, 181, 204, 0.1);
}

.ra .ra-bubble a {
    color: inherit;
    text-decoration: underline;
}

/* Contact details under every answer. Static text rather than model output:
   writing them into each answer cost output tokens on every reply. */
.ra .ra-contact {
    font-size: 11.5px;
    color: #6b7280;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #edf0f4;
    white-space: normal;
}

.ra .ra-bubble .ra-contact-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    white-space: nowrap;
    color: #064a97;
    text-decoration: none;
}

.ra .ra-bubble .ra-contact-line:hover {
    text-decoration: underline;
}

.ra .ra-contact-line i {
    width: 12px;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
}

/* ── Typing indicator ── */
.ra .ra-typing-row {
    display: none;
    align-items: flex-start;
    gap: 8px;
    margin: 0 20px 12px;
}

.ra .ra-typing-row.visible {
    display: flex;
}

.ra .ra-typing {
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 20px;
    border-bottom-left-radius: 8px;
    border: 1px solid rgba(27, 181, 204, 0.08);
}

.ra .ra-typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ra .ra-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1bb5cc;
    display: inline-block;
    animation: raTypingPulse 1.6s infinite ease-in-out;
}

.ra .ra-typing-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.ra .ra-typing-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes raTypingPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Input ── */
.ra .ra-input-bar {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid rgba(27, 181, 204, 0.1);
    flex-shrink: 0;
}

.ra .ra-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin: 0;
}

.ra .ra-input {
    flex: 1;
    border: 1px solid rgba(27, 181, 204, 0.3);
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    outline: none;
    /* style.css gives every textarea height 240px; the script grows this one to 80px. */
    height: 40px;
    min-height: 40px;
    max-height: 80px;
    transition: border-color 0.2s ease;
    background: #ffffff;
    color: #111111;
}

.ra .ra-input:focus {
    border-color: #1bb5cc;
    box-shadow: 0 0 0 3px rgba(27, 181, 204, 0.1);
}

.ra .ra-input::placeholder {
    color: #999;
}

.ra .ra-input:disabled {
    background: #f4f6f8;
}

.ra .ra-send {
    width: 40px;
    height: 40px;
    padding: 0;
    background: linear-gradient(135deg, #1bb5cc, #064a97);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(27, 181, 204, 0.2);
}

.ra .ra-send:active {
    transform: translateY(1px);
}

.ra .ra-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ra .ra-send i {
    color: #ffffff;
    font-size: 16px;
}

/* ── Lead form ── */
.ra .ra-lead {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border-radius: 20px;
}

.ra .ra-lead.show {
    display: flex;
}

.ra .ra-lead-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 18px 14px;
    max-width: 340px;
    width: 90%;
    max-height: calc(100% - 24px);
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}

.ra .ra-lead-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ra .ra-lead-close:hover {
    background: #f0f0f0;
    color: #666;
}

.ra .ra-lead h3 {
    color: #111111;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 6px;
}

.ra .ra-lead-intro {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.ra .ra-lead-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
    text-align: left;
    margin: 0;
}

.ra .ra-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

/* Required marks are part of the label, so the requirement is visible before
   anyone presses the button. */
.ra .ra-req {
    color: #d93025;
    margin-left: 2px;
}

/* style.css sets every input to height/line-height 48px. */
.ra .ra-field-input {
    width: 100%;
    height: auto;
    line-height: 1.4;
    border: 1px solid #d5dce4;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
    color: #111111;
}

/* intl-tel-input wraps the phone input in .iti (inline-block by default). */
.ra .iti {
    display: block;
    width: 100%;
}

/* StyleSheet.css pads every intl-tel-input field by 85px !important (room for the register
   form's separate "+90"); this field shows only the flag, which needs 52px. */
.ra .iti--allow-dropdown input[type=tel].ra-field-input {
    padding-left: 52px !important;
}

/* Its country list opens in <body> (1060 by default), so it has to clear the chat
   window's 10000. ra-iti-list is added by the script to this field's list only; the
   site's other phone fields keep their own. */
.iti--container.ra-iti-list {
    z-index: 10001;
}

.ra .ra-field-input:focus {
    border-color: #1bb5cc;
    box-shadow: 0 0 0 3px rgba(27, 181, 204, 0.12);
}

.ra .ra-field-input::placeholder {
    color: #9aa3ad;
}

.ra .ra-field.invalid .ra-field-input {
    border-color: #d93025;
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.1);
}

.ra .ra-field-error {
    display: none;
    color: #d93025;
    font-size: 12px;
    margin-top: 4px;
}

.ra .ra-field.invalid .ra-field-error {
    display: block;
}

.ra .ra-lead-note {
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.45;
    margin: 2px 0 0;
}

.ra .ra-lead-error {
    display: none;
    color: #d93025;
    font-size: 13px;
    text-align: center;
}

.ra .ra-lead-error.visible {
    display: block;
}

.ra .ra-lead-submit {
    background: linear-gradient(135deg, #1bb5cc, #064a97);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 2px;
}

.ra .ra-lead-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 181, 204, 0.3);
}

.ra .ra-lead-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ra .ra-lead-recaptcha {
    font-size: 10.5px;
    color: #9aa3ad;
    text-align: center;
    line-height: 1.4;
    margin: 0;
}

.ra .ra-lead-recaptcha a {
    color: #6b7280;
}

/* ── Phones ── */
@media (max-width: 450px) {
    .ra .ra-window {
        right: 15px;
        left: 15px;
        width: auto;
        bottom: calc(95px + var(--ra-lift, 0px));
    }

    .ra .ra-toggle {
        right: 20px;
        bottom: calc(20px + var(--ra-lift, 0px));
        width: 60px;
        height: 60px;
    }

    .ra .ra-close-icon {
        font-size: 24px;
    }

    .ra .ra-tooltip {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ra .ra-window.active,
    .ra .ra-online-dot,
    .ra .ra-typing-dot {
        animation: none;
    }
}
