/* base.css - Global styles extracted from base.html */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Clip the few px a full-bleed (100vw) landing overhangs past the scrollbar.
 * Must sit on the root element: overflow on <body> doesn't propagate to the
 * viewport while <html> is visible. `clip` avoids a horizontal scroll container. */
html {
    overflow-x: clip;
}

/* Anchors and focused fields stop below the sticky navbar instead of under it; pages without the navbar keep no offset. */
html:has(.navbar) {
    scroll-padding-top: calc(var(--hc-navbar-height) + var(--hc-space-4));
}

body {
    font-family: var(--hc-font-sans);
    line-height: var(--hc-leading-normal);
    color: var(--hc-gray-700);
    background-color: var(--hc-surface-page);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Skip link (WCAG 2.4.1 Bypass Blocks) — off-screen until keyboard-focused,
 * then it drops in at the top-left so keyboard users can jump past the navbar. */
.skip-link {
    position: absolute;
    left: var(--hc-space-2);
    top: calc(-1 * var(--hc-space-16));
    z-index: 1000;
    padding: var(--hc-space-2) var(--hc-space-4);
    background-color: var(--hc-surface-dark);
    color: var(--hc-on-dark);
    text-decoration: none;
    font-weight: var(--hc-font-semibold);
    border-radius: var(--hc-radius-md);
    box-shadow: var(--hc-shadow-lg);
    transition: top var(--hc-transition-fast);
}

.skip-link:focus {
    top: var(--hc-space-2);
    outline: none;
    box-shadow: var(--hc-shadow-lg), var(--hc-shadow-focus);
}

h1, h2, h3, h4 {
    font-family: var(--hc-font-display);
    font-weight: var(--hc-font-normal);
    letter-spacing: var(--hc-tracking-tight);
    color: var(--hc-gray-900);
    line-height: var(--hc-leading-tight);
}

/* Light translucent header, as on the marketing site. */
.navbar {
    position: sticky;
    top: 0;
    z-index: var(--hc-z-navbar);
    background-color: var(--hc-navbar-bg);
    backdrop-filter: var(--hc-navbar-backdrop);
    border-bottom: 1px solid var(--hc-navbar-border);
    padding: var(--hc-space-4) 0;
    min-height: var(--hc-navbar-height);
}

.navbar .container {
    max-width: var(--hc-container-max);
    margin: 0 auto;
    padding: 0 var(--hc-space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--hc-space-2);
}

.navbar .brand {
    display: block;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: var(--hc-logo-height);
    width: auto;
}

@media (max-width: 900px) {
    .brand-logo {
        height: var(--hc-logo-height-sm);
    }
}

/* The links take the space left of the logo (basis 0), so a long email shortens with an ellipsis instead of wrapping the header. */
.navbar .nav-links {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    justify-content: flex-end;
    gap: var(--hc-space-5);
    align-items: center;
}

.navbar .nav-links a:not(.btn) {
    color: var(--hc-navbar-text);
    font-weight: var(--hc-font-medium);
    white-space: nowrap;
    text-decoration: none;
    padding: var(--hc-space-2) var(--hc-space-4);
    border-radius: var(--hc-radius-full);
    transition: background-color var(--hc-transition-base);
}

.navbar .nav-links span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hc-navbar-text);
}

.navbar .nav-links a:not(.btn):hover {
    color: var(--hc-gray-900);
    background-color: var(--hc-gray-100);
}

.navbar .nav-links a:focus-visible {
    outline: 2px solid var(--hc-primary-700);
    outline-offset: 2px;
}

/* Compact header on phones: the email is dropped and the side padding matches the page's. Kept below the base nav rules so it wins. */
@media (max-width: 600px) {
    .navbar .container {
        padding: 0 var(--hc-space-4);
    }

    .navbar .nav-links {
        gap: var(--hc-space-2);
    }

    .navbar .nav-links .btn {
        padding: var(--hc-space-2) var(--hc-space-4);
        white-space: nowrap;
    }

    /* With no email left to shorten, a long name may wrap rather than push Logout off-screen. */
    .navbar .nav-links a:not(.btn) {
        padding: var(--hc-space-2);
        white-space: normal;
    }

    .navbar .nav-links span {
        display: none;
    }
}

