/* ========================================================================
   chataibot-paywall — Design tokens + global stiller
   Tema: aydınlık krem zemin + yeşil→mavi accent. Temiz, profesyonel his.
   ======================================================================== */

:root {
    /* Surfaces — aydınlık katmanlar */
    --bg-0: #F8F4EA;
    --bg-1: #FFFFFF;
    --bg-2: #FFFFFF;
    --bg-3: #F2EEE3;

    /* Borders */
    --border: rgba(37, 43, 71, 0.08);
    --border-strong: rgba(37, 43, 71, 0.18);
    --border-accent: rgba(47, 124, 246, 0.55);

    /* Text — aydınlık zemin üstünde WCAG AA */
    --fg: #232946;
    --fg-2: #565D78;
    --fg-3: #8B91A8;
    --fg-on-accent: #FFFFFF;

    /* Accents — yeşil→mavi */
    --accent: #2F7CF6;
    --accent-hi: #5B97F8;
    --accent-2: #35B97C;
    --accent-glow: rgba(47, 124, 246, 0.35);
    --accent-soft: rgba(47, 124, 246, 0.07);
    --grad-cta: linear-gradient(90deg, #3FBE7E 0%, #2F7CF6 100%);

    /* Semantic */
    --success: #23A55E;
    --success-bg: rgba(35, 165, 94, 0.12);
    --danger: #E5484D;
    --danger-bg: rgba(229, 72, 77, 0.10);
    --warn: #F59E0B;

    /* Shape */
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;

    /* Shadows — yumuşak, navy tonlu */
    --shadow-sm: 0 1px 3px rgba(35, 41, 70, 0.06);
    --shadow-md: 0 6px 20px rgba(35, 41, 70, 0.07);
    --shadow-lg: 0 16px 48px rgba(35, 41, 70, 0.14);
    --shadow-accent: 0 10px 28px rgba(47, 124, 246, 0.30);

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html, body {
    background: var(--bg-0);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overscroll-behavior: none;
    font-feature-settings: 'cv11', 'ss01', 'tnum';
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

button { font: inherit; color: inherit; }

/* Background ambient glow — sayfanın üstünde hafif yeşil/mavi aura */
body::before {
    content: '';
    position: fixed;
    inset: -10% -10% auto -10%;
    height: 55vh;
    background:
        radial-gradient(ellipse 55% 45% at 25% 0%, rgba(63, 190, 126, 0.22), transparent 65%),
        radial-gradient(ellipse 50% 40% at 85% 5%, rgba(47, 124, 246, 0.15), transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* ----- Layout ----- */
.page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hidden { display: none !important; }

/* ----- Brand ----- */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fg);
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--grad-cta);
    box-shadow: 0 6px 18px rgba(47, 124, 246, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.brand-icon svg { display: block; }

.brand-name {
    color: var(--fg);
    letter-spacing: -0.015em;
}

/* ----- Typography ----- */
.title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin: 0 0 8px;
    text-align: center;
    color: var(--fg);
}

.subtitle {
    color: var(--fg-2);
    text-align: center;
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
}

/* ----- Social proof ----- */
.social-proof {
    text-align: center;
    margin: 2px 0 10px;
}

.sp-count {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

.sp-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-3);
    margin-top: 1px;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
}

.stars svg {
    width: 18px;
    height: 18px;
    fill: #F6A623;
    filter: drop-shadow(0 2px 4px rgba(246, 166, 35, 0.35));
}

/* ----- Feature bullets — chip görünümü ----- */
.features {
    list-style: none;
    margin: 2px 0 14px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.features li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-2);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 13px;
    box-shadow: var(--shadow-sm);
}

.features svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--success);
}

