@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@300;400;600;700;800&display=swap');

:root {
    --bg-light: #f0fdf4;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #d1fae5;
    --primary-action: #15803d;
    --hover-action: #166534;
    --error: #be123c;
    --success: #15803d;
    
    /* Farmer Portal Green Theme */
    --farmer-primary: #16a34a;
    --farmer-dark: #14532d;
    --farmer-btn: #16a34a;
    --farmer-btn-hover: #15803d;
    --farmer-glow: rgba(22, 163, 74, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Mukta', sans-serif;
}

body {
    color: var(--text-main);
    min-height: 100vh;
}

/* ── ANIMATED BACKGROUND ─────────────────────────────── */
.farmer-portal {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 30%, #047857 60%, #059669 100%);
    position: relative;
    min-height: 100vh;
}

.farmer-portal::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(134, 239, 172, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(110, 231, 183, 0.05) 0%, transparent 50%);
    animation: bgFloat 12s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgFloat {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(2deg); }
}

/* Floating particles */
.farmer-portal::after {
    content: '🌾 🌱 🌿 🍃 🌾 🌱 🌿 🍃';
    position: fixed;
    top: 10%;
    left: -5%;
    font-size: 1.5rem;
    opacity: 0.07;
    letter-spacing: 60px;
    white-space: nowrap;
    animation: floatText 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatText {
    from { transform: translateX(-10%); }
    to { transform: translateX(110%); }
}

/* ── LAYOUT ─────────────────────────────────────────── */
.lang-selector-wrapper {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

.lang-dropdown {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Mukta', sans-serif;
}
.lang-dropdown option { color: #1e293b; background: white; }

.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 70px 20px 50px;
    position: relative;
    z-index: 1;
}

/* ── AUTH CARD ─────────────────────────────────────── */
.auth-box {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.1);
    animation: cardIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    transition: max-width 0.4s ease;
}

.auth-box.wide {
    max-width: 680px;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── HEADER ─────────────────────────────────────────── */
.auth-header.green {
    background: linear-gradient(135deg, #064e3b 0%, #16a34a 100%);
    color: white;
    text-align: center;
    padding: 36px 24px 28px;
    position: relative;
    overflow: hidden;
}

.auth-header.green::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.auth-header.green::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.logo-icon-wrap {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 2rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.logo-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.logo-subtitle {
    font-size: 0.82rem;
    color: #a7f3d0;
    margin-top: 6px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ── TABS ─────────────────────────────────────────────── */
.tab-nav {
    display: flex;
    background: white;
    border-bottom: 1px solid #f0fdf4;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.auth-tab:hover { background: #f0fdf4; color: var(--farmer-primary); }

.auth-tab.active {
    color: var(--farmer-primary);
    border-bottom: 3px solid var(--farmer-primary);
    background: #f0fdf4;
}

/* ── BODY ─────────────────────────────────────────────── */
.auth-body { padding: 28px 30px 30px; }

/* ── FORM GRIDS ─────────────────────────────────────── */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .auth-box.wide { max-width: 100%; }
}

/* ── INPUT FIELDS ─────────────────────────────────────── */
.input-wrap { margin-bottom: 14px; }

.input-wrap label {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #374151;
}

.input-icon-box {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 14px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.input-icon-box:focus-within {
    border-color: var(--farmer-primary);
    background: white;
    box-shadow: 0 0 0 4px var(--farmer-glow);
}

.input-icon-box input,
.input-icon-box select {
    flex: 1;
    border: none;
    outline: none;
    padding: 11px 8px;
    font-size: 0.95rem;
    background: transparent;
    color: var(--text-main);
    font-family: 'Mukta', sans-serif;
}

.input-icon-box select option { color: #1e293b; }

.input-icon-box .input-icon {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-right: 4px;
    flex-shrink: 0;
}

.eye-icon {
    cursor: pointer;
    color: #9ca3af;
    padding: 6px;
    transition: color 0.2s;
}
.eye-icon:hover { color: var(--farmer-primary); }

/* ── REQUIRED STAR ───────────────────────────────────── */
.required { color: #ef4444; margin-left: 2px; }

/* ── CAPTCHA ──────────────────────────────────────────── */
.captcha-box {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    padding: 12px;
    border-radius: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    letter-spacing: 8px;
    text-align: center;
    font-size: 1.4rem;
    border: 2px dashed #86efac;
    color: #064e3b;
    margin-bottom: 10px;
    user-select: none;
}

/* ── CHECKBOX ──────────────────────────────────────────── */
.checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.checkbox-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--farmer-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
    letter-spacing: 0.3px;
}

.btn:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.btn:active { transform: translateY(0); box-shadow: none; }

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-blue:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-btn-outline {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
    box-shadow: none;
}
.btn-btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── DIVIDER ────────────────────────────────────────── */
.divider {
    text-align: center;
    position: relative;
    margin: 10px 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0 4px;
    white-space: nowrap;
}

/* ── NOTIFICATIONS ─────────────────────────────────── */
.notification {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    animation: notifIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notification.hidden { display: none; }

.notification.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.notification.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes notifIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── FORGOT LINK ────────────────────────────────────── */
.forgot-link a {
    color: #6366f1;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.forgot-link a:hover { color: #4f46e5; text-decoration: underline; }

/* ── FORM VISIBILITY ─────────────────────────────────── */
.hidden-form { display: none !important; }
.active-form { display: block; }

/* ── PREMIUM ADMIN UI ────────────────────────────────── */
.admin-shell {
    --admin-bg: #f8fafc;
    --admin-sidebar: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #0f172a;
    --admin-muted: #64748b;
    --admin-primary: #0f172a;
    --admin-accent: #2563eb;
    background: var(--admin-bg);
}

.topbar {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.content-area {
    padding: 32px;
    max-width: 1400px;
}

.section-header {
    border-bottom: 1px solid var(--admin-border);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--admin-text);
}

/* Unified Action Bar */
.action-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
}

.search-input-group {
    flex: 1;
    display: flex;
    position: relative;
}

.search-input-group input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    background: #f1f5f9;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input-group input:focus {
    background: white;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Premium Buttons */
.btn-premium {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.btn-premium.btn-solid {
    background: var(--admin-primary);
    color: white;
}

.btn-premium.btn-solid:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.btn-premium.btn-outline {
    background: white;
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
}

.btn-premium.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--admin-muted);
}

.btn-premium.btn-success {
    background: #10b981;
    color: white;
}

.btn-premium.btn-success:hover {
    background: #059669;
}

/* Premium Table */
.premium-table-wrap {
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.data-table-premium {
    width: 100%;
    border-collapse: collapse;
}

.data-table-premium th {
    padding: 16px 20px;
    text-align: left;
    background: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-muted);
    border-bottom: 1px solid var(--admin-border);
    font-weight: 700;
}

.data-table-premium td {
    padding: 16px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--admin-text);
}

.data-table-premium tr:last-child td {
    border-bottom: none;
}

.data-table-premium tr:hover td {
    background: #fbfcfd;
}

.badge-id {
    font-weight: 700;
    color: var(--admin-muted);
}

.district-name {
    font-weight: 600;
    color: var(--admin-text);
}

.mh-code-badge {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--admin-muted);
}

/* Dashboard Grid & Cards */
.grid-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--admin-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -12px rgba(0,0,0,0.1);
    border-color: var(--admin-accent);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--admin-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--admin-text);
    margin: 0;
}

/* Scrollbar refinement */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Modal Enhancements */
.premium-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    padding: 32px;
    width: 100%;
    max-width: 450px;
}

.premium-modal h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-weight: 800;
}

.premium-modal p {
    color: var(--admin-muted);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.sample-link {
    color: var(--admin-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sample-link:hover {
    text-decoration: underline;
}
