/* =========================================================
   DIRLIKLI SIGORTA - QUOTE ASSISTANT
   ========================================================= */

.qa-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;

    font-family: inherit;
}


/* =========================================================
   LAUNCHER
   ========================================================= */

.qa-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 54px;

    padding: 0 18px;

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;

    background:
        linear-gradient(
            135deg,
            #008f9a 0%,
            #00a8b5 48%,
            #147a70 100%
        );

    color: #ffffff;

    font: inherit;
    font-size: 13px;
    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 16px 42px rgba(0, 67, 74, 0.24),
        0 5px 14px rgba(15, 23, 42, 0.12);

    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease;
}

.qa-launcher:hover {
    transform: translateY(-2px);

    box-shadow:
        0 20px 50px rgba(0, 67, 74, 0.28),
        0 8px 18px rgba(15, 23, 42, 0.14);
}

.qa-launcher:active {
    transform: translateY(0);
}

.qa-launcher:focus-visible {
    outline: 3px solid rgba(0, 168, 181, 0.22);
    outline-offset: 4px;
}

.qa-launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.qa-launcher-icon svg {
    width: 24px;
    height: 24px;
}

.qa-launcher-text {
    white-space: nowrap;
}

.qa-launcher-close {
    display: none;

    font-size: 22px;
    font-weight: 400;
    line-height: 1;
}

.qa-widget.is-open .qa-launcher-icon,
.qa-widget.is-open .qa-launcher-text {
    display: none;
}

.qa-widget.is-open .qa-launcher-close {
    display: inline-flex;
}


/* =========================================================
   PANEL
   ========================================================= */

.qa-panel {
    position: absolute;
    right: 0;
    bottom: 70px;

    display: flex;
    flex-direction: column;

    width: min(390px, calc(100vw - 32px));
    height: min(650px, calc(100vh - 120px));

    overflow: hidden;

    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;

    background: #ffffff;

    box-shadow:
        0 28px 80px rgba(15, 23, 42, 0.2),
        0 10px 30px rgba(15, 23, 42, 0.08);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(14px)
        scale(0.98);

    transform-origin: bottom right;

    transition:
        opacity 190ms ease,
        visibility 190ms ease,
        transform 220ms cubic-bezier(.2, .8, .2, 1);
}

.qa-widget.is-open .qa-panel {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   HEADER
   ========================================================= */

.qa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 18px 18px 16px;

    border-bottom: 1px solid rgba(15, 23, 42, 0.07);

    background:
        linear-gradient(
            135deg,
            rgba(0, 168, 181, 0.08),
            rgba(20, 122, 112, 0.03)
        );
}

.qa-header-main {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
}

.qa-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    overflow: hidden;

    border: 1px solid rgba(0, 168, 181, 0.16);
    border-radius: 13px;

    background: #ffffff;

    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.07);
}

.qa-avatar img {
    display: block;

    max-width: 30px;
    max-height: 30px;

    object-fit: contain;
}

.qa-header-copy {
    min-width: 0;
}

.qa-header-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.qa-header-title-row h2 {
    margin: 0;

    color: var(--ink);

    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.qa-header-copy p {
    margin: 3px 0 0;

    color: var(--text);

    font-size: 10px;
    line-height: 1.4;
}

.qa-online-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;

    border-radius: 50%;

    background: #12b76a;

    box-shadow:
        0 0 0 3px rgba(18, 183, 106, 0.12);
}

.qa-close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    flex: 0 0 36px;

    padding: 0;

    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 11px;

    background: #ffffff;
    color: var(--text);

    font: inherit;
    font-size: 20px;
    line-height: 1;

    cursor: pointer;

    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

.qa-close:hover {
    border-color: rgba(0, 168, 181, 0.22);

    background: rgba(0, 168, 181, 0.05);
    color: var(--brand);

    transform: rotate(3deg);
}


/* =========================================================
   PROGRESS
   ========================================================= */

.qa-progress {
    padding: 12px 18px;

    border-bottom: 1px solid rgba(15, 23, 42, 0.06);

    background: #ffffff;
}

.qa-progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 7px;
}

.qa-progress-top span {
    color: var(--text);

    font-size: 9px;
    font-weight: 700;
}

