/* The bills page's header cards — the one documents are dropped on, the
   one asking for the next bank statement — and the overlay the whole page
   shows while files are dragged over it. */

@layer components {
  /* Side by side from a tablet up, each as wide as the other; one under
     the other on a phone. */
  .bill-intake {
    display: grid;
    gap: 1rem;

    @media (width >= 1024px) {
      gap: 1.5rem;
      grid-auto-columns: minmax(0, 1fr);
      grid-auto-flow: column;
    }
  }

  /* The icon, what the card is for, and its button at the end — under the
     text on a phone — all hung from the card's top, so a title that wraps
     grows the card downwards only. */
  .bill-intake__card {
    align-items: start;
    border: 1.5px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    column-gap: 1.25rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 1.75rem 2rem;
    row-gap: 1rem;

    @media (width < 768px) {
      grid-template-columns: auto minmax(0, 1fr);
      padding: 1.25rem;
    }
  }

  /* The card files are dropped on is drawn as a drop target: dashed, on the
     canvas rather than lifted off it. */
  .bill-intake__card--drop {
    background: transparent;
    border: 2px dashed oklch(from var(--color-brand) l c h / 30%);
  }

  /* Nothing is dragged on a phone: the drop card is its button alone. */
  @media (width < 768px) {
    .bill-intake__card--drop {
      border: none;
      padding: 0;

      .bill-intake__icon,
      .bill-intake__text {
        display: none;
      }
    }
  }

  .bill-intake__icon {
    background: var(--color-brand-tint);
    block-size: 3.5rem;
    border-radius: var(--radius-lg);
    color: var(--color-brand);
    display: inline-grid;
    inline-size: 3.5rem;
    place-items: center;
  }

  .bill-intake__text {
    display: grid;
    gap: 0.375rem;
  }

  .bill-intake__title {
    color: var(--color-ink);
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
  }

  .bill-intake__hint {
    color: var(--color-ink-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
  }

  /* No taller than the list's tabs and filter under it. */
  .bill-intake__btn {
    padding-block: 0.5rem;

    @media (width < 768px) {
      grid-column: 1 / -1;
      justify-content: center;
    }
  }

  /* The upload button is a label inside the form `button_to_upload_bill`
     draws; on a phone the form takes the card's full width so the button
     can. */
  .bill-intake__card > form {
    @media (width < 768px) {
      display: grid;
      grid-column: 1 / -1;
    }
  }

  /* ─── Drop zone ────────────────────────── */

  /* Passes the pointer through, so the drag's enter and leave events keep
     coming from the page under it. */
  .bills-drop-zone {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    background: oklch(from var(--color-canvas) l c h / 80%);
    display: grid;
    inset: 0;
    padding: 1.5rem;
    place-items: center;
    pointer-events: none;
    position: fixed;
    z-index: var(--z-sheet);
  }

  .bills-drop-zone__card {
    background: var(--color-surface);
    border: 2px dashed var(--color-brand);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lifted);
    display: grid;
    gap: 0.5rem;
    justify-items: center;
    max-inline-size: 32rem;
    padding: 3rem 4rem;
    text-align: center;
  }

  .bills-drop-zone__icon {
    background: var(--color-brand-tint);
    block-size: 3.5rem;
    border-radius: var(--radius-lg);
    color: var(--color-brand);
    display: inline-grid;
    inline-size: 3.5rem;
    margin-block-end: 0.75rem;
    place-items: center;
  }

  .bills-drop-zone__title {
    color: var(--color-ink);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
  }

  .bills-drop-zone__hint {
    color: var(--color-ink-muted);
    font-size: 0.9375rem;
    margin: 0;
  }
}
