/* ================================================================
   AgriGuard AI — Global Stylesheet
   Design language: clean, modern, agriculture-inspired green
   ================================================================ */

/* ── Fonts ────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@700;800&display=swap');

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
    --primary:        #2d6a4f;
    --primary-dark:   #1b4332;
    --primary-light:  #40916c;
    --primary-xlight: #74c69d;
    --accent:         #52b788;
    --accent-soft:    rgba(82,183,136,0.12);
    --surface:        #ffffff;
    --surface-2:      #f6faf8;
    --surface-3:      #edf4f0;
    --border:         rgba(45,106,79,0.12);
    --text-main:      #1a2e24;
    --text-sub:       #4a6355;
    --text-muted:     #7a9486;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:      0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
    --radius-sm:      8px;
    --radius-md:      14px;
    --radius-lg:      20px;
    --radius-xl:      28px;
    --transition:     0.22s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: var(--text-main);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
}

/* ── Bootstrap overrides ──────────────────────────────────────── */
.bg-primary, .btn-primary, .badge.bg-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-primary {
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 2px 8px rgba(45,106,79,0.25);
    transition: all var(--transition);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    box-shadow: 0 4px 16px rgba(45,106,79,0.35);
    transform: translateY(-1px);
}
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    font-weight: 600;
    border-radius: var(--radius-sm) !important;
    transition: all var(--transition);
}
.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(45,106,79,0.3);
    transform: translateY(-1px);
}
.btn-light {
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
    transition: all var(--transition);
}
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-success {
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
    transition: all var(--transition);
}
.btn-success:hover { transform: translateY(-1px); }
.text-primary { color: var(--primary) !important; }
.bg-light { background-color: var(--surface-2) !important; }

.card {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
}
.form-control, .form-select {
    border-radius: var(--radius-sm) !important;
    border-color: var(--border) !important;
    font-size: 0.95rem;
    padding: 0.6rem 0.9rem;
    transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(82,183,136,0.18) !important;
}
.input-group-text {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
    background: var(--surface-3);
    border-color: var(--border) !important;
    color: var(--primary);
}
.badge { font-weight: 600; letter-spacing: 0.02em; }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
    background: var(--primary-dark) !important;
    padding: 0.75rem 0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    transition: background var(--transition), box-shadow var(--transition);
}
.navbar.navbar-scrolled {
    background: rgba(27,67,50,0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.navbar-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f4a01c !important;
}
.navbar-brand:hover { color: #ffb83a !important; }
.navbar-brand .brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    color: #52b788;
    background: none;
    box-shadow: none;
    border-radius: 0;
    width: auto;
    height: auto;
}
.navbar .nav-link {
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.4rem 0.75rem !important;
    border-radius: 6px;
    transition: all var(--transition);
    color: rgba(255,255,255,0.85) !important;
}
.navbar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,0.1); }
.navbar .nav-link.active { color: #fff !important; background: rgba(255,255,255,0.15); }
.navbar-toggler {
    border: none !important;
    padding: 4px 8px;
}
.navbar-toggler:focus { box-shadow: none !important; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
.nav-cart-badge {
    font-size: 0.6rem !important;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Flash Messages ───────────────────────────────────────────── */
.flash-message {
    border-radius: var(--radius-sm) !important;
    animation: fadeSlideDown 0.3s ease;
    border: none !important;
    font-weight: 500;
}
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero Section ─────────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    min-height: 92vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(82,183,136,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 10% 80%, rgba(27,67,50,0.5) 0%, transparent 70%);
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--surface), transparent);
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.95);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: 1.5rem;
}
.hero-badge .dot {
    width: 7px;
    height: 7px;
    background: var(--primary-xlight);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

/* ── Stats Strip ──────────────────────────────────────────────── */
.stats-strip {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}
.stat-item {
    text-align: center;
    padding: 0.5rem 1rem;
}
.stat-number {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    display: block;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
    display: block;
}
.stat-divider {
    width: 1px;
    background: var(--border);
    height: 40px;
    margin: auto;
}

/* ── Steps / How It Works ─────────────────────────────────────── */
.step-card {
    position: relative;
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition);
}
.step-card:hover {
    box-shadow: var(--shadow-lg) !important;
    transform: translateY(-6px);
    border-color: var(--accent) !important;
}
.step-number {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(45,106,79,0.35);
}
.step-icon-wrap {
    width: 72px;
    height: 72px;
    background: var(--accent-soft);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
    transition: all var(--transition);
}
.step-card:hover .step-icon-wrap {
    background: var(--primary);
    color: #fff;
    transform: scale(1.08);
}

