/* WeFarmSA design system — ported from React wefarmsa (Tailwind/shadcn tokens) */

:root {
    --wf-primary: #00A651;
    --wf-primary-hover: #008a45;
    --wf-emerald: #059669;
    --wf-emerald-700: #047857;
    --wf-teal: #14b8a6;
    --wf-teal-400: #2dd4bf;

    --wf-bg: #F6F8FB;
    --wf-surface: #ffffff;
    --wf-foreground: #0F172A;
    --wf-muted: #64748b;
    --wf-muted-light: #94a3b8;
    --wf-border: #e2e8f0;
    --wf-border-light: #f1f5f9;

    --wf-space-1: 4px;
    --wf-space-2: 8px;
    --wf-space-3: 12px;
    --wf-space-4: 16px;
    --wf-space-5: 20px;
    --wf-space-6: 24px;
    --wf-space-8: 32px;
    --wf-space-10: 40px;

    --wf-footer-bg: #1e293b;
    --wf-footer-text: #cbd5e1;
    --wf-footer-muted: #94a3b8;

    --wf-gallery-navy: hsl(231, 79%, 12%);
    --wf-gallery-cyan: hsl(187, 67%, 61%);

    --wf-radius: 0.75rem;
    --wf-radius-lg: 1rem;
    --wf-radius-pill: 9999px;

    --wf-font-heading: 'Poppins', 'Inter', system-ui, sans-serif;
    --wf-font-body: 'Inter', system-ui, sans-serif;

    --wf-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --wf-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
}

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

html {
    min-width: 280px;
    background: var(--wf-bg);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--wf-font-body);
    font-size: clamp(13px, 3.5vw, 15px);
    line-height: 1.55;
    background: var(--wf-bg);
    color: var(--wf-foreground);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1 { font-size: clamp(1.35rem, 5vw, 2rem); font-weight: 700; line-height: 1.2; font-family: var(--wf-font-heading); }
h2 { font-size: clamp(1.15rem, 4vw, 1.6rem); font-weight: 700; line-height: 1.25; font-family: var(--wf-font-heading); }
h3 { font-size: clamp(1rem, 3.5vw, 1.25rem); font-weight: 600; line-height: 1.3; }

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

/* Icons must keep their intrinsic size — never stretch to their container */
svg:not([width]) { width: 1em; height: 1em; }
.lucide-icon { flex-shrink: 0; }
.lucide-icon svg { display: block; flex-shrink: 0; }

/* App shell — matches React Layout.jsx */
.wefarm-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--wf-bg);
}

.wf-main {
    flex: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.landing-layout {
    min-height: 100vh;
    background: #fff;
    color: var(--wf-foreground);
}

.page-container {
    padding: clamp(0.75rem, 4vw, 2rem);
    max-width: 80rem;
    margin: 0 auto;
}

/* Buttons */
.wf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: var(--wf-radius-pill);
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.wf-btn-primary {
    background: var(--wf-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 166, 81, 0.25);
}
.wf-btn-primary:hover { background: var(--wf-primary-hover); }

.wf-btn-outline {
    background: transparent;
    color: var(--wf-foreground);
    border: 1px solid var(--wf-border);
}
.wf-btn-outline:hover { background: var(--wf-border-light); }

.wf-btn-ghost-white {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.wf-btn-ghost-white:hover { background: rgba(255, 255, 255, 0.1); }

/* Cards */
.wf-card {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border-light);
    border-radius: var(--wf-radius-lg);
    box-shadow: var(--wf-shadow-sm);
    overflow: hidden;
}

.wf-card-body { padding: 1rem 1.25rem; }

/* Form controls */
.wf-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.wf-input, .wf-select, .wf-textarea {
    width: 100%;
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 0.6rem 0.8rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    color: var(--wf-foreground);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wf-input:focus, .wf-select:focus, .wf-textarea:focus {
    border-color: var(--wf-emerald);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.wf-textarea { min-height: 5rem; resize: vertical; }

.wf-req { color: #dc2626; }

.wf-error {
    color: #dc2626;
    font-size: 0.82rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

/* Chips / badges */
.wf-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: var(--wf-radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--wf-border);
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.wf-chip.active, .wf-chip:hover.active {
    background: var(--wf-emerald);
    color: #fff;
    border-color: var(--wf-emerald);
}

.wf-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--wf-radius-pill);
}

/* Hero sections */
.wf-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--wf-radius-lg);
    background: linear-gradient(135deg, #065f46, #064e3b);
    color: #fff;
    padding: 2.5rem 2rem;
    margin-bottom: 1.5rem;
}

.wf-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--wf-radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.wf-hero h1 { color: #fff; margin: 0; }
.wf-hero p { color: rgba(255, 255, 255, 0.85); margin: 0.5rem 0 0; max-width: 42rem; }

/* Page hero with image bg */
.wf-hero-img {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    border-radius: 0;
    margin-bottom: 0;
}

.wf-hero-img .wf-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3), transparent);
}

.wf-hero-img .wf-hero-content {
    position: relative;
    z-index: 1;
    max-width: 80rem;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    width: 100%;
}

/* Loading / empty states */
.wf-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 1rem;
    color: var(--wf-muted);
}

.wf-empty {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border-light);
    border-radius: var(--wf-radius-lg);
    color: var(--wf-muted);
}

/* Grid helpers */
.wf-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1.25rem; }
.wf-grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .wf-grid-2 { grid-template-columns: repeat(2, 1fr); } }
.wf-grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) { .wf-grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Stat cards */
.wf-stat {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border-light);
    border-radius: var(--wf-radius);
    padding: 1rem;
    text-align: center;
}
.wf-stat strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--wf-foreground); }
.wf-stat span { font-size: 0.75rem; color: var(--wf-muted); }

/* Tables */
.wf-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--wf-surface);
    border: 1px solid var(--wf-border-light);
    border-radius: var(--wf-radius);
    overflow: hidden;
    font-size: 0.875rem;
}

.wf-table th, .wf-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--wf-border-light);
}

.wf-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wf-table tbody tr:hover { background: #f8fafc; cursor: pointer; }
.wf-table tbody tr:last-child td { border-bottom: none; }

.wf-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wf-tab {
    padding: 0.5rem 1rem;
    border-radius: var(--wf-radius-pill);
    border: 1px solid var(--wf-border);
    background: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}
.wf-tab.active { background: var(--wf-emerald); color: #fff; border-color: var(--wf-emerald); }

.wf-skip-link {
    position: absolute;
    left: 8px;
    top: -40px;
    z-index: 10000;
    padding: 8px 12px;
    background: var(--wf-primary);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
}
.wf-skip-link:focus {
    top: 8px;
}

/* Tables responsive */
@media (max-width: 480px) {
    .wf-table-responsive thead { display: none; }
    .wf-table-responsive tr { display: block; border: 1px solid var(--wf-border); border-radius: 10px; margin-bottom: 0.75rem; padding: 0.5rem; }
    .wf-table-responsive td { display: flex; justify-content: space-between; padding: 0.25rem 0.5rem; font-size: 0.8rem; }
}
