/* ═══════════════════════════════════════════════════════════
   InvoiceToChoice - who the tax document is made out to
   ═══════════════════════════════════════════════════════════

   The one control behind src/components/InvoiceToChoice.vue, on all six screens
   that let somebody say who an invoice goes to: the public pay page, the public
   course checkout, and the four admin money dialogs.

   IT IS DELIBERATELY SELF-CONTAINED. The public pages dress their inputs with
   the shared `.field` kit (contact-view.css) and the admin panel with
   `.form-input` (admin.css); a block that borrowed either could only live on one
   side of the app. So the boxes, the labels and the errors are all `.invch__*`
   and depend on nothing but the design tokens in global.css.

   THIS FILE IS NOT `admin`-PREFIXED, ON PURPOSE. scripts/bundle-css.mjs
   partitions on `href.startsWith('/css/admin')`: the admin bundle is loaded by
   the admin shell alone, while the public bundle is loaded by every page, admin
   included. A shared component therefore has to live on the public side to be
   available to both.

   The options are the site's established radio-card idiom (`.enr-choice__option`
   in enrollment-page.css), one step quieter, so it reads the same in a marketing
   funnel and in a dense staff dialog. Logical properties throughout; the block
   declares its own direction because `.admin-main` pins LTR on its subtree. */

.invch {
    direction: rtl;
    text-align: start;
}

/* Solid brand blue, never the brand gradient: this sits at 600, and the gradient
   is legible only through light letterforms. */
.invch__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--primary-color);
}

.invch__note {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.invch__choice {
    margin: var(--space-md) 0 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* A fieldset defaults to min-inline-size: min-content, which lets a long
       company name push the block wider than the dialog column it sits in. */
    min-inline-size: 0;
}

.invch__legend {
    padding: 0;
    margin-block-end: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-tertiary);
}

.invch__option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.invch__option:hover {
    border-color: var(--primary-border);
}

.invch__option--on {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.invch__radio {
    flex: 0 0 17px;
    inline-size: 17px;
    block-size: 17px;
    margin-block-start: 2px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.invch__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-inline-size: 0;
    flex: 1 1 auto;
}

.invch__label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-color);
    /* A company name is arbitrary text from a person; it must wrap rather than
       widen the dialog. */
    overflow-wrap: anywhere;
}

.invch__hint {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ── The two boxes ────────────────────────────────────────
   Rendered ONLY under "another company", which is what makes the option a
   positive statement rather than a pair of fields sitting open beside every
   other one. Indented under it so the relationship is visible without a second
   border. */

.invch__fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-inline-start: 27px;
    margin-block-start: 2px;
}

.invch__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-inline-size: 0;
}

.invch__field-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

.invch__input {
    inline-size: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    direction: rtl;
    text-align: start;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.invch__input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

/* A tax id is a bare numeral: it reads left to right whatever the page does.
   `start` and not `left`, because the rule flips the direction on this very
   element and `start` therefore already resolves leftward - a physical side
   would be one more mirror for somebody to keep in step. */
.invch__input--ltr {
    direction: ltr;
    text-align: start;
}

.invch__input--error,
.invch__input--error:focus {
    border-color: var(--alert-color);
    box-shadow: none;
}

.invch__error {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--alert-color);
}

@media (max-width: 767px) {
    .invch__fields {
        margin-inline-start: 0;
    }
}
