@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
    --bg: #0e5272;
    --bg-2: #0b3f58;
    --panel: #ffffff;
    --panel-2: #f7f9fc;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #1a7fa0;
    --brand-2: #0e5272;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 20px 45px rgba(10, 50, 80, 0.3);
    --radius: 20px;
  }

  /* ── Scoped font for widget (does not affect site) ─── */
  .chat-widget,
  .chat-launcher-wrap,
  .chat-tooltip {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  }

  .chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 999px;
    background: white;
    /* Changed to white to house the image */
    box-shadow: 0 12px 30px rgba(14, 82, 114, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    /* Ensure image clips to circle */
    padding: 0;
    /* Remove padding for edge-to-edge image */
  }

  .chat-launcher:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 18px 40px rgba(14, 82, 114, 0.55);
  }

  .chat-launcher img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Add online dot directly to launcher */
  .chat-launcher-wrap {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: floatIn 0.5s ease-out 1s both;
  }

  @keyframes floatIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .chat-tooltip {
    background: white;
    color: #0b3f58;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 20px 12px 18px;
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(14, 82, 114, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.2px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .chat-tooltip:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(14, 82, 114, 0.35);
  }

  .chat-tooltip-close {
    margin-left: 6px;
    opacity: 0.5;
    font-size: 16px;
    font-weight: 800;
    transition: opacity 0.2s;
  }

  .chat-tooltip:hover .chat-tooltip-close {
    opacity: 0.9;
  }

  .chat-launcher-wrap .chat-launcher {
    position: relative;
    right: 0;
    bottom: 0;
  }

  .chat-launcher-wrap::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 10000;
    pointer-events: none;
  }

  .chat-widget {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 390px;
    max-width: calc(100vw - 24px);
    height: 700px;
    max-height: calc(100vh - 130px);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 9998;
    backdrop-filter: blur(10px);
  }

  .chat-widget.open {
    display: flex;
    animation: popIn 0.22s ease;
  }

  @keyframes popIn {
    from {
      opacity: 0;
      transform: translateY(16px) scale(0.98);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .chat-header {
    padding: 16px 18px 12px;
    background: linear-gradient(135deg, #0b3f58 0%, #0e5272 60%, #1a7fa0 100%);
    color: white;
    position: relative;
  }

  .chat-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .chat-brand {
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .chat-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: white;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }

  .chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Online status dot on avatar */
  .chat-avatar::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #0e5272;
  }

  .chat-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.3px;
  }

  .chat-subtitle {
    font-size: 11.5px;
    opacity: 0.7;
    margin-top: 3px;
    letter-spacing: 0.1px;
  }

  .chat-close {
    appearance: none;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .chat-close:hover {
    background: rgba(255, 255, 255, 0.22);
  }

  .progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    overflow: hidden;
  }

  .progress-bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7dd3e8, #ffffff);
    border-radius: 999px;
    transition: width 0.3s ease;
  }

  .progress-label {
    font-size: 12px;
    opacity: 0.9;
    min-width: 56px;
    text-align: right;
  }

  .chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: linear-gradient(to bottom, #f0f7fa, #ffffff);
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
  }

  .bubble-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
  }

  .bubble-row.bot {
    justify-content: flex-start;
  }

  .bubble-row.user {
    justify-content: flex-end;
  }

  .bubble {
    max-width: 82%;
    padding: 13px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  .bubble.bot {
    background: white;
    color: var(--text);
    border-bottom-left-radius: 6px;
    border: 1px solid #d4e8f0;
    box-shadow: 0 2px 12px rgba(14, 82, 114, 0.07);
  }

  .bubble.user {
    background: linear-gradient(135deg, #0e5272, #1a7fa0);
    color: white;
    border-bottom-right-radius: 6px;
  }

  .chat-footer {
    border-top: 1px solid var(--line);
    padding: 14px;
    background: white;
  }

  .input-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .text-input,
  .date-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 14px;
    font-size: 14px;
    outline: none;
    background: #f9fbff;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  }

  .text-input:focus,
  .date-input:focus {
    border-color: #7dd3e8;
    background: white;
    box-shadow: 0 0 0 4px rgba(14, 82, 114, 0.10);
  }

  textarea.text-input {
    min-height: 98px;
    resize: vertical;
  }

  .choice-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .choice-btn {
    border: 1.5px solid #c8dfe8;
    background: #f0f7fb;
    color: #0b3f58;
    padding: 11px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.18s ease;
    text-align: center;
    width: 100%;
    font-family: inherit;
  }

  .choice-btn:hover {
    border-color: #1a7fa0;
    background: #e0f2f9;
    color: #0b3f58;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 82, 114, 0.12);
  }

  .choice-btn:active {
    transform: scale(0.97);
    background: #0e5272;
    color: white;
    border-color: #0e5272;
  }

  .action-row {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .btn {
    appearance: none;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
  }

  .btn:hover {
    transform: translateY(-1px);
  }

  .btn.primary {
    flex: 1;
    background: linear-gradient(135deg, #0e5272, #1a7fa0);
    color: white;
    font-family: inherit;
  }

  .btn.secondary {
    background: #e8f4f8;
    color: #0b3f58;
    font-family: inherit;
  }

  .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
  }

  .helper {
    font-size: 12px;
    color: var(--muted);
    padding: 0 2px;
  }

  .error {
    color: var(--danger);
    font-size: 12px;
    min-height: 16px;
    padding-left: 2px;
  }

  .success-box,
  .error-box {
    border-radius: 18px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
  }

  .success-box {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
  }

  .error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
  }

  /* Centered CTA for the first in-chat option only */
  .claim-cta-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 20px 4px;
  }

  .claim-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, #0b3f58, #1a7fa0);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 22px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(14, 82, 114, 0.28);
    letter-spacing: -0.1px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .claim-cta-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(14, 82, 114, 0.38);
  }

  .claim-cta-btn:active {
    transform: scale(0.97);
  }

  .typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 12px 14px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    border: 1px solid #eef2f7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  }

  .typing span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #94a3b8;
    animation: blink 1.2s infinite ease-in-out;
  }

  .typing span:nth-child(2) {
    animation-delay: 0.15s;
  }

  .typing span:nth-child(3) {
    animation-delay: 0.3s;
  }

  @keyframes blink {

    0%,
    80%,
    100% {
      opacity: 0.3;
      transform: translateY(0);
    }

    40% {
      opacity: 1;
      transform: translateY(-2px);
    }
  }

  @media (max-width: 520px) {
    .chat-widget {
      right: 12px;
      bottom: 86px;
      width: calc(100vw - 24px);
      height: calc(100vh - 110px);
      border-radius: 22px;
    }

    .chat-launcher-wrap {
      right: 12px;
      bottom: 12px;
    }
  }
