/**
 * FireClarity - Main Stylesheet
 * Part of the Clarity Suite (Red Theme)
 */

/* ================================================================== */
/*  CSS Custom Properties                                              */
/* ================================================================== */

:root {
    /* Brand Colours */
    --primary: #D32F2F;
    --primary-dark: #B71C1C;
    --primary-light: #EF5350;
    --primary-50: #FFEBEE;
    --primary-100: #FFCDD2;

    /* Status Colours */
    --green: #2E7D32;
    --green-bg: #E8F5E9;
    --amber: #F57F17;
    --amber-bg: #FFF8E1;
    --red: #D32F2F;
    --red-bg: #FFEBEE;
    --grey: #78909C;
    --grey-bg: #ECEFF1;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

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

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --container-max: 1200px;
    --header-height: 64px;
}

/* Light Theme (default) */
[data-theme="light"] {
    --bg: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #EEEEEE;
    --surface: #FFFFFF;
    --surface-hover: #FAFAFA;
    --text: #212121;
    --text-secondary: #616161;
    --text-muted: #9E9E9E;
    --text-inverse: #FFFFFF;
    --border: #E0E0E0;
    --border-light: #F0F0F0;
    --input-bg: #FFFFFF;
    --input-border: #BDBDBD;
    --input-focus-border: var(--primary);
    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #263238;
    --footer-text: #B0BEC5;
    --footer-heading: #ECEFF1;
    --footer-link: #B0BEC5;
    --footer-link-hover: #FFFFFF;
    --code-bg: #F5F5F5;
    --overlay: rgba(0, 0, 0, 0.5);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #121212;
    --bg-secondary: #1E1E1E;
    --bg-tertiary: #2C2C2C;
    --surface: #1E1E1E;
    --surface-hover: #2C2C2C;
    --text: #E0E0E0;
    --text-secondary: #BDBDBD;
    --text-muted: #757575;
    --text-inverse: #121212;
    --border: #333333;
    --border-light: #2C2C2C;
    --input-bg: #2C2C2C;
    --input-border: #444444;
    --input-focus-border: var(--primary-light);
    --header-bg: rgba(18, 18, 18, 0.95);
    --footer-bg: #0D0D0D;
    --footer-text: #9E9E9E;
    --footer-heading: #E0E0E0;
    --footer-link: #9E9E9E;
    --footer-link-hover: #FFFFFF;
    --code-bg: #2C2C2C;
    --overlay: rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3), 0 4px 6px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.35), 0 10px 10px rgba(0, 0, 0, 0.2);
}

/* ================================================================== */
/*  Reset / Normalise                                                  */
/* ================================================================== */

*,
*::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-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.nav-open {
    overflow: hidden;
}

body.modal-active {
    overflow: hidden;
}

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

ul,
ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* ================================================================== */
/*  Typography                                                         */
/* ================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

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

p {
    margin-bottom: var(--space-4);
}

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

small {
    font-size: var(--font-size-sm);
}

strong {
    font-weight: 600;
}

/* ================================================================== */
/*  Layout                                                             */
/* ================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

main {
    flex: 1;
}

/* ================================================================== */
/*  Grid System                                                        */
/* ================================================================== */

.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: var(--space-8);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ================================================================== */
/*  Header / Navigation                                                */
/* ================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    height: var(--header-height);
    transition: box-shadow var(--transition);
}

.site-header.header-scrolled {
    box-shadow: var(--shadow-md);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.nav-logo-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-link {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-2) 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Hamburger Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 4px;
    z-index: 110;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: var(--radius-full);
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        background: var(--surface);
        flex-direction: column;
        align-items: flex-start;
        padding: calc(var(--header-height) + var(--space-8)) var(--space-6) var(--space-6);
        gap: var(--space-8);
        transform: translateX(100%);
        transition: transform var(--transition-slow);
        box-shadow: var(--shadow-xl);
        z-index: 105;
    }

    .nav-menu.open {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
        width: 100%;
    }

    .nav-link {
        font-size: var(--font-size-lg);
        padding: var(--space-2) 0;
    }

    .nav-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: var(--space-4);
    }
}

/* ================================================================== */
/*  Theme Toggle                                                       */
/* ================================================================== */

.theme-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    padding: 2px;
    gap: 2px;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.theme-toggle-btn:hover {
    color: var(--text);
}

