/*
 * MZJ Group — Housing Disrepair Specialists
 * File    : public/assets/css/main.css
 * Purpose : Design tokens (CSS custom properties), Inter font declaration,
 *           CSS reset, base typography, global utilities.
 *           Imported first — all other CSS files build on these foundations.
 *
 * Design language derived from the logo:
 *   - The logo is metallic silver on deep charcoal with a sharp red roofline.
 *   - The site carries that authority: dark, precise, high-contrast.
 *   - Red is used for action and urgency only — never decoratively.
 *   - Silver/grey tones handle hierarchy between black and white.
 *   - Inter chosen for its legibility at small sizes and clean geometry
 *     that echoes the logo's engineered letterforms.
 */

/* ═══════════════════════════════════════════════════════════
   FONT — Self-hosted Inter (GDPR-safe, no Google Fonts calls)
   ═══════════════════════════════════════════════════════════ */

@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-variable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */

:root {

    /* ── Brand colours ───────────────────────────────────────── */
    --clr-red:          #D71920;   /* Primary red — CTAs, highlights */
    --clr-red-dark:     #B01218;   /* Hover state for red */
    --clr-red-light:    #F5E6E7;   /* Tint — alert backgrounds */

    --clr-black:        #111111;   /* Near-black — body text, header bg */
    --clr-charcoal:     #1E1E1E;   /* Slightly lifted black — footer */
    --clr-dark:         #2C2C2C;   /* Dark panels, sidebar */

    --clr-silver:       #C8C8C8;   /* Silver — secondary elements */
    --clr-silver-light: #E8E8E8;   /* Light silver — borders, dividers */
    --clr-grey:         #6B6B6B;   /* Mid-grey — body copy secondary */
    --clr-grey-light:   #F4F4F4;   /* Near-white grey — section backgrounds */

    --clr-white:        #FFFFFF;
    --clr-bg:           #FFFFFF;   /* Page background */

    /* ── Status colours (admin panel) ────────────────────────── */
    --clr-status-new:         #1A56DB;
    --clr-status-new-bg:      #EBF5FF;
    --clr-status-reviewing:   #9061F9;
    --clr-status-reviewing-bg:#F5F3FF;
    --clr-status-progress:    #E3A008;
    --clr-status-progress-bg: #FDF6B2;
    --clr-status-completed:   #057A55;
    --clr-status-completed-bg:#DEF7EC;
    --clr-status-rejected:    #9B1C1C;
    --clr-status-rejected-bg: #FDE8E8;

    /* ── Typography ──────────────────────────────────────────── */
    --font-body:        'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:        'Courier New', monospace;

    /* Type scale — minor third (1.25 ratio) */
    --text-xs:    0.75rem;   /*  12px */
    --text-sm:    0.875rem;  /*  14px */
    --text-base:  1rem;      /*  16px */
    --text-md:    1.125rem;  /*  18px */
    --text-lg:    1.25rem;   /*  20px */
    --text-xl:    1.5rem;    /*  24px */
    --text-2xl:   1.875rem;  /*  30px */
    --text-3xl:   2.25rem;   /*  36px */
    --text-4xl:   2.75rem;   /*  44px */
    --text-5xl:   3.5rem;    /*  56px */

    /* Font weights */
    --fw-regular:  400;
    --fw-medium:   500;
    --fw-semibold: 600;
    --fw-bold:     700;
    --fw-black:    900;

    /* Line heights */
    --lh-tight:  1.2;
    --lh-snug:   1.35;
    --lh-normal: 1.6;
    --lh-relaxed:1.75;

    /* Letter spacing */
    --ls-tight:  -0.025em;
    --ls-normal:  0;
    --ls-wide:    0.05em;
    --ls-wider:   0.1em;
    --ls-widest:  0.15em;

    /* ── Spacing scale ────────────────────────────────────────── */
    --sp-1:   0.25rem;   /*  4px */
    --sp-2:   0.5rem;    /*  8px */
    --sp-3:   0.75rem;   /* 12px */
    --sp-4:   1rem;      /* 16px */
    --sp-5:   1.25rem;   /* 20px */
    --sp-6:   1.5rem;    /* 24px */
    --sp-8:   2rem;      /* 32px */
    --sp-10:  2.5rem;    /* 40px */
    --sp-12:  3rem;      /* 48px */
    --sp-16:  4rem;      /* 64px */
    --sp-20:  5rem;      /* 80px */
    --sp-24:  6rem;      /* 96px */

    /* ── Layout ───────────────────────────────────────────────── */
    --container-max:    1200px;
    --container-pad:    clamp(1rem, 4vw, 2rem);

    --header-height:    72px;
    --sidebar-width:    260px;

    /* ── Border radius ────────────────────────────────────────── */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-full: 9999px;

    /* ── Shadows ──────────────────────────────────────────────── */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:  0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl:  0 20px 50px rgba(0,0,0,0.15);
    --shadow-red: 0 4px 20px rgba(215,25,32,0.35);

    /* ── Transitions ──────────────────────────────────────────── */
    --transition-fast:   120ms ease;
    --transition-base:   200ms ease;
    --transition-slow:   350ms ease;

    /* ── Z-index scale ────────────────────────────────────────── */
    --z-base:    1;
    --z-dropdown:100;
    --z-sticky:  200;
    --z-overlay: 300;
    --z-modal:   400;
    --z-toast:   500;
}

