/* =====================================================
   PROVA - BS7858 Security Vetting Platform
   Brand Stylesheet
   ===================================================== */

/* CSS Custom Properties (Variables) */
:root {
    /* Brand Colors */
    --color-primary: #1e293b;          /* Slate Navy - Headers, text */
    --color-primary-light: #334155;
    --color-primary-dark: #0f172a;
    
    --color-accent: #10b981;           /* Verification Green - CTAs, success */
    --color-accent-light: #34d399;
    --color-accent-dark: #059669;
    
    --color-secondary: #64748b;        /* Cool Gray - Secondary text */
    --color-secondary-light: #94a3b8;
    --color-secondary-dark: #475569;
    
    --color-background: #f8fafc;       /* Off-White - Page backgrounds */
    --color-surface: #ffffff;          /* White - Cards, forms */
    
    --color-warning: #f59e0b;          /* Amber - Warnings, pending */
    --color-warning-light: #fbbf24;
    --color-warning-bg: #fffbeb;
    
    --color-error: #e11d48;            /* Rose - Errors */
    --color-error-light: #fb7185;
    --color-error-bg: #fff1f2;
    
    --color-success: #10b981;          /* Same as accent */
    --color-success-bg: #ecfdf5;
    
    --color-info: #3b82f6;
    --color-info-bg: #eff6ff;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Spacing */
    --space-1: 0.25rem;    /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;       /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    --space-20: 5rem;      /* 80px */
    --space-24: 6rem;      /* 96px */
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-toast: 400;
    
    /* Container */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-primary);
    background-color: var(--color-background);
    min-height: 100vh;
}

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

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

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

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

/* =====================================================
   Typography
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-primary);
}

h1 {
    font-size: var(--font-size-4xl);
    letter-spacing: -0.025em;
}

h2 {
    font-size: var(--font-size-3xl);
    letter-spacing: -0.02em;
}

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);
}

.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.text-secondary { color: var(--color-secondary); }
.text-center { text-align: center; }

/* =====================================================
   Layout Components
   ===================================================== */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container--sm { max-width: var(--container-sm); }
.container--md { max-width: var(--container-md); }
.container--lg { max-width: var(--container-lg); }

/* =====================================================
   Navigation
   ===================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--color-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.nav__logo-icon {
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    list-style: none;
}

.nav__link {
    color: var(--color-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
}

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

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

/* Mobile Nav Toggle */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}

@media (max-width: 768px) {
    .nav__links {
        display: none;
    }
    
    .nav__toggle {
        display: block;
    }
    
    .nav__links--open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--color-surface);
        padding: var(--space-6);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        gap: var(--space-4);
    }
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button */
.btn--primary {
    background: var(--color-accent);
    color: white;
}

.btn--primary:hover:not(:disabled) {
    background: var(--color-accent-dark);
    color: white;
}

/* Secondary Button */
.btn--secondary {
    background: var(--color-primary);
    color: white;
}

.btn--secondary:hover:not(:disabled) {
    background: var(--color-primary-light);
    color: white;
}

/* Outline Button */
.btn--outline {
    background: transparent;
    border: 1px solid var(--color-secondary-light);
    color: var(--color-primary);
}

.btn--outline:hover:not(:disabled) {
    border-color: var(--color-primary);
    background: var(--color-background);
    color: var(--color-primary);
}

/* Ghost Button */
.btn--ghost {
    background: transparent;
    color: var(--color-secondary);
}

.btn--ghost:hover:not(:disabled) {
    background: var(--color-background);
    color: var(--color-primary);
}

/* Button Sizes */
.btn--sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
}

.btn--lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
}

.btn--full {
    width: 100%;
}

/* =====================================================
   Cards
   ===================================================== */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card__header {
    padding: var(--space-6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card__body {
    padding: var(--space-6);
}

.card__footer {
    padding: var(--space-6);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--color-background);
}

/* =====================================================
   Forms
   ===================================================== */
.form-group {
    margin-bottom: var(--space-5);
}

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

.form-label--required::after {
    content: '*';
    color: var(--color-error);
    margin-left: var(--space-1);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    color: var(--color-primary);
    background: var(--color-surface);
    border: 1px solid var(--color-secondary-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
    color: var(--color-secondary-light);
}

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

.form-input--error:focus {
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

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

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
    margin-top: var(--space-1);
}

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

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 20px;
    padding-right: var(--space-10);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-accent);
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
}

/* =====================================================
   Hero Section
   ===================================================== */
.hero {
    padding: var(--space-24) 0 var(--space-20);
    margin-top: 72px;
}

.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-success-bg);
    color: var(--color-accent-dark);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-6);
}

