/* Shadows brand tokens for the public site.
   Mirrors the Control Panel palette in public/vendor/shadows/cp.css so the
   member-facing pages and the admin panel read as one product. Loaded after
   style.css in partials/head.antlers.html.

   Before this file, form feedback was written as inline
   style="color:#c0392b" / "#2e7d32" in ~16 templates — a dozen one-off hexes
   that matched neither each other nor the brand. Use the classes below. */

:root {
    --sh-purple: #8e2de2;
    --sh-magenta: #ff269e;
    --sh-grad: linear-gradient(135deg, #8e2de2, #ff269e);

    /* Feedback colours. Both are checked against a dark background for
       WCAG AA body text (>= 4.5:1). */
    --sh-error: #ff8a8a;
    --sh-success: #7ddb9a;
    --sh-warning: #ffd479;

    --sh-muted: #9c93ac;
    --sh-line: rgba(255, 255, 255, .09);
}

/* --- Form + flash feedback ------------------------------------------------
   Replaces the inline colour styles. Kept as modifiers so they layer onto the
   existing .cform__note / .sp-note classes without restyling them. */

.sh-note--error { color: var(--sh-error); }
.sh-note--success { color: var(--sh-success); }
.sh-note--warning { color: var(--sh-warning); }

/* Field-level validation text sits tight under its input. */
.cform__note.sh-note--error,
.cform__note.sh-note--success {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
}

/* Site-wide flash bar, rendered once by partials/flash.antlers.html directly
   under the header. Constrained to the same measure as page content so it
   doesn't run edge to edge on wide screens. */
.sh-flashbar {
    max-width: 1140px;
    margin: 0 auto;
    padding: 18px 20px 0;
}

/* Flash banners get a tinted rail so they register as a block, not stray text. */
.sh-flash {
    display: block;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--sh-line);
    border-left-width: 3px;
    font-size: 14px;
    line-height: 1.5;
    background: rgba(255, 255, 255, .04);
}

.sh-flash--error {
    color: var(--sh-error);
    border-left-color: var(--sh-error);
}

.sh-flash--success {
    color: var(--sh-success);
    border-left-color: var(--sh-success);
}

/* --- Header auth controls -------------------------------------------------
   The header used to render "Log In / Register" to everyone, including signed-in
   members, and the only logout control on the site sat on the account page.
   These style the signed-in state. Styles live here rather than inline so both
   states match. */

.header-cta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-login {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.header-login:hover { color: var(--sh-magenta); }

.header-logout { margin: 0; display: inline-flex; }

.header-logout__btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 7px 15px;
    cursor: pointer;
    white-space: nowrap;
}

.header-logout__btn:hover {
    border-color: var(--sh-magenta);
    color: var(--sh-magenta);
}

/* --- Skip link ------------------------------------------------------------
   Off-screen until focused, then pinned top-left. Lets keyboard users bypass
   the header nav instead of tabbing through every menu item on every page. */

.sh-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 3000;
    padding: 12px 18px;
    background: var(--sh-grad);
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 10px 0;
    text-decoration: none;
}

.sh-skip-link:focus {
    left: 0;
}

/* --- Focus visibility -----------------------------------------------------
   The legacy theme removes outlines on several controls. Keyboard users need
   a visible focus ring; this restores one in the brand colour without
   affecting mouse users. */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--sh-magenta);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Reduced motion -------------------------------------------------------
   Honour the OS setting for users who get motion sickness from the theme's
   transitions and carousels. */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