.theme-toggle-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ================================================================== */
/*  Buttons                                                            */
/* ================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-weight: 500;
    font-size: var(--font-size-sm);
    line-height: 1;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #FFFFFF;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary-50);
    color: var(--primary-dark);
}

.btn-secondary-light {
    background: transparent;
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #FFFFFF;
    color: #FFFFFF;
}

.btn-danger {
    background: var(--red);
    color: #FFFFFF;
    border-color: var(--red);
}

.btn-danger:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #FFFFFF;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.btn-sm {
    font-size: var(--font-size-xs);
    padding: 7px 14px;
}

.btn-lg {
    font-size: var(--font-size-base);
    padding: 14px 28px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ================================================================== */
/*  Forms                                                              */
/* ================================================================== */

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

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-error {
    border-color: var(--red);
}

.form-input-error:focus {
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2);
}

.form-input-success {
    border-color: var(--green);
}

.form-error {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--red);
    margin-top: var(--space-1);
}

.form-help {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23616161' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 01.708 0L8 8.293l2.646-2.647a.5.5 0 01.708.708l-3 3a.5.5 0 01-.708 0l-3-3a.5.5 0 010-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Password visibility wrapper */
.input-password-wrapper {
    position: relative;
}

.input-password-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text);
}

/* ================================================================== */
/*  Cards                                                              */
/* ================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ================================================================== */
/*  Hero Section                                                       */
/* ================================================================== */

.hero {
    padding: var(--space-24) 0 var(--space-20);
    text-align: center;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--bg) 60%);
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, rgba(183, 28, 28, 0.15) 0%, var(--bg) 60%);
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    color: var(--text);
    line-height: 1.15;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-10);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .hero {
        padding: var(--space-16) 0 var(--space-12);
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }
}

/* ================================================================== */
/*  Stats Bar                                                          */
/* ================================================================== */