/* ═══════════════════════════════════════════════════════════
   RESET — Modern CSS reset
   ═══════════════════════════════════════════════════════════ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--clr-black);
    background-color: var(--clr-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, video, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--clr-black);
}

p {
    color: var(--clr-grey);
    line-height: var(--lh-relaxed);
}

address {
    font-style: normal;
}

/* Remove animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   BASE TYPOGRAPHY
   ═══════════════════════════════════════════════════════════ */

h1 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h2 { font-size: clamp(var(--text-xl),  3vw, var(--text-3xl)); }
h3 { font-size: clamp(var(--text-lg),  2vw, var(--text-xl));  }
h4 { font-size: var(--text-lg);  }
h5 { font-size: var(--text-md);  }
h6 { font-size: var(--text-base);}

a:hover { color: var(--clr-red); }

strong { font-weight: var(--fw-semibold); color: var(--clr-black); }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--clr-grey-light);
    padding: 0.1em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--clr-black);
}

/* Prose content (privacy policy, about) */
.prose { max-width: 72ch; }
.prose h2 {
    font-size: var(--text-xl);
    margin-top: var(--sp-10);
    margin-bottom: var(--sp-4);
    color: var(--clr-black);
    padding-bottom: var(--sp-2);
    border-bottom: 2px solid var(--clr-silver-light);
}
.prose p  { margin-bottom: var(--sp-4); }
.prose ul { margin-bottom: var(--sp-4); padding-left: var(--sp-6); list-style: disc; }
.prose li { margin-bottom: var(--sp-2); color: var(--clr-grey); }
.prose a  { color: var(--clr-red); text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.section {
    padding-block: clamp(var(--sp-12), 6vw, var(--sp-20));
}

.section--grey {
    background-color: var(--clr-grey-light);
}

/* Section header pattern */
.section-header {
    text-align: center;
    max-width: 640px;
    margin-inline: auto;
    margin-bottom: clamp(var(--sp-10), 4vw, var(--sp-16));
}

.section-eyebrow {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--clr-red);
    margin-bottom: var(--sp-3);
}

.section-title {
    font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
    font-weight: var(--fw-bold);
    color: var(--clr-black);
    margin-bottom: var(--sp-4);
    letter-spacing: var(--ls-tight);
}