/* Smallest phones: a shorter logo and tighter gaps so both header actions share the row with it. */
@media (max-width: 360px) {
    .brand-logo {
        height: var(--hc-logo-height-xs);
    }

    .navbar .container,
    .navbar .nav-links {
        gap: var(--hc-space-1);
    }

    .navbar .nav-links a:not(.btn) {
        padding: var(--hc-space-2) var(--hc-space-1);
    }
}

/* Pill buttons: amber for the main action, outline for the second. */
/* Our focus ring is the outline below, so Bootstrap's coloured focus glow is switched off for every variant. */
.btn {
    --bs-btn-focus-box-shadow: none;
    display: inline-block;
    padding: var(--hc-space-3) var(--hc-space-6);
    border: var(--hc-btn-border-width) solid transparent;
    border-radius: var(--hc-radius-full);
    text-decoration: none;
    cursor: pointer;
    font-family: var(--hc-font-sans);
    font-size: var(--hc-text-sm);
    font-weight: var(--hc-font-semibold);
    transition: background-color var(--hc-transition-fast), border-color var(--hc-transition-fast);
}

.btn:focus-visible {
    outline: 2px solid var(--hc-primary-700);
    outline-offset: 2px;
}

/* On dark surfaces (hero, photo panels) the focus ring must be light to show. */
.btn-ghost:focus-visible {
    outline: 2px solid var(--hc-on-dark);
    outline-offset: 2px;
}

/* The --bs-btn-* values feed Bootstrap's .btn:hover, :active and :disabled rules, which out-rank these selectors. */
.btn-primary,
.btn-primary:focus-visible {
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: var(--hc-accent-hover);
    --bs-btn-active-color: var(--hc-gray-900);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-bg: var(--hc-accent);
    --bs-btn-disabled-color: var(--hc-gray-900);
    --bs-btn-disabled-border-color: transparent;
    background-color: var(--hc-accent);
    color: var(--hc-gray-900);
    box-shadow: var(--hc-shadow-amber);
}

.btn-primary:hover {
    background-color: var(--hc-accent-hover);
    color: var(--hc-gray-900);
}

/* Hover and keyboard focus both read the --bs-btn-hover-* values (Bootstrap's .btn:hover and .btn:focus-visible), so each variant sets its colours only there. */
.btn-secondary {
    --bs-btn-hover-bg: var(--hc-white);
    --bs-btn-hover-color: var(--hc-gray-900);
    --bs-btn-hover-border-color: var(--hc-gray-900);
    --bs-btn-active-bg: var(--hc-white);
    --bs-btn-active-color: var(--hc-gray-900);
    --bs-btn-active-border-color: var(--hc-gray-900);
    --bs-btn-disabled-bg: var(--hc-white);
    --bs-btn-disabled-color: var(--hc-gray-900);
    --bs-btn-disabled-border-color: var(--hc-gray-200);
    background-color: var(--hc-white);
    color: var(--hc-gray-900);
    border-color: var(--hc-gray-200);
}

/* Outline variant: set the border colour here, otherwise Bootstrap's blue .btn-outline-primary leaks through. */
.btn-outline-primary {
    --bs-btn-hover-bg: var(--hc-primary-50);
    --bs-btn-hover-color: var(--hc-primary-700);
    --bs-btn-hover-border-color: var(--hc-primary-600);
    --bs-btn-active-bg: var(--hc-primary-50);
    --bs-btn-active-color: var(--hc-primary-700);
    --bs-btn-active-border-color: var(--hc-primary-600);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-color: var(--hc-primary-700);
    --bs-btn-disabled-border-color: var(--hc-primary-300);
    background-color: transparent;
    color: var(--hc-primary-700);
    border-color: var(--hc-primary-300);
}

/* Semantic variants (session outcomes, destructive confirms): without these, Bootstrap's off-brand green and red leak through. */
.btn-success {
    --bs-btn-hover-bg: var(--hc-success-700);
    --bs-btn-hover-color: var(--hc-white);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: var(--hc-success-700);
    --bs-btn-active-color: var(--hc-white);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-bg: var(--hc-success-600);
    --bs-btn-disabled-color: var(--hc-white);
    --bs-btn-disabled-border-color: transparent;
    background-color: var(--hc-success-600);
    color: var(--hc-white);
}

