/* ========================================
   BharatAgri AI — Design System
   Professional, institutional-grade UI
   White background + subtle agricultural themed illustrations
   ======================================== */

/* === CSS Variables === */
:root {
    --primary: #1a6b2a;
    --primary-light: #2d8a3e;
    --primary-lighter: #e8f5e9;
    --primary-dark: #145520;
    --accent: #c4943a;
    --accent-light: #f5e6c8;
    --text-primary: #1a2e1a;
    --text-secondary: #4a5e4a;
    --text-muted: #7a8e7a;
    --bg-white: #ffffff;
    --bg-off: #f8faf8;
    --bg-card: #ffffff;
    --border: #e2e8e2;
    --border-light: #f0f4f0;
    --shadow-sm: 0 1px 3px rgba(26, 107, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(26, 107, 42, 0.08);
    --shadow-lg: 0 8px 30px rgba(26, 107, 42, 0.1);
    --shadow-xl: 0 16px 48px rgba(26, 107, 42, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Poppins', 'Inter', sans-serif;
    --font-indic-hi: 'Noto Sans Devanagari', 'Inter', sans-serif;
    --font-indic-mr: 'Noto Sans Devanagari', 'Inter', sans-serif;
    --font-indic-gu: 'Noto Sans Gujarati', 'Inter', sans-serif;
    --font-indic-pa: 'Noto Sans Gurmukhi', 'Inter', sans-serif;
    --font-indic-te: 'Noto Sans Telugu', 'Inter', sans-serif;
    --font-indic-ta: 'Noto Sans Tamil', 'Inter', sans-serif;
    --font-indic-bn: 'Noto Sans Bengali', 'Inter', sans-serif;
    --risk-low: #2d8a3e;
    --risk-moderate: #c4943a;
    --risk-high: #c44a3a;
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Language-specific font overrides */
body.lang-hi,
body.lang-mr {
    font-family: var(--font-indic-hi);
}

body.lang-hi h1,
body.lang-hi h2,
body.lang-hi h3,
body.lang-hi h4,
body.lang-mr h1,
body.lang-mr h2,
body.lang-mr h3,
body.lang-mr h4 {
    font-family: var(--font-indic-hi);
}

body.lang-gu {
    font-family: var(--font-indic-gu);
}

body.lang-gu h1,
body.lang-gu h2,
body.lang-gu h3,
body.lang-gu h4 {
    font-family: var(--font-indic-gu);
}

body.lang-pa {
    font-family: var(--font-indic-pa);
}

body.lang-pa h1,
body.lang-pa h2,
body.lang-pa h3,
body.lang-pa h4 {
    font-family: var(--font-indic-pa);
}

body.lang-te {
    font-family: var(--font-indic-te);
}

body.lang-te h1,
body.lang-te h2,
body.lang-te h3,
body.lang-te h4 {
    font-family: var(--font-indic-te);
}

body.lang-ta {
    font-family: var(--font-indic-ta);
}

body.lang-ta h1,
body.lang-ta h2,
body.lang-ta h3,
body.lang-ta h4 {
    font-family: var(--font-indic-ta);
}

body.lang-bn {
    font-family: var(--font-indic-bn);
}

body.lang-bn h1,
body.lang-bn h2,
body.lang-bn h3,
body.lang-bn h4 {
    font-family: var(--font-indic-bn);
}

body.lang-en {
    font-family: var(--font-sans);
}

body.lang-en h1,
body.lang-en h2,
body.lang-en h3,
body.lang-en h4 {
    font-family: var(--font-display);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
}

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

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

/* === Navigation === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    font-size: 1.6rem;
}

.logo-accent {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-lighter);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-lighter);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-selector select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-sm {
    font-size: 1.1rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(26, 107, 42, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(26, 107, 42, 0.25);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-lighter);
}

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

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

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: #b3852e;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

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

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

.card-elevated:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-sublabel {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 107, 42, 0.1);
}

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

.form-help {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.help-toggle {
    font-size: 0.75rem;
    color: var(--primary);
    cursor: pointer;
    background: var(--primary-lighter);
    border: none;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-top: 4px;
    transition: all var(--transition);
}

.help-toggle:hover {
    background: var(--primary);
    color: white;
}

.help-content {
    display: none;
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-off);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary);
}

.help-content.show {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* === Slider === */
.slider-group {
    margin-bottom: 16px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.slider-value {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(26, 107, 42, 0.3);
}

/* === Main Content === */
#app {
    padding-top: 64px;
    min-height: 100vh;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-wide {
    max-width: 1400px;
}

.page-narrow {
    max-width: 720px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
}

/* === Hero Section === */
.hero {
    text-align: center;
    padding: 80px 24px 60px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.15;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Features Grid === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 60px auto;
    max-width: 1100px;
    padding: 0 24px;
}

.feature-card {
    padding: 28px;
    text-align: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
}

.feature-card h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === Stats Strip === */
.stats-strip {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 40px 24px;
    margin: 20px auto;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-display);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === Results Section === */
.results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

.result-card {
    padding: 24px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.result-header h3 {
    font-size: 1.05rem;
}

.result-icon {
    font-size: 1.8rem;
}

.crop-rank {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-off);
    border-left: 3px solid var(--primary);
}

.crop-rank.rank-1 {
    border-left-color: #FFD700;
    background: #fffef0;
}

.crop-rank.rank-2 {
    border-left-color: #C0C0C0;
}

.crop-rank.rank-3 {
    border-left-color: #CD7F32;
}

.crop-rank-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.crop-rank-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.crop-rank-prob {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-left: auto;
}

.yield-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-display);
}

.yield-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.yield-comparison {
    margin-top: 12px;
    font-size: 0.88rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.yield-above {
    background: #e8f5e9;
    color: var(--primary);
}

.yield-below {
    background: #fff3e0;
    color: var(--accent);
}

/* Risk indicator */
.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
}

.risk-low {
    background: #e8f5e9;
    color: var(--risk-low);
}

.risk-moderate {
    background: #fff8e1;
    color: var(--risk-moderate);
}

.risk-high {
    background: #fbe9e7;
    color: var(--risk-high);
}

.risk-factors {
    margin-top: 12px;
}

.risk-factor {
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.risk-factor::before {
    content: "⚠";
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.explanation-box {
    margin-top: 16px;
    padding: 16px;
    background: var(--primary-lighter);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    border-left: 3px solid var(--primary);
}

/* Feature Importance */
.importance-bar-container {
    margin-top: 8px;
}

.importance-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 0.82rem;
}

.importance-label {
    width: 120px;
    text-align: right;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.importance-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.importance-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.importance-value {
    width: 40px;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
}

/* === Dashboard === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

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

.history-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.history-table td {
    padding: 10px 12px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-light);
}

.history-table tr:hover {
    background: var(--bg-off);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 250px;
    margin-top: 16px;
}

/* Bar chart via CSS */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding-top: 16px;
}

.bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}

.bar-predicted {
    background: var(--primary);
}

.bar-average {
    background: var(--accent-light);
    border: 1px solid var(--accent);
}

.bar-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    writing-mode: horizontal-tb;
}

.chart-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 12px;
    font-size: 0.82rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

/* === Chatbot === */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-msg {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg.bot {
    align-self: flex-start;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-msg.user .chat-avatar {
    background: var(--primary-lighter);
}

.chat-msg.bot .chat-avatar {
    background: var(--accent-light);
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-line;
}

.chat-msg.user .chat-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.bot .chat-bubble {
    background: var(--bg-off);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-light);
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border-light);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    outline: none;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}

.chat-input:focus {
    border-color: var(--primary);
}

.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.quick-btn {
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-off);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.quick-btn:hover {
    background: var(--primary-lighter);
    color: var(--primary);
    border-color: var(--primary);
}

/* === Auth Pages === */
.auth-container {
    max-width: 440px;
    margin: 60px auto;
    padding: 0 24px;
}

.auth-card {
    padding: 36px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.auth-title {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* === Profile === */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* === Background Illustrations === */
.bg-illustrations {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-illust {
    position: absolute;
}

.illust-1 {
    top: 10%;
    right: -40px;
    width: 280px;
    opacity: 0.7;
    animation: floatSlow 20s ease-in-out infinite;
}

.illust-2 {
    bottom: 5%;
    left: -30px;
    width: 240px;
    opacity: 0.7;
    animation: floatSlow 25s ease-in-out infinite reverse;
}

.illust-3 {
    top: 50%;
    left: 10%;
    width: 400px;
    opacity: 0.5;
    animation: floatSlow 30s ease-in-out infinite;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: var(--text-primary);
    color: white;
    font-size: 0.88rem;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.3s ease;
}

.toast.hidden {
    display: none;
}

.toast.success {
    background: var(--primary);
}

.toast.error {
    background: var(--risk-high);
}

/* === Loading === */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* === Climate Simulation === */
.simulation-panel {
    margin-top: 24px;
    padding: 20px;
    background: #fffef5;
    border: 1px solid var(--accent-light);
    border-radius: var(--radius-md);
}

.simulation-panel h4 {
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

.fade-in {
    animation: fadeInUp 0.4s ease forwards;
}

.hidden {
    display: none !important;
}

/* === Footer === */
.footer {
    margin-top: 80px;
    padding: 40px 24px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    color: var(--primary);
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 12px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }

    .nav-links.show {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .stats-strip {
        gap: 24px;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .results-container {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .auth-container {
        margin: 30px auto;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .nav-actions {
        gap: 6px;
    }

    .hero {
        padding: 40px 16px 30px;
    }

    .page {
        padding: 20px 16px;
    }

    .card {
        padding: 16px;
    }
}

/* === Utility === */
.text-center {
    text-align: center;
}

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

.mt-12 {
    margin-top: 12px;
}

.mt-24 {
    margin-top: 24px;
}

.mt-32 {
    margin-top: 32px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.gap-12 {
    gap: 12px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.w-full {
    width: 100%;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.font-bold {
    font-weight: 700;
}