/* Official forms index — /{destination}/forms
 *
 * A directory somebody reads standing up, usually on a phone, usually in a hurry.
 * So: one column, big tap targets, and the form name is the link rather than a
 * separate "click here" a thumb has to find.
 *
 * A row whose link we have fetched and found missing is faded and unlinked rather
 * than removed — see FormsIndexModel.Linkable for why. */

.forms-page {
    max-width: 860px;
    padding-bottom: 3rem;
}

.forms-head {
    margin: 1.5rem 0 1.75rem;
}

.forms-head h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.2;
    margin: 0 0 .5rem;
}

/* The sentence that is also the meta description. Sized to be read first. */
.forms-summary {
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text-muted, #4b5563);
    margin: 0;
}

.forms-empty {
    padding: 1.25rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--surface-alt, #f9fafb);
    line-height: 1.6;
}

/* ── Jump links ─────────────────────────────────────────────────────────── */

.forms-jump {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.75rem;
}

.forms-jump a {
    display: inline-block;
    padding: .4rem .75rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 999px;
    font-size: .85rem;
    text-decoration: none;
    color: var(--text, #111827);
    background: #fff;
}

.forms-jump a:hover,
.forms-jump a:focus-visible {
    border-color: var(--accent, #0e769e);
    color: var(--accent, #0e769e);
}

/* ── Groups ─────────────────────────────────────────────────────────────── */

.forms-group {
    margin: 0 0 2rem;
    /* The jump links land here; without this the heading hides under a sticky header. */
    scroll-margin-top: 5rem;
}

.forms-group h2 {
    font-size: 1.15rem;
    margin: 0 0 .75rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--accent, #0e769e);
}

.forms-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .6rem;
}

/* ── One form ───────────────────────────────────────────────────────────── */

.forms-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    padding: .9rem 1rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: #fff;
}

.forms-item--unlinked {
    background: var(--surface-alt, #f9fafb);
    border-style: dashed;
}

.forms-item-main {
    min-width: 0;   /* lets long names wrap instead of forcing the row wide */
}

.forms-item-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 .35rem;
    line-height: 1.35;
}

.forms-item-name a {
    color: var(--accent, #0e769e);
    text-decoration: none;
}

.forms-item-name a:hover,
.forms-item-name a:focus-visible {
    text-decoration: underline;
}

/* Meta line: mode, authority, fee, time. Separated by a middot rather than commas
   so a fee like "US$25, or US$40 expedited" does not read as two items. */
.forms-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    margin: 0;
    font-size: .85rem;
    color: var(--text-muted, #6b7280);
}

.forms-item-meta > span + span::before {
    content: "·";
    margin-right: .75rem;
    color: var(--border, #d1d5db);
}

.forms-mode {
    font-weight: 600;
    color: var(--text, #374151);
}

.forms-item-note {
    margin: .5rem 0 0;
    font-size: .85rem;
    line-height: 1.5;
    color: #92400e;
}

/* ── Actions ────────────────────────────────────────────────────────────── */

.forms-item-actions {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    flex-shrink: 0;
}

.forms-open,
.forms-howto {
    display: inline-block;
    padding: .45rem .8rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
}

.forms-open {
    background: var(--accent, #0e769e);
    color: #fff;
}

.forms-howto {
    border: 1px solid var(--border, #e5e7eb);
    color: var(--text, #374151);
}

.forms-open:hover,
.forms-open:focus-visible { filter: brightness(1.08); }

.forms-howto:hover,
.forms-howto:focus-visible { border-color: var(--accent, #0e769e); color: var(--accent, #0e769e); }

.forms-note {
    margin: 2rem 0 0;
    font-size: .85rem;
    line-height: 1.6;
    color: var(--text-muted, #6b7280);
}

/* ── Phone ──────────────────────────────────────────────────────────────── */

@media (max-width: 560px) {
    .forms-item {
        flex-direction: column;
        gap: .75rem;
    }

    /* Full-width buttons below the text. Side-by-side at this width squeezes the
       form name into a two-word column, which is the part people are scanning. */
    .forms-item-actions {
        flex-direction: row;
        width: 100%;
    }

    .forms-open,
    .forms-howto {
        flex: 1;
    }
}

@media (prefers-color-scheme: dark) {
    .forms-item,
    .forms-jump a { background: var(--surface, #111827); }
    .forms-item--unlinked { background: #1f2937; }
    .forms-item-note { color: #fcd34d; }
}

.forms-more {
    margin: 1rem 0 0;
    font-size: .95rem;
}

.forms-more a {
    color: var(--accent, #0e769e);
    font-weight: 600;
    text-decoration: none;
}

.forms-more a:hover,
.forms-more a:focus-visible { text-decoration: underline; }
