/*!
 * GOLD DATA — Hızlı Teklif Widget Stilleri
 * Sağ kenar dikey buton + sağdan kayan drawer + form + KVKK popup
 *
 * Mockup v7 + production iyileştirmeleri (charcount, honeypot, sözleşme popup)
 */

/* ============================================================
   FONT — Montserrat (self-host olmadığı için system fallback)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&display=swap');

/* ============================================================
   1) FLOATING WIDGET — HEMEN TEKLİF AL
   ============================================================ */
.gd-quick-quote {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);

    writing-mode: vertical-rl;
    text-orientation: mixed;

    background: #E60023;
    color: #ffffff !important;
    text-decoration: none;
    padding: 26px 13px;
    border-radius: 0 14px 14px 0;

    font-family: 'Montserrat', 'Segoe UI', Tahoma, sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2.2px;
    line-height: 1;

    box-shadow:
        -3px 4px 14px rgba(230, 0, 35, 0.32),
        -1px 1px 4px rgba(0, 0, 0, 0.10);

    z-index: 9997;
    cursor: pointer;
    border: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    animation: gd-breathe 2.8s ease-in-out infinite;
    transition: background 0.25s, box-shadow 0.25s, padding 0.25s, transform 0.3s, opacity 0.25s;
}

@keyframes gd-breathe {
    0%, 100% {
        box-shadow:
            -3px 4px 14px rgba(230, 0, 35, 0.32),
            -1px 1px 4px rgba(0, 0, 0, 0.10),
            0 0 0 0 rgba(230, 0, 35, 0.45);
    }
    50% {
        box-shadow:
            -3px 4px 14px rgba(230, 0, 35, 0.32),
            -1px 1px 4px rgba(0, 0, 0, 0.10),
            0 0 0 12px rgba(230, 0, 35, 0);
    }
}

.gd-quick-quote:hover,
.gd-quick-quote:focus-visible {
    background: #c5001d;
    padding-right: 18px;
    animation: none;
    box-shadow:
        -5px 6px 22px rgba(230, 0, 35, 0.45),
        -1px 1px 6px rgba(0, 0, 0, 0.15);
    outline: none;
    color: #ffffff !important;
}

.gd-quick-quote:active {
    transform: translateY(-50%) rotate(180deg) scale(0.96);
}

.gd-quick-quote.is-hidden {
    transform: translateY(-50%) rotate(180deg) translateY(40px);
    opacity: 0;
    pointer-events: none;
    animation: none;
}

/* ============================================================
   2) LOADING BACKDROP — submit anında frosted glass
   ============================================================ */
.gd-loading-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.gd-loading-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   3) DRAWER — sağdan kayan panel
   ============================================================ */
.gd-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: 420px;
    max-width: 100vw;
    background: #ffffff;
    box-shadow: -8px 0 36px rgba(0, 0, 0, 0.20);
    transform: translateX(100%);
    transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.gd-drawer.is-open {
    transform: translateX(0);
}

/* DRAWER HEADER */
.gd-drawer__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    background: #042331;
    color: #ffffff;
    border-bottom: 3px solid #E60023;
}

.gd-drawer__header-text { min-width: 0; }

.gd-drawer__header h2 {
    margin: 0;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: #ffffff;
}

.gd-drawer__header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
    line-height: 1.4;
}

.gd-drawer__close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.gd-drawer__close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

/* DRAWER BODY */
.gd-drawer__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 22px 22px 32px;
}

/* CALLOUT */
.gd-callout {
    background: #fff8e1;
    border-left: 4px solid #f0a500;
    padding: 12px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #4a3d10;
    line-height: 1.5;
    margin-bottom: 22px;
}
.gd-callout strong { color: #042331; }

/* ============================================================
   FORM
   ============================================================ */
.gd-form .gd-field {
    margin-bottom: 16px;
}

.gd-form label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #042331;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.gd-form label .req {
    color: #E60023;
    margin-left: 2px;
}