/* ----- Plans ----- */
.plans {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.plan-card {
    position: relative;
    background: var(--bg-1);
    border: 2px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 18px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    overflow: hidden;
    text-align: left;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

.plan-card.has-badge { padding-top: 32px; }

.plan-card:active { transform: scale(0.985); }

.plan-card.selected {
    border-color: var(--accent);
    background: linear-gradient(180deg, #FFFFFF 0%, #F2F8FF 100%);
    box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.10), var(--shadow-md);
}

.plan-card.selected .plan-price-main {
    font-size: 23px;
    color: var(--accent);
}

.plan-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.plan-radio {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.plan-card.selected .plan-radio {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.plan-radio svg {
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s var(--ease-spring), transform 0.25s var(--ease-spring);
}

.plan-card.selected .plan-radio svg {
    opacity: 1;
    transform: scale(1);
}

.plan-info {
    flex: 1 1 auto;
    min-width: 0;
}

.plan-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.01em;
}

.plan-price {
    text-align: right;
    flex-shrink: 0;
}

.plan-price-main {
    font-size: 20px;
    font-weight: 800;
    color: var(--fg);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.plan-price-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--fg-3);
    font-weight: 500;
}

.plan-save {
    display: inline-block;
    padding: 4px 10px;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #45C26B, #23A55E);
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(35, 165, 94, 0.30);
}

.plan-badge {
    position: absolute;
    top: 10px;
    left: 18px;
    background: linear-gradient(135deg, #45C26B, #23A55E);
    color: var(--fg-on-accent);
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 12px rgba(35, 165, 94, 0.30);
    line-height: 1.4;
}

.plan-badge.badge-best {
    background: linear-gradient(135deg, #45C26B, #23A55E);
    box-shadow: 0 4px 12px rgba(35, 165, 94, 0.30);
}

/* ----- Buttons ----- */
.btn {
    width: 100%;
    padding: 17px 20px;
    border: none;
    border-radius: var(--r-lg);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s, transform 0.1s ease, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.01em;
    user-select: none;
}

.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--grad-cta);
    color: var(--fg-on-accent);
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
    padding: 16px 20px;
    font-size: 18px;
    animation: cta-pulse 2.6s ease-in-out infinite;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: translateX(-100%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

.btn-secondary {
    background: var(--bg-1);
    color: var(--fg);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active { background: var(--bg-3); }

.btn-ghost {
    background: transparent;
    color: var(--fg-2);
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.btn-ghost:active { color: var(--fg); }

.cta-wrap {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terms {
    color: var(--fg-3);
    font-size: 11px;
    text-align: center;
    margin: 2px 0 0;
    line-height: 1.55;
    font-weight: 500;
}

/* ----- Trust row + payment logos ----- */
.trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fg-2);
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.trust-item svg { color: var(--success); flex-shrink: 0; }

.trust-dot { color: var(--fg-3); }

.pay-logos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.pay-logos span {
    display: inline-flex;
    align-items: center;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-sm);
}

.pay-logos .pl-sbp  { color: #6B21A8; }
.pay-logos .pl-mir  { color: #1B7A40; }
.pay-logos .pl-visa { color: #1A1F71; font-style: italic; }
.pay-logos .pl-mc   { color: #EB001B; }
.pay-logos .pl-yoo  { color: #5B2D90; }

/* ----- Spinner ----- */
.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(35, 41, 70, 0.10);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin: 0 auto;
}

.spinner-sm {
    width: 22px;
    height: 22px;
    border-width: 2px;
}

/* ----- Center block (loading / error) ----- */
.center-block {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    padding: 32px 20px;
}

.status-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: var(--fg);
    letter-spacing: -0.02em;
}

.status-sub {
    color: var(--fg-2);
    font-size: 15px;
    margin: 0;
    max-width: 320px;
    line-height: 1.5;
    font-weight: 500;
}

/* ----- Bottom Sheet ----- */
.sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(35, 41, 70, 0.40);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
}

.sheet-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 201;
    width: 100%;
    max-width: 480px;
    transform: translateX(-50%) translateY(100%);
    background: var(--bg-0);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: 0 -8px 40px rgba(35, 41, 70, 0.18);
    transition: transform 0.4s var(--ease-out);
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    max-height: 92dvh;
    overflow: hidden;
}

.sheet-overlay.visible .sheet {
    transform: translateX(-50%) translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border-strong);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 4px;
    flex-shrink: 0;
}

.sheet-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--fg);
    letter-spacing: -0.02em;
}

.sheet-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(35, 41, 70, 0.06);
    border-radius: 50%;
    color: var(--fg-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s;
}

.sheet-close:active { background: rgba(35, 41, 70, 0.12); color: var(--fg); }

.sheet-plan {
    padding: 0 20px;
    font-size: 14px;
    color: var(--fg-2);
    font-weight: 600;
}

.sheet-plan strong { color: var(--fg); font-weight: 800; font-variant-numeric: tabular-nums; }

.sheet-body {
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}

/* Sheet -> SBP full-screen takeover */
.sheet.sbp-mode {
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
}

.sheet.sbp-mode .sheet-handle,
.sheet.sbp-mode .sheet-header,
.sheet.sbp-mode .sheet-plan {
    display: none;
}

.sheet.sbp-mode .sheet-body {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 16px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 0;
}

/* ----- Payment-method buttons (sheet içinde) ----- */
.pm-btn {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-1);
    box-shadow: var(--shadow-sm);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
}

.pm-btn:active {
    transform: scale(0.985);
    background: var(--bg-3);
    border-color: var(--border-strong);
}

.pm-btn-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(35, 41, 70, 0.05);
    color: var(--fg);
}

.pm-btn-icon.pm-sbp {
    background: linear-gradient(135deg, #FF6B00, #E91E63);
    color: #fff;
}

.pm-btn-label {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 16px;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.01em;
    min-width: 0;
}

.pm-btn-sub {
    display: block;
    font-size: 12px;
    color: var(--fg-3);
    font-weight: 500;
    letter-spacing: 0;
}

.pm-btn-arrow {
    flex-shrink: 0;
    color: var(--fg-3);
}

/* ----- Payment status overlay (waiting/success/timeout) ----- */
.po-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(248, 244, 234, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.po-content {
    text-align: center;
    color: var(--fg);
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.po-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.po-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(35, 41, 70, 0.10);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.po-check {
    display: none;
    width: 80px;
    height: 80px;
}

.po-overlay.po-success .po-spinner { display: none; }
.po-overlay.po-success .po-check { display: block; }

.po-check-circle {
    fill: none;
    stroke: var(--success);
    stroke-width: 4;
    stroke-dasharray: 251;
    stroke-dashoffset: 251;
    animation: draw-circle 0.5s var(--ease-out) forwards;
}

.po-check-mark {
    fill: none;
    stroke: var(--success);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: draw-mark 0.35s var(--ease-out) 0.45s forwards;
}

.po-warn {
    display: none;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--danger-bg);
    color: var(--danger);
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
}

.po-overlay.po-timeout .po-spinner { display: none; }
.po-overlay.po-timeout .po-warn { display: flex; }

.po-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--fg);
}

.po-sub {
    font-size: 14px;
    color: var(--fg-2);
    margin: 0;
    line-height: 1.5;
    max-width: 320px;
}

.po-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 280px;
}