.qa-progress-track {
    width: 100%;
    height: 5px;

    overflow: hidden;

    border-radius: 999px;

    background: rgba(15, 23, 42, 0.07);
}

.qa-progress-bar {
    width: 0;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #00a8b5,
            #147a70
        );

    transition:
        width 260ms ease;
}


/* =========================================================
   CONVERSATION
   ========================================================= */

.qa-conversation {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 18px;

    background:
        linear-gradient(
            180deg,
            #fbfdfe 0%,
            #ffffff 100%
        );

    scrollbar-width: thin;
    scrollbar-color:
        rgba(15, 23, 42, 0.16)
        transparent;
}

.qa-conversation::-webkit-scrollbar {
    width: 6px;
}

.qa-conversation::-webkit-scrollbar-thumb {
    border-radius: 999px;

    background: rgba(15, 23, 42, 0.14);
}

.qa-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;

    margin-bottom: 12px;
}

.qa-message:last-child {
    margin-bottom: 0;
}

.qa-message-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;
    flex: 0 0 28px;

    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            #00a8b5,
            #147a70
        );

    color: #ffffff;

    font-size: 10px;
    font-weight: 800;
}

.qa-message-content {
    max-width: 82%;
}

.qa-bubble {
    padding: 11px 13px;

    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius:
        14px
        14px
        14px
        4px;

    background: #ffffff;
    color: var(--ink);

    font-size: 12px;
    line-height: 1.6;

    box-shadow:
        0 3px 10px rgba(15, 23, 42, 0.035);
}

.qa-message-user {
    justify-content: flex-end;
}

.qa-message-user .qa-message-avatar {
    display: none;
}

.qa-message-user .qa-message-content {
    max-width: 78%;
}

.qa-message-user .qa-bubble {
    border-color: transparent;

    border-radius:
        14px
        14px
        4px
        14px;

    background:
        linear-gradient(
            135deg,
            #00a8b5,
            #147a70
        );

    color: #ffffff;
}


/* =========================================================
   INTERACTION AREA
   ========================================================= */

.qa-interaction {
    flex: 0 0 auto;

    max-height: 45%;

    overflow-y: auto;

    padding: 14px 16px 16px;

    border-top: 1px solid rgba(15, 23, 42, 0.07);

    background: #ffffff;

    scrollbar-width: thin;
    scrollbar-color:
        rgba(15, 23, 42, 0.14)
        transparent;
}

.qa-step[hidden] {
    display: none !important;
}


/* =========================================================
   CHOICE LIST
   ========================================================= */

.qa-choice-list {
    display: grid;
    gap: 8px;
}

.qa-choice-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    min-height: 44px;

    padding: 10px 12px;

    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;

    background: #ffffff;
    color: var(--ink);

    font: inherit;
    font-size: 11px;
    font-weight: 700;

    text-align: left;

    cursor: pointer;

    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}

.qa-choice-button:hover {
    border-color: rgba(0, 168, 181, 0.3);

    background: rgba(0, 168, 181, 0.045);
    color: var(--brand);

    transform: translateY(-1px);

    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.05);
}

.qa-choice-main {
    min-width: 0;
}

.qa-choice-arrow {
    flex: 0 0 auto;

    color: var(--brand);

    font-size: 15px;

    transition:
        transform 180ms ease;
}

.qa-choice-button:hover .qa-choice-arrow {
    transform: translateX(2px);
}

.qa-choice-button-centered {
    justify-content: center;

    text-align: center;
}

.qa-binary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.qa-empty {
    margin: 0;

    padding: 14px;

    border-radius: 12px;

    background: var(--surface-alt);
    color: var(--text);

    font-size: 11px;
    line-height: 1.6;

    text-align: center;
}


/* =========================================================
   INPUT STEP
   ========================================================= */

.qa-input-step {
    display: grid;
    gap: 8px;
}

.qa-input-label {
    color: var(--ink);

    font-size: 10px;
    font-weight: 800;
}

.qa-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.qa-input,
.qa-select {
    width: 100%;
    height: 46px;

    padding: 0 13px;

    border: 1px solid var(--line);
    border-radius: 12px;

    outline: 0;

    background: #ffffff;
    color: var(--ink);

    font: inherit;
    font-size: 12px;

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease;
}

