
  /* ─── Overlay ───────────────────────────────────────── */
  .ebook-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(7, 34, 58, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .ebook-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  /* ─── Card ──────────────────────────────────────────── */
  .ebook-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border-radius: 1.125rem;
    box-shadow:
      0 24px 48px rgba(0, 0, 0, 0.14),
      0 0 0 1px rgba(20, 93, 160, 0.06);
    padding: 0;
    transform: translateY(18px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .ebook-overlay.is-active .ebook-card {
    transform: translateY(0) scale(1);
  }

  /* Accent gradient bar */
  .ebook-accent {
    height: 4px;
    background: linear-gradient(90deg, #145da0 0%, #3b82f6 50%, #06b6d4 100%);
    border-radius: 1.125rem 1.125rem 0 0;
  }

  /* Scrollbar */
  .ebook-card::-webkit-scrollbar { width: 4px; }
  .ebook-card::-webkit-scrollbar-track { background: transparent; }
  .ebook-card::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

  /* ─── Close ─────────────────────────────────────────── */
  .ebook-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
  }
  .ebook-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
  }

  /* ─── Header ────────────────────────────────────────── */
  .ebook-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.25rem 1.5rem 0;
    animation: ebookFadeDown 0.4s ease both;
  }
  .ebook-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #145da0, #3b82f6);
    box-shadow: 0 4px 12px rgba(20, 93, 160, 0.3);
  }
  .ebook-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #07223a;
    margin: 0;
    line-height: 1.3;
  }
  .ebook-title span { color: #145da0; }
  .ebook-desc {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0.125rem 0 0;
    line-height: 1.4;
  }

  /* ─── Form ──────────────────────────────────────────── */
  .ebook-form {
    padding: 1.125rem 1.5rem 1.5rem;
  }

  /* 2-col grid */
  .ebook-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
  }

  .ebook-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    animation: ebookFadeUp 0.35s ease both;
  }
  .ebook-field:nth-child(1) { animation-delay: 0.05s; }
  .ebook-field:nth-child(2) { animation-delay: 0.1s; }
  .ebook-field:nth-child(3) { animation-delay: 0.15s; }
  .ebook-field:nth-child(4) { animation-delay: 0.2s; }
  .ebook-field:nth-child(5) { animation-delay: 0.25s; }
  .ebook-field:nth-child(6) { animation-delay: 0.3s; }

  .ebook-field label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .ebook-field input,
  .ebook-field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
  }
  .ebook-field select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='7' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    cursor: pointer;
  }
  .ebook-field input:focus,
  .ebook-field select:focus {
    border-color: #145da0;
    box-shadow: 0 0 0 3px rgba(20, 93, 160, 0.08);
    background: #fff;
  }
  .ebook-field input::placeholder { color: #94a3b8; }

  /* Error state */
  .ebook-field input.field-error,
  .ebook-field select.field-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.06);
    animation: ebookShake 0.35s ease;
  }

  /* Error message */
  .ebook-error-msg {
    margin: 0.5rem 0 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 0.375rem;
    border: 1px solid #fecaca;
  }

  /* ─── Submit Button ─────────────────────────────────── */
  .ebook-btn {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.7rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #145da0 0%, #1e6fba 100%);
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(20, 93, 160, 0.25);
    animation: ebookFadeUp 0.35s ease 0.35s both;
  }
  .ebook-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(20, 93, 160, 0.35);
    background: linear-gradient(135deg, #1a6ab8 0%, #2980d1 100%);
  }
  .ebook-btn:active { transform: translateY(0); }
  .ebook-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
  }

  .ebook-btn-text,
  .ebook-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  /* Spinner */
  .ebook-spin { animation: ebookSpin 0.75s linear infinite; }

  /* ─── Animations ────────────────────────────────────── */
  @keyframes ebookFadeDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes ebookFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes ebookShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-4px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(2px); }
  }
  @keyframes ebookSpin {
    to { transform: rotate(360deg); }
  }

  /* ─── Mobile: stack to 1 column ─────────────────────── */
  @media (max-width: 520px) {
    .ebook-card {
      max-width: 100%;
      border-radius: 0.875rem;
    }
    .ebook-grid {
      grid-template-columns: 1fr;
      gap: 0.625rem;
    }
    .ebook-header {
      padding: 1rem 1.25rem 0;
    }
    .ebook-form {
      padding: 1rem 1.25rem 1.25rem;
    }
    .ebook-title { font-size: 1rem; }
    .ebook-icon {
      width: 38px;
      height: 38px;
      border-radius: 0.625rem;
    }
    .ebook-icon svg { width: 18px; height: 18px; }
  }