.stats-bar {
    background: var(--bg-tertiary);
    padding: var(--space-10) 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .stats-bar {
    background: var(--bg-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
}

.stat-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.stat-icon {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.stat-text {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text);
}

.stat-desc {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

/* ================================================================== */
/*  Features Section                                                   */
/* ================================================================== */

.features {
    padding: var(--space-24) 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-16);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
}

.feature-card {
    text-align: left;
}

.feature-card:hover {
    border-color: var(--primary-100);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

[data-theme="dark"] .feature-icon {
    background: rgba(211, 47, 47, 0.15);
}

.feature-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.feature-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .features {
        padding: var(--space-16) 0;
    }

    .section-header {
        margin-bottom: var(--space-10);
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }
}

/* ================================================================== */
/*  Pricing Section                                                    */
/* ================================================================== */

.pricing {
    padding: var(--space-24) 0;
    background: var(--bg-secondary);
}

[data-theme="dark"] .pricing {
    background: var(--bg-secondary);
}

.pricing-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    border-color: var(--primary-light);
}

.pricing-card-featured {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.pricing-card-featured:hover {
    border-color: var(--primary);
}

.pricing-badge {
    position: absolute;
    top: 16px;
    right: -32px;
    background: var(--primary);
    color: #FFFFFF;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 4px 40px;
    transform: rotate(45deg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-header {
    text-align: center;
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-6);
}

.pricing-tier {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    margin-bottom: var(--space-2);
}

.pricing-currency {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text);
}

.pricing-amount {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.pricing-period {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.pricing-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.pricing-features {
    flex: 1;
    margin-bottom: var(--space-8);
}

.pricing-features li {
    padding: var(--space-2) 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    padding-left: var(--space-6);
    position: relative;
}

.pricing-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232E7D32' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 010 .708l-7 7a.5.5 0 01-.708 0l-3.5-3.5a.5.5 0 11.708-.708L6.5 10.293l6.646-6.647a.5.5 0 01.708 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* ================================================================== */
/*  CTA Section                                                        */
/* ================================================================== */

.cta-section {
    padding: var(--space-20) 0;
    background: var(--primary);
    color: #FFFFFF;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: var(--space-4);
}

.cta-text {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--space-8);
}

.cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.cta-section .btn-primary {
    background: #FFFFFF;
    color: var(--primary);
    border-color: #FFFFFF;
}

.cta-section .btn-primary:hover {
    background: var(--primary-50);
    border-color: var(--primary-50);
    color: var(--primary-dark);
}

/* ================================================================== */
/*  Auth Section                                                       */
/* ================================================================== */

.auth-section {
    padding: var(--space-16) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 200px);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.auth-card {
    padding: var(--space-10);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.auth-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.auth-form .form-group:last-of-type {
    margin-bottom: var(--space-6);
}

.auth-links {
    text-align: center;
    margin-top: var(--space-5);
}

.auth-link {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.auth-link:hover {
    color: var(--primary);
}

/* ================================================================== */
/*  Error Page                                                         */
/* ================================================================== */

.error-section {
    padding: var(--space-24) 0;
    text-align: center;
    min-height: calc(100vh - var(--header-height) - 200px);
    display: flex;
    align-items: center;
}

.error-content {
    max-width: 480px;
    margin: 0 auto;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: var(--space-4);
}

.error-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-4);
}

.error-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

/* ================================================================== */
/*  Status Colours                                                     */
/* ================================================================== */

.status-green {
    color: var(--green);
    background: var(--green-bg);
}

.status-amber {
    color: var(--amber);
    background: var(--amber-bg);
}

.status-red {
    color: var(--red);
    background: var(--red-bg);
}

.status-grey {
    color: var(--grey);
    background: var(--grey-bg);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ================================================================== */
/*  Flash / Toast Messages                                             */
/* ================================================================== */

.flash-message {
    padding: var(--space-3) 0;
    font-size: var(--font-size-sm);
    transition: opacity var(--transition), max-height var(--transition);
    overflow: hidden;
}

.flash-message .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.flash-message.flash-dismissing {
    opacity: 0;
    max-height: 0;
    padding: 0;
}

.flash-success {
    background: var(--green-bg);
    color: var(--green);
}

.flash-error {
    background: var(--red-bg);
    color: var(--red);
}

.flash-warning {
    background: var(--amber-bg);
    color: var(--amber);
}

.flash-info {
    background: #E3F2FD;
    color: #1565C0;
}

[data-theme="dark"] .flash-info {
    background: rgba(21, 101, 192, 0.15);
}

.flash-close {
    font-size: var(--font-size-xl);
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

.flash-close:hover {
    opacity: 1;
}

/* Toast container */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-4));
    right: var(--space-4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    pointer-events: auto;
    transform: translateX(110%);
    opacity: 0;
    transition: transform var(--transition-slow), opacity var(--transition-slow);
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-exiting {
    transform: translateX(110%);
    opacity: 0;
}

.toast-text {
    flex: 1;
}

.toast-close {
    font-size: var(--font-size-lg);
    line-height: 1;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--amber); }
.toast-info    { border-left: 3px solid #1565C0; }

/* ================================================================== */
/*  Modal                                                              */
/* ================================================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.modal.modal-open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-sm .modal-content,
.modal-content.modal-sm {
    max-width: 400px;
}

.modal-lg .modal-content,
.modal-content.modal-lg {
    max-width: 720px;
}

.modal-header {
    padding: var(--space-6) var(--space-6) var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.modal-body {
    padding: 0 var(--space-6) var(--space-6);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.7;
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ================================================================== */
/*  Footer                                                             */
/* ================================================================== */

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-12);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: #FFFFFF;
    text-decoration: none;
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.footer-tagline {
    font-size: var(--font-size-sm);
    color: var(--footer-text);
    line-height: 1.7;
    max-width: 280px;
}

.footer-heading {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--footer-heading);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links li {
    margin-bottom: var(--space-2);
}

.footer-links a {
    font-size: var(--font-size-sm);
    color: var(--footer-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--footer-link-hover);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-bottom p {
    font-size: var(--font-size-sm);
    color: var(--footer-text);
    margin: 0;
}

.footer-company {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .footer-grid .footer-col:first-child {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ================================================================== */
/*  Utility Classes                                                    */
/* ================================================================== */

/* Text alignment */
.text-left   { text-align: left; }
.text-centre { text-align: center; }
.text-right  { text-align: right; }

/* Text colour */
.text-primary   { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }

/* Font weight */
.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }

/* Spacing */
.mt-0  { margin-top: 0; }
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.pt-0  { padding-top: 0; }
.pt-4  { padding-top: var(--space-4); }
.pt-8  { padding-top: var(--space-8); }
.pb-0  { padding-bottom: 0; }
.pb-4  { padding-bottom: var(--space-4); }
.pb-8  { padding-bottom: var(--space-8); }

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

.hidden { display: none; }

@media (max-width: 768px) {
    .hide-mobile { display: none; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none; }
}

/* Flex utilities */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-centre { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-centre { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Width */
.w-full { width: 100%; }