.po-actions { display: none; }
.po-overlay.po-timeout .po-actions { display: flex; }

/* ----- Status icons (success.html / fail.html) ----- */
.success-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 60px rgba(35, 165, 94, 0.20);
    animation: pop-in 0.5s var(--ease-spring);
}

.fail-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--danger-bg);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: 800;
    box-shadow: 0 0 60px rgba(229, 72, 77, 0.15);
    animation: pop-in 0.5s var(--ease-spring);
}

.credit-box {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-top: 4px;
    font-size: 14px;
    color: var(--fg-2);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.credit-box strong {
    color: var(--success);
    font-weight: 800;
    font-size: 18px;
    margin-left: 6px;
    font-variant-numeric: tabular-nums;
}

/* ----- Animations ----- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    50%, 100% { transform: translateX(100%); }
}

@keyframes cta-pulse {
    0%, 100% { box-shadow: 0 10px 28px rgba(47, 124, 246, 0.30); }
    50% { box-shadow: 0 14px 40px rgba(47, 124, 246, 0.48); }
}

@keyframes draw-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes draw-mark {
    to { stroke-dashoffset: 0; }
}

@keyframes pop-in {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fade-up 0.4s var(--ease-out) both; }
.fade-up-d1 { animation-delay: 0.05s; }
.fade-up-d2 { animation-delay: 0.10s; }
.fade-up-d3 { animation-delay: 0.15s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