.qa-input::placeholder {
    color: #98a2b3;
}

.qa-input:hover,
.qa-select:hover {
    border-color: rgba(0, 168, 181, 0.32);
}

.qa-input:focus,
.qa-select:focus {
    border-color: var(--brand);

    box-shadow:
        0 0 0 4px rgba(0, 168, 181, 0.09);
}

.qa-send-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    padding: 0;

    border: 0;
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #00a8b5,
            #147a70
        );

    color: #ffffff;

    font: inherit;
    font-size: 18px;
    font-weight: 800;

    cursor: pointer;

    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease;
}

.qa-send-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 7px 18px rgba(0, 168, 181, 0.2);
}

.qa-send-button:disabled {
    opacity: 0.5;

    cursor: not-allowed;
}

.qa-input-help {
    color: var(--text);

    font-size: 9px;
    line-height: 1.5;
}

.qa-input-error {
    display: block;

    color: #b42318;

    font-size: 9px;
    line-height: 1.5;
}


/* =========================================================
   CITY / SELECT
   ========================================================= */

.qa-city-step,
.qa-select-step {
    display: grid;
    gap: 10px;
}

.qa-select-wrap {
    position: relative;
}

.qa-select {
    appearance: none;
    -webkit-appearance: none;

    padding-right: 36px;

    cursor: pointer;

    background-image:
        linear-gradient(45deg, transparent 50%, #667085 50%),
        linear-gradient(135deg, #667085 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 20px,
        calc(100% - 13px) 20px;
    background-size:
        5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}


/* =========================================================
   PRIMARY / SECONDARY BUTTONS
   ========================================================= */

.qa-primary-button,
.qa-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    min-height: 46px;

    padding: 10px 14px;

    border-radius: 12px;

    font: inherit;
    font-size: 11px;
    font-weight: 800;

    cursor: pointer;

    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease;
}

.qa-primary-button {
    border: 0;

    background:
        linear-gradient(
            135deg,
            #00a8b5,
            #147a70
        );

    color: #ffffff;
}

.qa-primary-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 7px 18px rgba(0, 168, 181, 0.2);
}

.qa-secondary-button {
    margin-top: 8px;

    border: 1px solid var(--line);

    background: #ffffff;
    color: var(--text);
}

.qa-secondary-button:hover {
    border-color: rgba(0, 168, 181, 0.26);

    background: rgba(0, 168, 181, 0.04);
    color: var(--brand);
}


/* =========================================================
   SUMMARY
   ========================================================= */

.qa-summary-step {
    display: grid;
    gap: 14px;
}

.qa-summary {
    overflow: hidden;

    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;

    background: var(--surface-alt);
}

.qa-summary-heading {
    display: grid;
    gap: 3px;

    padding: 13px 14px;

    border-bottom: 1px solid rgba(15, 23, 42, 0.07);

    background: #ffffff;
}

.qa-summary-eyebrow {
    color: var(--brand);

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.qa-summary-heading strong {
    color: var(--ink);

    font-size: 11px;
}

.qa-summary-list {
    display: grid;
}

.qa-summary-item {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 12px;

    padding: 10px 14px;

    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.qa-summary-item:last-child {
    border-bottom: 0;
}

.qa-summary-label {
    color: var(--text);

    font-size: 9px;
    font-weight: 700;
}

.qa-summary-value {
    min-width: 0;

    color: var(--ink);

    font-size: 9px;
    font-weight: 700;

    text-align: right;

    overflow-wrap: anywhere;
}


/* =========================================================
   CONSENT
   ========================================================= */

.qa-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    color: var(--text);

    font-size: 9px;
    line-height: 1.55;

    cursor: pointer;
}

.qa-consent input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;

    margin-top: 1px;

    accent-color: var(--brand);
}

.qa-consent a {
    color: var(--brand);

    font-weight: 700;

    text-decoration: none;
}

.qa-consent a:hover {
    text-decoration: underline;
}


/* =========================================================
   SUBMIT LOADING
   ========================================================= */