.btn-danger {
    --bs-btn-hover-bg: var(--hc-error-800);
    --bs-btn-hover-color: var(--hc-white);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: var(--hc-error-800);
    --bs-btn-active-color: var(--hc-white);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-bg: var(--hc-error-600);
    --bs-btn-disabled-color: var(--hc-white);
    --bs-btn-disabled-border-color: transparent;
    background-color: var(--hc-error-600);
    color: var(--hc-white);
}

.btn-outline-danger {
    --bs-btn-hover-bg: var(--hc-error-50);
    --bs-btn-hover-color: var(--hc-error-700);
    --bs-btn-hover-border-color: var(--hc-error-600);
    --bs-btn-active-bg: var(--hc-error-50);
    --bs-btn-active-color: var(--hc-error-700);
    --bs-btn-active-border-color: var(--hc-error-600);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-color: var(--hc-error-700);
    --bs-btn-disabled-border-color: var(--hc-error-500);
    background-color: transparent;
    color: var(--hc-error-700);
    border-color: var(--hc-error-500);
}

/* Outline pill on dark green or photo panels. */
.btn-ghost {
    --bs-btn-hover-color: var(--hc-on-dark);
    --bs-btn-hover-border-color: var(--hc-glass-border-strong);
    --bs-btn-active-bg: var(--hc-glass-fill);
    --bs-btn-active-color: var(--hc-on-dark);
    --bs-btn-active-border-color: var(--hc-glass-border-strong);
    background-color: transparent;
    color: var(--hc-on-dark);
    border-color: var(--hc-glass-border-strong);
}

.btn-ghost:hover {
    background-color: var(--hc-glass-fill);
    color: var(--hc-on-dark);
}

.container {
    max-width: var(--hc-container-max);
    margin: 0 auto;
    padding: var(--hc-space-5);
}

/* Same side padding as the phone header, so the logo lines up with the page content. */
@media (max-width: 600px) {
    .container {
        padding-left: var(--hc-space-4);
        padding-right: var(--hc-space-4);
    }
}

.card {
    background: var(--hc-white);
    padding: var(--hc-space-8);
    border-radius: var(--hc-radius-xl);
    box-shadow: var(--hc-shadow-md);
    border: 1px solid var(--hc-gray-200);
    margin: var(--hc-space-5) 0;
}

a {
    color: var(--hc-primary-600);
}

.form-group {
    margin-bottom: var(--hc-space-5);
}

.form-group label {
    display: block;
    margin-bottom: var(--hc-space-1);
    font-weight: var(--hc-font-medium);
}

.form-group input {
    width: 100%;
    padding: var(--hc-space-3);
    border: 1px solid var(--hc-gray-200);
    border-radius: var(--hc-radius-md);
    font-size: var(--hc-text-base);
}

.form-group input:focus {
    outline: none;
    border-color: var(--hc-primary-500);
    box-shadow: var(--hc-shadow-focus);
}

.messages {
    margin: var(--hc-space-5) 0;
}

.message {
    padding: var(--hc-space-3) var(--hc-space-4);
    border-radius: var(--hc-radius-md);
    margin: var(--hc-space-1) 0;
}

.message.success {
    background-color: var(--hc-flash-success-bg);
    color: var(--hc-flash-success-text);
    border: 1px solid var(--hc-flash-success-border);
}

.message.error {
    background-color: var(--hc-flash-error-bg);
    color: var(--hc-flash-error-text);
    border: 1px solid var(--hc-flash-error-border);
}

.message.info {
    background-color: var(--hc-flash-info-bg);
    color: var(--hc-flash-info-text);
    border: 1px solid var(--hc-flash-info-border);
}

/* Light footer with a hairline on top, as on the marketing site. */
.site-footer {
    margin-top: var(--hc-space-16);
    border-top: 1px solid var(--hc-navbar-border);
    color: var(--hc-gray-600);
    padding: var(--hc-space-10) 0 var(--hc-space-12);
}

.site-footer .container {
    max-width: var(--hc-container-max);
    margin: 0 auto;
    padding: 0 var(--hc-space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hc-space-3);
    text-align: center;
}

.footer-brand {
    display: block;
    text-decoration: none;
}

.footer-brand .brand-logo {
    height: var(--hc-logo-height-sm);
}

.footer-tagline {
    font-family: var(--hc-font-display);
    font-size: var(--hc-text-lg);
    color: var(--hc-gray-900);
    margin: 0;
}

.footer-legal {
    font-size: var(--hc-text-sm);
    margin: 0;
}