.gd-form input[type="text"],
.gd-form input[type="tel"],
.gd-form textarea {
    width: 100%;
    border: 1.5px solid #d6d9de;
    border-radius: 6px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.gd-form input:focus,
.gd-form textarea:focus {
    outline: none;
    border-color: #E60023;
    box-shadow: 0 0 0 3px rgba(230, 0, 35, 0.12);
}

.gd-form input.is-invalid,
.gd-form textarea.is-invalid {
    border-color: #E60023;
    background: #fff5f5;
}

.gd-form textarea {
    min-height: 92px;
    resize: vertical;
}

/* Karakter sayacı — min/max state'leri */
.gd-charcount {
    text-align: right;
    font-size: 11.5px;
    color: #6c757d;
    margin-top: 5px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    transition: color 0.2s;
}
.gd-charcount.is-error   { color: #E60023 !important; font-weight: 700 !important; }
.gd-charcount.is-warning { color: #f0a500 !important; font-weight: 600 !important; }
.gd-charcount.is-ok      { color: #15803d !important; }

/* CAPTCHA */
.gd-form .gd-captcha-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.gd-form .gd-captcha-row input { flex: 1; }
.gd-form .gd-captcha-img {
    border: 1.5px solid #d6d9de;
    border-radius: 6px;
    background: #f1f3f5;
    flex-shrink: 0;
    object-fit: contain;
    padding: 4px 6px;
}
.gd-captcha-refresh {
    background: #f1f3f5;
    border: 1.5px solid #d6d9de;
    border-radius: 6px;
    cursor: pointer;
    width: 38px;
    color: #042331;
    transition: background 0.2s, color 0.2s, transform 0.3s;
    flex-shrink: 0;
}
.gd-captcha-refresh:hover {
    background: #042331;
    color: #ffffff;
    transform: rotate(180deg);
}

/* ============================================================
   CONSENT (Sözleşme onayı) — CUSTOM CHECKBOX
   Native checkbox gizli (screen-reader için erişilebilir kalır),
   görünür kutu CSS sibling selector ile çizilir.
   Bu pattern native browser render gecikmesinin önüne geçer.
   ============================================================ */
.gd-consent {
    background: #f6f8fa;
    border: 1.5px solid #e0e4e8;
    border-radius: 6px;
    padding: 12px 14px;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer !important;
}
.gd-consent:hover {
    border-color: #042331;
}

.gd-consent-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    cursor: pointer !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #333 !important;
    line-height: 1.5 !important;
    user-select: none !important;
}

/* Native checkbox — gizli ama erişilebilir (screen reader + form submit için) */
.gd-consent-checkbox-real {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

/* Global core.css'de [required]+span::before { content: "*" } kuralı var,
   bunu visual checkbox için override et — kutunun içinde * görünmesin */
.gd-consent-checkbox-real[required] + .gd-consent-checkbox-visual::before {
    content: none !important;
    display: none !important;
}

/* Görsel kutucuk — KULLANICININ GÖRDÜĞÜ */
.gd-consent-checkbox-visual {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    border: 2px solid #adb5bd !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s, border-color 0.15s !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}

/* Hover — kutu vurgu */
.gd-consent-label:hover .gd-consent-checkbox-visual {
    border-color: #042331 !important;
}

/* İŞARETLİ STATE — CSS sibling selector */
.gd-consent-checkbox-real:checked + .gd-consent-checkbox-visual {
    background: #E60023 !important;
    border-color: #E60023 !important;
}

/* Tik işareti — CSS pseudo */
.gd-consent-checkbox-real:checked + .gd-consent-checkbox-visual::after {
    content: '' !important;
    width: 7px !important;
    height: 13px !important;
    border-right: 2.5px solid #ffffff !important;
    border-bottom: 2.5px solid #ffffff !important;
    transform: rotate(45deg) translate(0, -1px) !important;
    display: block !important;
}

/* Focus — klavye erişilebilirlik */
.gd-consent-checkbox-real:focus + .gd-consent-checkbox-visual {
    outline: 2px solid #E60023 !important;
    outline-offset: 2px !important;
}

.gd-consent-text {
    flex: 1;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Zorunluluk işareti — metnin başında, sadece text içinde */
.gd-consent-req {
    color: #E60023 !important;
    font-weight: 700 !important;
    margin: 0 4px 0 0 !important;
    padding: 0 !important;
    display: inline !important;
    position: static !important;
    float: none !important;
}

/* JS ile checkbox change'inde eklenir (görsel onay) */
.gd-consent.is-checked {
    border-color: #28a745 !important;
    background: #f0fdf4 !important;
}

.gd-sozlesme-link {
    color: #E60023 !important;
    text-decoration: underline !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline !important;
}
.gd-sozlesme-link:hover { color: #c5001d !important; }

/* FORM ERROR */
.gd-form-error {
    background: #fff5f5;
    border-left: 4px solid #E60023;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #c5001d;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* HONEYPOT — gizli */
.gd-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* SUBMIT */
.gd-form .gd-submit {
    width: 100%;
    background: #E60023;
    color: #ffffff;
    border: none;
    padding: 13px 18px;
    border-radius: 8px;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s, transform 0.1s;
}
.gd-form .gd-submit:hover { background: #c5001d; }
.gd-form .gd-submit:active { transform: scale(0.98); }
.gd-form .gd-submit:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.gd-fineprint {
    margin-top: 18px;
    font-size: 11.5px;
    color: #6c757d;
    line-height: 1.5;
}

/* ============================================================
   4) LOADING STATE — dönen logo
   ============================================================ */
.gd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px 60px;
    min-height: 380px;
    animation: gd-fade-in 0.3s ease-out;
}
.gd-loading__logo {
    width: 88px;
    height: 88px;
    display: block;
    margin: 0 auto 26px;
    animation: gd-rotate 0.9s linear infinite;
    filter: drop-shadow(0 4px 12px rgba(197, 167, 45, 0.25));
}
@keyframes gd-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.gd-loading__text {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #042331;
    letter-spacing: 2px;
    margin: 0 0 6px;
}
.gd-loading__hint {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}
.gd-loading__dots::after {
    content: '';
    display: inline-block;
    width: 1em;
    text-align: left;
    animation: gd-dots 1.4s steps(4, end) infinite;
}
@keyframes gd-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* ============================================================
   5) SUCCESS STATE
   ============================================================ */
.gd-success {
    text-align: center;
    padding: 20px 4px;
    animation: gd-fade-in 0.4s ease-out;
}
@keyframes gd-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.gd-success__icon {
    width: 64px; height: 64px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #1fa05c, #15803d);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(31, 160, 92, 0.30);
}
.gd-success__title {
    margin: 0 0 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 19px; font-weight: 800;
    color: #042331;
}
.gd-success__lead {
    margin: 0 0 18px;
    font-size: 14px; line-height: 1.6;
    color: #444;
}
.gd-success__lead strong { color: #042331; }
.gd-success__hours {
    background: #f6f8fa;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #555;
    text-align: left;
    margin: 0 0 22px;
}
.gd-success__hours strong { color: #042331; }
.gd-success__alt-cta {
    border-top: 1px dashed #d6d9de;
    padding-top: 18px;
    margin-top: 6px;
}
.gd-success__alt-cta p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}
.gd-success__alt-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #042331 !important;
    border: 1.5px solid #042331;
    background: #ffffff;
    padding: 9px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}
.gd-success__alt-link:hover {
    background: #042331;
    color: #ffffff !important;
}

/* State toggle */
.gd-state-hidden { display: none !important; }

/* ============================================================
   6) SÖZLEŞME POPUP
   ============================================================ */
.gd-sozlesme-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.gd-sozlesme-popup.is-open {
    display: flex;
}
.gd-sozlesme-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.gd-sozlesme-popup__panel {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    max-width: 640px;
    width: 92vw;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    color: #042331;
    overflow: hidden;
}
.gd-sozlesme-popup__header {
    flex-shrink: 0;
    background: #042331;
    color: #ffffff;
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #E60023;
}
.gd-sozlesme-popup__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
}
.gd-sozlesme-popup__close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #ffffff;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.gd-sozlesme-popup__close:hover { background: rgba(255,255,255,0.2); }
.gd-sozlesme-popup__body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 28px;
    font-size: 14px;
    line-height: 1.6;
    color: #2a2a2a;
}
.gd-sozlesme-popup__body h4 {
    margin: 18px 0 6px;
    color: #042331;
    font-size: 14px;
    font-weight: 700;
}
.gd-sozlesme-popup__body p { margin: 0 0 12px; }
.gd-sozlesme-popup__body ul { margin: 6px 0 14px 18px; padding: 0; }
.gd-sozlesme-popup__body li { margin-bottom: 4px; }
.gd-sozlesme-popup__footer {
    flex-shrink: 0;
    padding: 14px 22px;
    border-top: 1px solid #e0e4e8;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f6f8fa;
}
.gd-sozlesme-popup__btn-reject,
.gd-sozlesme-popup__btn-accept {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.3px;
}
.gd-sozlesme-popup__btn-reject {
    background: #ffffff;
    color: #555;
    border: 1.5px solid #d6d9de;
}
.gd-sozlesme-popup__btn-reject:hover { background: #f1f3f5; }
.gd-sozlesme-popup__btn-accept {
    background: #E60023;
    color: #ffffff;
}
.gd-sozlesme-popup__btn-accept:hover { background: #c5001d; }

/* ============================================================
   7) MOBİL
   ============================================================ */
@media (max-width: 768px) {
    .gd-quick-quote {
        padding: 22px 11px;
        font-size: 12px;
        letter-spacing: 1.8px;
        border-radius: 0 12px 12px 0;
    }
    .gd-drawer { width: 100vw; }
    .gd-drawer__header { padding: 16px 18px; }
    .gd-drawer__header h2 { font-size: 15px; }
    .gd-drawer__header p { font-size: 11px; }
    .gd-drawer__body { padding: 16px 16px 48px; }
    .gd-fineprint { font-size: 11px; padding-bottom: 8px; }
    .gd-form .gd-captcha-img { width: 96px; }
    .gd-loading { padding: 60px 16px 40px; min-height: 320px; }
    .gd-loading__logo { width: 72px; height: 72px; }

    .gd-sozlesme-popup__panel {
        width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .gd-sozlesme-popup__body { padding: 16px 18px; }
    .gd-sozlesme-popup__footer { padding: 12px 16px; }
}

@media (max-width: 360px) {
    .gd-quick-quote {
        padding: 20px 10px;
        font-size: 11.5px;
        letter-spacing: 1.6px;
    }
    .gd-drawer__body { padding: 14px 14px 40px; }
}

/* ============================================================
   8) Erişilebilirlik
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .gd-quick-quote { animation: none; }
    .gd-drawer { transition: none; }
    .gd-loading-backdrop { transition: none; }
    .gd-success { animation: none; }
    .gd-loading { animation: none; }
    .gd-loading__logo { animation: gd-rotate 2s linear infinite; }
    .gd-loading__dots::after { animation: none; content: '...'; }
    .gd-captcha-refresh { transition: none; }
}
