/* ============================================================
   PrimeDime — app.css
   Brand: Navy #0A1F44 | Cyan #00AEEF | Steel #4A4A4A | Pale Slate #EAF2F7
   Typography: DM Sans (self-hosted, POPIA compliant — no Google Fonts)
   Grid: 8pt base, 12-column
   ============================================================ */

/* ---- Font Face — DM Sans (self-hosted, POPIA compliant)
   DM Sans v17 is a variable font — single file serves all weights 100-900.
   Downloaded from Google Fonts offline and bundled in wwwroot/fonts/.
   No external font requests are made. ---------------------------------- */
@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-Regular.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---- CSS Custom Properties ------------------------------- */
:root {
    /* Brand Colours */
    --color-navy:       #0A1F44;
    --color-cyan:       #00AEEF;
    --color-steel:      #4A4A4A;
    --color-pale-slate: #EAF2F7;

    /* Typography */
    --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;

    /* Spacing (8pt grid) */
    --space-1:  8px;
    --space-2:  16px;
    --space-3:  24px;
    --space-4:  32px;
    --space-5:  40px;
    --space-6:  48px;
    --space-8:  64px;
    --space-10: 80px;
    --space-12: 96px;

    /* Container */
    --container-max: 1200px;
    --container-padding: 24px;

    /* Radius */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;

    /* Shadows */
    --shadow-sm:  0 2px 8px rgba(10, 31, 68, 0.07);
    --shadow-md:  0 4px 20px rgba(10, 31, 68, 0.10);
    --shadow-lg:  0 8px 40px rgba(10, 31, 68, 0.15);

    /* Transitions */
    --transition: 0.15s ease;
}

/* ---- Reset & Base ---------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-steel);
    background-color: var(--color-pale-slate);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-navy);
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--color-cyan); }
a:hover { opacity: 0.85; }

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

ul, ol { list-style: none; padding: 0; margin: 0; }

/* ---- Container ------------------------------------------- */
.container {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    width: 100%;
}

/* ---- Buttons --------------------------------------------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--color-cyan);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    position: relative;
}

.btn-primary:hover {
    background: #009fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 174, 239, 0.35);
    color: #fff;
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled,
.btn-primary--loading {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary--large {
    padding: 16px 40px;
    font-size: 1rem;
}

.btn-primary__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: transparent;
    color: var(--color-navy);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 700;
    border: 2px solid var(--color-navy);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.btn-outline:hover {
    background: var(--color-navy);
    color: #fff;
    opacity: 1;
}

.btn-outline--light {
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.35);
}

.btn-outline--light:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}

/* ---- Animations ------------------------------------------ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Loading Screen -------------------------------------- */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-navy);
    gap: 2rem;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 174, 239, 0.25);
    border-top-color: var(--color-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ---- Blazor Error UI ------------------------------------- */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 8px rgba(0,0,0,.15);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    right: 0;
    z-index: 9999;
    font-family: var(--font-sans);
    font-size: 0.875rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    font-size: 1rem;
}

/* ---- 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;
}

/* ---- Not Found ------------------------------------------- */
.not-found {
    text-align: center;
    padding: 8rem 2rem;
}

.not-found h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.not-found p {
    margin-bottom: 2rem;
    color: var(--color-steel);
}

/* ---- Section utilities ----------------------------------- */
.section-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Icon utility ---------------------------------------- */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ---- Responsive breakpoints ----------------------------- */
@media (max-width: 1200px) {
    :root { --container-padding: 20px; }
}

@media (max-width: 768px) {
    :root { --container-padding: 16px; }
}

@media (max-width: 480px) {
    :root { --container-padding: 12px; }
    .btn-outline--light { display: none; }
}