.section-sub {
    font-size: var(--text-md);
    color: var(--clr-grey);
    line-height: var(--lh-relaxed);
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Visible focus ring — consistent across all interactive elements */
:focus-visible {
    outline: 2px solid var(--clr-red);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--sp-4);
    background: var(--clr-red);
    color: var(--clr-white);
    padding: var(--sp-3) var(--sp-6);
    border-radius: var(--radius-md);
    font-weight: var(--fw-semibold);
    z-index: var(--z-toast);
    transition: top var(--transition-fast);
}
.skip-link:focus { top: var(--sp-4); }

/* ═══════════════════════════════════════════════════════════
   PAGE HERO (used on inner pages)
   ═══════════════════════════════════════════════════════════ */

.page-hero {
    background-color: var(--clr-black);
    padding-block: clamp(var(--sp-12), 5vw, var(--sp-16));
    text-align: center;
}

.page-hero__title {
    color: var(--clr-white);
    font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
    margin-bottom: var(--sp-3);
}

.page-hero__sub {
    color: var(--clr-silver);
    font-size: var(--text-md);
    max-width: 560px;
    margin-inline: auto;
}

.page-hero--claim .page-hero__sub {
    color: var(--clr-silver-light);
}

/* ═══════════════════════════════════════════════════════════
   ERROR PAGES (404, 500)
   ═══════════════════════════════════════════════════════════ */

.error-page__inner {
    text-align: center;
    max-width: 500px;
    margin-inline: auto;
    padding-block: var(--sp-16);
}

.error-page__code {
    font-size: 8rem;
    font-weight: var(--fw-black);
    color: var(--clr-silver-light);
    letter-spacing: var(--ls-tight);
    line-height: 1;
    margin-bottom: var(--sp-4);
}

.error-page__title {
    font-size: var(--text-2xl);
    margin-bottom: var(--sp-4);
}

.error-page__desc {
    margin-bottom: var(--sp-8);
}

.error-page__actions {
    display: flex;
    gap: var(--sp-4);
    justify-content: center;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════ */

.flash-messages {
    padding: var(--sp-4) 0 0;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-3);
    border-left: 4px solid transparent;
    font-size: var(--text-sm);
}

.flash--success {
    background: #ECFDF5;
    border-color: #059669;
    color: #065F46;
}
.flash--error {
    background: var(--clr-red-light);
    border-color: var(--clr-red);
    color: #7F1D1D;
}
.flash--warning {
    background: #FFFBEB;
    border-color: #D97706;
    color: #78350F;
}
.flash--info {
    background: #EFF6FF;
    border-color: #2563EB;
    color: #1E3A5F;
}

.flash__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}
.flash__icon svg { width: 100%; height: 100%; fill: currentColor; }
.flash__message { flex: 1; line-height: var(--lh-snug); color: inherit; }
.flash__close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    opacity: 0.6;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}
.flash__close svg { width: 100%; height: 100%; fill: currentColor; }
.flash__close:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   COOKIE BANNER
   ═══════════════════════════════════════════════════════════ */

.cookie-banner {
    position: fixed;
    bottom: var(--sp-4);
    left: var(--sp-4);
    right: var(--sp-4);
    max-width: 700px;
    margin-inline: auto;
    background: var(--clr-black);
    color: var(--clr-white);
    border-radius: var(--radius-lg);
    padding: var(--sp-5) var(--sp-6);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    display: none; /* Shown by JS if no consent cookie */
    border: 1px solid rgba(200,200,200,0.15);
}

.cookie-banner.is-visible { display: block; }

.cookie-banner__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    flex-wrap: wrap;
}

.cookie-banner__text { flex: 1; min-width: 200px; }
.cookie-banner__text strong { color: var(--clr-white); display: block; margin-bottom: var(--sp-1); }
.cookie-banner__text p { color: var(--clr-silver); font-size: var(--text-sm); margin: 0; }
.cookie-banner__text a { color: var(--clr-red); text-decoration: underline; }

.cookie-banner__actions { display: flex; gap: var(--sp-3); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   HONEYPOT — always hidden from real users
   ═══════════════════════════════════════════════════════════ */

.form__honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    tab-index: -1;
}
