/* A small layer on top of Pico. Four clearly separate page regions:
   site header, menu bar (tabs + account), the page body, and the footer. */

/* Bands (header, menu bar, footer) are tinted away from the page background
   so the body reads as a separate area in both light and dark themes. */
:root {
    --band-bg: color-mix(in srgb, var(--pico-color) 7%, var(--pico-background-color));
    --band-bg-strong: color-mix(in srgb, var(--pico-color) 11%, var(--pico-background-color));
}

/* --- Header: brand + site links ------------------------------------- */
.site-header {
    background: var(--band-bg);
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-block: 0.4rem;
}
.site-header nav { margin-bottom: 0; }
/* The page you're on, in the header and footer menus (same treatment as
   the menu bar's current tab, scaled down). */
.site-header nav a[aria-current="page"],
.site-footer nav a[aria-current="page"] {
    color: var(--pico-primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.35em;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.brand img { display: block; }

/* Stylised wordmark: "tulpn" in the logo's blue-to-teal gradient, ".com"
   smaller and in the arrow orange, like the reference logo. */
.wordmark {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
    color: #3aa7dc; /* fallback where background-clip:text isn't supported */
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .wordmark {
        background: linear-gradient(90deg, #3aa0e0 0%, #14b8a6 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}
.wordmark .tld {
    margin-left: 0.04em;
    font-size: 0.58em;
    font-weight: 700;
    letter-spacing: 0;
    background: none;
    -webkit-text-fill-color: #f08a1c;
    color: #f08a1c;
}

/* --- Menu bar: page tabs on the left, account on the right ----------- */
.subnav {
    background: var(--band-bg-strong);
    border-bottom: 1px solid var(--pico-muted-border-color);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
}
.subnav nav { margin-bottom: 0; }
.subnav nav ul li { padding: 0; white-space: nowrap; }
.subnav nav ul:first-child { gap: 0.25rem; }
.subnav nav ul:first-child a {
    display: block;
    margin: 0;
    padding: 0.95rem 1rem;
    border-bottom: 3px solid transparent;
    text-decoration: none;
    color: var(--pico-muted-color);
}
.subnav nav ul:first-child a:hover { color: var(--pico-color); }
.subnav nav ul:first-child a[aria-current="page"] {
    color: var(--pico-color);
    font-weight: 600;
    border-bottom-color: var(--pico-primary);
}

/* --- Page body: clearly its own area, with room to breathe ----------- */
body > main { padding-block: 2rem 3rem; }

/* --- Footer ----------------------------------------------------------- */
.site-footer {
    background: var(--band-bg);
    border-top: 1px solid var(--pico-muted-border-color);
    padding-block: 1rem;
    font-size: 0.9rem;
}
.site-footer nav { margin-bottom: 0; }

/* --- Account dropdown ------------------------------------------------- */
.account-menu { margin: 0; }
.account-menu summary { display: flex; align-items: center; gap: 0.6rem; max-width: 20rem; }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role {
    flex-shrink: 0;
    padding: 0.1rem 0.55rem;
    border-radius: 1rem;
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.account-menu ul button { width: 100%; margin: 0; }

/* --- Landing pages ---------------------------------------------------- */
.hero { padding-block: 1.5rem 1rem; text-align: center; }
.hero h1 { max-width: 40rem; margin-inline: auto; }
.lead { max-width: 38rem; margin-inline: auto; font-size: 1.15rem; color: var(--pico-muted-color); }
main > section + section { margin-top: 2.5rem; }

/* --- Forms: help text belongs to the field above it ------------------- */
/* Django renders it as a plain span after the input; make it read as a
   caption under that field, with clear space before the next field. */
form .helptext {
    display: block;
    margin-top: calc(var(--pico-spacing) * -0.6);
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--pico-muted-color);
}
form > p { margin-bottom: calc(var(--pico-spacing) * 1.75); }

/* --- Notices: warning / success / error / info ------------------------ */
/* Pico has no alert styles. A coloured bar and a light tint of the same
   colour, mixed with the page background so it works in dark mode too.
   Django messages map onto these through message.tags. */
.notice {
    --notice-color: var(--pico-primary);
    margin-bottom: var(--pico-spacing);
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--notice-color);
    border-radius: var(--pico-border-radius);
    background: color-mix(in srgb, var(--notice-color) 14%, var(--pico-background-color));
    color: var(--pico-color);
}
.notice > :last-child { margin-bottom: 0; }
.notice a { font-weight: 600; }
.notice-info { --notice-color: var(--pico-primary); }
.notice-success { --notice-color: #2e9e5b; }
.notice-warning { --notice-color: #f08a1c; }
.notice-error { --notice-color: #d93526; }

/* --- Preview of a promoter-facing page, shown to the business --------- */
/* Tinted and dashed so it reads as "this is what another page shows",
   not as instructions on this one. */
.promoter-preview {
    margin-bottom: var(--pico-spacing);
    padding: 1rem 1.25rem 0.25rem;
    border: 1px dashed color-mix(in srgb, var(--pico-primary) 55%, transparent);
    border-radius: var(--pico-border-radius);
    background: color-mix(in srgb, var(--pico-primary) 7%, var(--pico-background-color));
}
.promoter-preview-caption {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pico-muted-color);
}

/* --- Small centred cards: "check your email" and similar ---------------- */
.auth-card {
    max-width: 32rem;
    margin: calc(var(--pico-spacing) * 2) auto;
    text-align: center;
}
.auth-card-icon { color: var(--pico-primary); margin-bottom: 0.5rem; }
.auth-card-kicker {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pico-muted-color);
}
.auth-card h1 { margin-bottom: 1rem; }
.auth-card-muted { font-size: 0.9rem; color: var(--pico-muted-color); }
.auth-card footer { text-align: center; }
/* Forms inside a card: left-aligned label, full-width field and button. */
.auth-card-form { margin: 1.5rem 0 1rem; text-align: left; }
.auth-card-form button { width: 100%; }

/* --- Page navigation under long lists (templates/_pagination.html) ---- */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: var(--pico-spacing);
    font-size: 0.9rem;
}
.pagination span { color: var(--pico-muted-color); }

/* --- Commission status help: (i) tooltip and legend ------------------- */
.status-help { color: var(--pico-muted-color); cursor: help; border-bottom: none; }
/* Pico's tooltips are one line (nowrap); these explanations are sentences,
   so wrap them in a readable box instead of running off the screen. */
.status-help[data-tooltip]::before {
    width: max-content;
    max-width: min(18rem, 80vw);
    white-space: normal;
    text-align: left;
    line-height: 1.4;
}
.status-legend { margin-top: var(--pico-spacing); font-size: 0.9rem; }
.status-legend dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0.75rem 0 0; }
.status-legend dt { font-weight: 600; }
.status-legend dd { margin: 0; color: var(--pico-muted-color); }