.qa-submit-button {
    position: relative;

    overflow: hidden;
}

.qa-submit-default,
.qa-submit-loading {
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qa-submit-default {
    display: inline-flex;
}

.qa-submit-loading {
    display: none;
}

.qa-submit-button.is-loading {
    opacity: 0.92;

    pointer-events: none;

    cursor: wait;
}

.qa-submit-button.is-loading .qa-submit-default {
    display: none;
}

.qa-submit-button.is-loading .qa-submit-loading {
    display: inline-flex;
}

.qa-loading-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;

    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;

    animation:
        qaSpinner
        0.7s linear infinite;
}

@keyframes qaSpinner {

    to {
        transform: rotate(360deg);
    }

}


/* =========================================================
   SUCCESS
   ========================================================= */

.qa-success-step {
    padding: 8px 4px;

    text-align: center;
}

.qa-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;

    margin: 0 auto 12px;

    border-radius: 16px;

    background:
        rgba(18, 183, 106, 0.1);

    color: #027a48;

    font-size: 24px;
    font-weight: 900;
}

.qa-success-step strong {
    display: block;

    color: var(--ink);

    font-size: 13px;
}

.qa-success-step p {
    margin: 6px 0 0;

    color: var(--text);

    font-size: 10px;
    line-height: 1.6;
}


/* =========================================================
   FOOTER
   ========================================================= */

.qa-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 44px;

    padding: 9px 16px;

    border-top: 1px solid rgba(15, 23, 42, 0.07);

    background: #ffffff;
}

.qa-back-button {
    padding: 4px 0;

    border: 0;

    background: transparent;
    color: var(--brand);

    font: inherit;
    font-size: 9px;
    font-weight: 800;

    cursor: pointer;
}

.qa-back-button:hover {
    text-decoration: underline;
}

.qa-footer-note {
    margin-left: auto;

    color: var(--text);

    font-size: 8px;
    line-height: 1.4;
}


/* =========================================================
   HIDDEN
   ========================================================= */

.qa-widget [hidden] {
    display: none !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .qa-widget {
        right: 18px;
        bottom: 18px;
    }

    .qa-panel {
        bottom: 66px;

        height: min(620px, calc(100vh - 100px));
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 620px) {

    body.qa-panel-open {
        overflow: hidden;
    }

    .qa-widget {
        right: 14px;
        bottom: 14px;
    }

    .qa-launcher {
        min-width: 54px;

        padding: 0 15px;
    }

    .qa-panel {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;

        width: 100%;
        height: min(88vh, 720px);

        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius:
            24px
            24px
            0
            0;

        transform:
            translateY(24px)
            scale(1);

        transform-origin: bottom center;
    }

    .qa-widget.is-open .qa-panel {
        transform:
            translateY(0)
            scale(1);
    }

    .qa-widget.is-open .qa-launcher {
        opacity: 0;

        pointer-events: none;
    }

    .qa-header {
        padding:
            16px
            16px
            14px;
    }

    .qa-conversation {
        padding: 16px;
    }

    .qa-interaction {
        max-height: 48%;

        padding:
            13px
            14px
            16px;
    }

    .qa-footer {
        padding:
            9px
            14px;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .qa-widget {
        right: 12px;
        bottom: 12px;
    }

    .qa-launcher {
        min-height: 52px;

        padding: 0 14px;
    }

    .qa-launcher-text {
        font-size: 12px;
    }

    .qa-panel {
        height: 91vh;

        border-radius:
            20px
            20px
            0
            0;
    }

    .qa-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;

        border-radius: 11px;
    }

    .qa-avatar img {
        max-width: 27px;
        max-height: 27px;
    }

    .qa-header-title-row h2 {
        font-size: 13px;
    }

    .qa-message-content {
        max-width: 86%;
    }

    .qa-bubble {
        font-size: 11px;
    }

    .qa-choice-button {
        min-height: 42px;

        font-size: 10px;
    }

    .qa-input,
    .qa-select {
        height: 44px;

        font-size: 11px;
    }

    .qa-send-button {
        width: 44px;
        height: 44px;
    }

    .qa-summary-item {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .qa-summary-value {
        text-align: left;
    }

}