.hero__title {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--space-6);
    letter-spacing: -0.03em;
}

.hero__title-accent {
    color: var(--color-accent);
}

.hero__subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-secondary);
    margin-bottom: var(--space-8);
    max-width: 540px;
}

.hero__actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.hero__visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero__card {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8);
    max-width: 420px;
    position: relative;
}

.hero__card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
    z-index: -1;
}

@media (max-width: 1024px) {
    .hero__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero__subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero__actions {
        justify-content: center;
    }
    
    .hero__visual {
        order: -1;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: var(--space-16) 0 var(--space-12);
    }
    
    .hero__title {
        font-size: var(--font-size-3xl);
    }
    
    .hero__subtitle {
        font-size: var(--font-size-lg);
    }
}

/* =====================================================
   Features Section
   ===================================================== */
.features {
    padding: var(--space-20) 0;
    background: var(--color-surface);
}

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

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

.features__subtitle {
    color: var(--color-secondary);
    font-size: var(--font-size-lg);
}

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

.feature-card {
    padding: var(--space-8);
    background: var(--color-background);
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.feature-card__icon {
    width: 48px;
    height: 48px;
    background: var(--color-accent);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    color: white;
}

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

.feature-card__text {
    color: var(--color-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

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

@media (max-width: 640px) {
    .features__grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Pricing Section
   ===================================================== */
.pricing {
    padding: var(--space-20) 0;
}

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

.pricing__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
}

.pricing-card--featured {
    border-color: var(--color-accent);
    position: relative;
}

.pricing-card--featured::before {
    content: 'Most Popular';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-accent);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

.pricing-card__name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
}

.pricing-card__description {
    color: var(--color-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-6);
}

.pricing-card__price {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
}

.pricing-card__price-value {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
}

.pricing-card__price-period {
    color: var(--color-secondary);
    font-size: var(--font-size-sm);
}

.pricing-card__features {
    list-style: none;
    margin-bottom: var(--space-8);
}

.pricing-card__feature {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-3);
}

.pricing-card__feature-icon {
    color: var(--color-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .pricing__grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Process Section
   ===================================================== */
.process {
    padding: var(--space-20) 0;
    background: var(--color-surface);
}

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

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

.process-step {
    text-align: center;
    position: relative;
}

.process-step::after {
    content: '';
    position: absolute;
    top: 32px;
    left: calc(50% + 40px);
    width: calc(100% - 80px);
    height: 2px;
    background: var(--color-secondary-light);
}

.process-step:last-child::after {
    display: none;
}

.process-step__number {
    width: 64px;
    height: 64px;
    background: var(--color-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0 auto var(--space-5);
    position: relative;
    z-index: 1;
}

.process-step__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
}

.process-step__text {
    color: var(--color-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

@media (max-width: 1024px) {
    .process__steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .process-step::after {
        display: none;
    }
}

@media (max-width: 640px) {
    .process__steps {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   CTA Section
   ===================================================== */
.cta {
    padding: var(--space-20) 0;
}

.cta__inner {
    background: var(--color-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta__inner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(16, 185, 129, 0.2) 100%);
}

.cta__title {
    color: white;
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
}

.cta__subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-8);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.cta__actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* =====================================================
   Footer
   ===================================================== */
.footer {
    padding: var(--space-16) 0 var(--space-8);
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.8);
}

.footer__inner {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer__brand {
    max-width: 300px;
}

.footer__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: white;
    margin-bottom: var(--space-4);
}

.footer__tagline {
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

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

.footer__links {
    list-style: none;
}

.footer__link {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-3);
    transition: color var(--transition-fast);
}

.footer__link:hover {
    color: white;
}

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

.footer__copyright {
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

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

@media (max-width: 640px) {
    .footer__inner {
        grid-template-columns: 1fr;
    }
    
    .footer__brand {
        grid-column: span 1;
    }
    
    .footer__bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

/* =====================================================
   Badges & Tags
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
}

.badge--success {
    background: var(--color-success-bg);
    color: var(--color-accent-dark);
}

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

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

.badge--info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

/* =====================================================
   Status Indicators
   ===================================================== */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status--pending .status__dot {
    background: var(--color-warning);
}

.status--active .status__dot {
    background: var(--color-accent);
    animation: pulse 2s infinite;
}

.status--complete .status__dot {
    background: var(--color-accent);
}

.status--error .status__dot {
    background: var(--color-error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =====================================================
   Progress Bar
   ===================================================== */
.progress {
    height: 8px;
    background: var(--color-background);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* =====================================================
   Tables
   ===================================================== */
.table-wrapper {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table th {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-secondary);
    background: var(--color-background);
}

.table tbody tr:hover {
    background: var(--color-background);
}

/* =====================================================
   Modals
   ===================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal--open {
    opacity: 1;
    visibility: visible;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal__content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal--open .modal__content {
    transform: scale(1);
}

.modal__header {
    padding: var(--space-6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: var(--font-size-lg);
    margin: 0;
}

.modal__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    color: var(--color-secondary);
    transition: color var(--transition-fast);
}

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

.modal__body {
    padding: var(--space-6);
}

.modal__footer {
    padding: var(--space-6);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: var(--space-4);
    justify-content: flex-end;
}

/* =====================================================
   Toast Notifications
   ===================================================== */
.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast--success { border-left: 4px solid var(--color-success); }
.toast--error { border-left: 4px solid var(--color-error); }
.toast--warning { border-left: 4px solid var(--color-warning); }
.toast--info { border-left: 4px solid var(--color-info); }

.toast__icon {
    flex-shrink: 0;
}

.toast__content {
    flex: 1;
}

.toast__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-1);
}

.toast__message {
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
    margin: 0;
}

/* =====================================================
   Dashboard Specific Styles
   ===================================================== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.dashboard__sidebar {
    width: 260px;
    background: var(--color-primary-dark);
    color: white;
    padding: var(--space-6);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.dashboard__main {
    flex: 1;
    margin-left: 260px;
    padding: var(--space-8);
}

.dashboard__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
}

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

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
    margin-bottom: var(--space-2);
}

.stat-card__value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
}

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

/* =====================================================
   Application Form Specific Styles
   ===================================================== */
.form-wizard {
    max-width: 720px;
    margin: 0 auto;
}

.form-wizard__progress {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
}

.form-wizard__step {
    flex: 1;
    height: 4px;
    background: var(--color-secondary-light);
    border-radius: var(--radius-full);
    transition: background var(--transition-normal);
}

.form-wizard__step--complete {
    background: var(--color-accent);
}

.form-wizard__step--active {
    background: var(--color-accent);
}

.form-section {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-section__title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
}

.form-section__subtitle {
    color: var(--color-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-6);
}

/* Timeline (for employment/address history) */
.timeline {
    position: relative;
    padding-left: var(--space-8);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-secondary-light);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-8) + 6px);
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 2px solid var(--color-surface);
}

.timeline-item--incomplete::before {
    background: var(--color-warning);
}

.timeline-card {
    background: var(--color-background);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.timeline-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
}

.timeline-card__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

.timeline-card__dates {
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
}

/* Signature Pad */
.signature-pad {
    border: 2px dashed var(--color-secondary-light);
    border-radius: var(--radius-lg);
    background: var(--color-background);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
}

.signature-pad canvas {
    border-radius: var(--radius-lg);
}

.signature-pad__actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--color-secondary-light);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--color-accent);
    background: rgba(16, 185, 129, 0.05);
}

.file-upload__icon {
    color: var(--color-secondary);
    margin-bottom: var(--space-3);
}

.file-upload__text {
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
    margin-bottom: 0;
}

.file-upload__text strong {
    color: var(--color-accent);
}

/* =====================================================
   Stats Grid (Dashboard)
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
    margin-bottom: var(--space-2);
}

.stat-card__value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-dark);
}

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

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Utilities
   ===================================================== */
/* =====================================================
   Modal
   ===================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal.active {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal__content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

.modal__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    color: var(--color-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal__close:hover {
    background: var(--color-background);
    color: var(--color-primary);
}

.modal__body {
    padding: var(--space-6);
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--color-background);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Spinner */
.spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden { display: none !important; }
.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;
}

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

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

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

/* =====================================================
   Modal Overlay (Alternative modal style)
   ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay .modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-overlay .modal__header {
    margin-bottom: 16px;
    padding: 0;
    border-bottom: none;
}

.modal-overlay .modal__title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.modal-overlay .modal__desc {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
}

.modal-overlay .modal__body {
    margin-bottom: 24px;
    padding: 0;
}

.modal-overlay .modal__footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 0;
    border-top: none;
    background: transparent;
}

/* =====================================================
   Toggle Switch
   ===================================================== */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s ease;
    border-radius: 24px;
}

.toggle__slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle__slider {
    background-color: #10b981;
}

.toggle input:checked + .toggle__slider:before {
    transform: translateX(20px);
}

.toggle input:focus + .toggle__slider {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.toggle input:disabled + .toggle__slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =====================================================
   Gray Color Variables (for settings page compatibility)
   ===================================================== */
:root {
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --primary: #10b981;
}