/* ── Feature Card ─────────────────────────────────────────────── */
.feature-card {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition);
    background: var(--surface);
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
    border-color: rgba(82,183,136,0.3) !important;
}
.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--accent-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all var(--transition);
}
.feature-card:hover .feature-icon {
    background: var(--primary);
    color: #fff;
}

/* ── Pricing Card ─────────────────────────────────────────────── */
.pricing-card {
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition);
    overflow: hidden;
}
.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg) !important;
}
.popular-plan {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 8px 32px rgba(45,106,79,0.18) !important;
}
.pricing-amount .display-5 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    color: var(--primary-dark);
}

/* ── Product Card ─────────────────────────────────────────────── */
.product-card {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition);
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg) !important;
}

/* ── Auth Pages ───────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex;
    align-items: stretch;
}
.auth-panel-left {
    background: transparent;
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-panel-right {
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    min-height: 100vh;
}
.auth-card {
    width: 100%;
    max-width: 420px;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
}
.auth-brand-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.auth-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.85);
}
.auth-benefit-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--primary-xlight);
}
.auth-form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}
.auth-form-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}
.auth-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

/* ── Confidence Bars ──────────────────────────────────────────── */
.confidence-bar {
    background: var(--surface-3);
    border-radius: 10px;
    height: 22px;
    overflow: hidden;
}
.confidence-fill {
    height: 100%;
    border-radius: 10px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    transition: width 0.5s ease, background 0.3s ease;
}
.confidence-fill.conf-high  { background: linear-gradient(90deg, #28a745, #20c040); }
.confidence-fill.conf-mid   { background: linear-gradient(90deg, #e6a817, #ffc107); }
.confidence-fill.conf-low   { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.confidence-bar-lg {
    background: var(--surface-3);
    border-radius: 12px;
    height: 30px;
    overflow: hidden;
}
.confidence-fill-lg {
    height: 100%;
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    transition: width 0.8s ease, background 0.3s ease;
}
.confidence-fill-lg.conf-high  { background: linear-gradient(90deg, #28a745, #20c040); }
.confidence-fill-lg.conf-mid   { background: linear-gradient(90deg, #e6a817, #ffc107); }
.confidence-fill-lg.conf-low   { background: linear-gradient(90deg, #c0392b, #e74c3c); }

/* ── E-commerce ───────────────────────────────────────────────── */
.cart-card { border-top: 3px solid var(--primary) !important; }
.cart-card-header {
    background: linear-gradient(135deg, var(--surface-3), #d4eddf) !important;
    border-bottom: 1px solid var(--border) !important;
}
.cart-card-header h5 { color: var(--primary-dark); }
.btn-cart {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: #fff !important; border: none !important; font-weight: 600;
    border-radius: var(--radius-sm) !important;
}
.btn-cart:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important; }
.btn-cart-outline {
    color: var(--primary) !important; border-color: var(--primary) !important;
    background: transparent !important; border-radius: var(--radius-sm) !important;
}
.btn-cart-outline:hover { background: var(--primary) !important; color: #fff !important; }
.checkout-card { border-top: 3px solid var(--primary) !important; }
.checkout-card-header {
    background: linear-gradient(135deg, var(--surface-3), #d4eddf) !important;
    border-bottom: 1px solid var(--border) !important;
}
.checkout-card-header h5 { color: var(--primary-dark); }
.cart-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(82,183,136,0.18) !important;
}
.cart-tab-link.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary) !important;
}

/* ── CTA Section ──────────────────────────────────────────────── */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 90% 50%, rgba(82,183,136,0.2), transparent 70%);
}

/* ── Section helpers ──────────────────────────────────────────── */
.section-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--accent-soft);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}
.section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}
.section-sub {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 560px;
    margin: 0 auto;
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .auth-panel-left { display: none; }
    .auth-panel-right {
        border-radius: 0;
        min-height: 100vh;
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    }
    .auth-card {
        background: var(--surface);
        border-radius: var(--radius-lg);
        padding: 2rem;
        box-shadow: var(--shadow-lg);
    }
}
@media (max-width: 768px) {
    .hero-section { min-height: 80vh; }
    .hero-section::after { display: none; }
    .stat-divider { display: none; }
    .section-title { font-size: 1.6rem; }
    .navbar-collapse { padding: 0.75rem 0; }
    .navbar .nav-link { padding: 0.5rem 0.5rem !important; }
}
@media (max-width: 576px) {
    .container { padding-left: 1rem; padding-right: 1rem; }
    .card-body { padding: 1.25rem !important; }
    .auth-panel-right { padding: 1.5rem; }
    .auth-card { padding: 1.5rem; }
}
