/* =========================================================
   Agri Smart v4.0 — Design System
   Modern · Clean · 4.0 Ready
   ========================================================= */

:root {
  /* Brand */
  --primary: #00c853;
  --primary-light: #69f0ae;
  --primary-dark: #009624;
  --accent: #00e5ff;
  --warning: #ffab00;
  --danger: #ff5252;
  --info: #448aff;

  /* Surfaces */
  --bg: #07110c;
  --bg-elevated: #0c1a12;
  --surface: rgba(12, 28, 18, 0.82);
  --surface-2: rgba(16, 36, 24, 0.9);
  --border: rgba(0, 255, 136, 0.12);
  --border-strong: rgba(0, 255, 136, 0.28);

  /* Text */
  --text: #e8f5e9;
  --text-secondary: #8fbc9a;
  --text-muted: #5c8a6a;

  /* Effects */
  --glow: 0 0 24px rgba(0, 200, 83, 0.25);
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.4);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Background ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(0, 200, 83, 0.07), transparent),
    radial-gradient(ellipse 70% 50% at 85% 80%, rgba(0, 229, 255, 0.05), transparent),
    linear-gradient(165deg, #050e09 0%, #0a1810 50%, #07110c 100%);
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridShift 60s linear infinite;
  pointer-events: none;
}

@keyframes gridShift {
  to { transform: translate(48px, 48px); }
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
}

.container {
  width: 100%;
  max-width: 440px;
}

/* ---------- Glass Card ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-xl) var(--space-lg);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.7;
}

/* ---------- Brand ---------- */
.brand {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.brand img {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 0 16px rgba(0, 200, 83, 0.4));
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(0, 200, 83, 0.3)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 22px rgba(0, 200, 83, 0.55)); transform: scale(1.03); }
}

.brand h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: var(--space-sm);
}

.brand p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- Form ---------- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 20, 10, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #003d16;
  box-shadow: 0 6px 20px rgba(0, 200, 83, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 200, 83, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

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

.btn-ghost:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 82, 82, 0.06);
}

/* ---------- System Choice Cards ---------- */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: var(--space-lg) 0;
}

@media (min-width: 460px) {
  .choice-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px 22px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.choice-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(0, 200, 83, 0.1), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
}

.choice-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), var(--glow);
}

.choice-card:hover::after {
  opacity: 1;
}

.choice-card.solar {
  border-color: rgba(255, 171, 0, 0.2);
}

.choice-card.solar:hover {
  border-color: rgba(255, 171, 0, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 171, 0, 0.15);
}

.choice-card.solar::after {
  background: radial-gradient(circle at 50% 0%, rgba(255, 171, 0, 0.12), transparent 65%);
}

.choice-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.choice-card:not(.solar) .choice-icon {
  background: linear-gradient(145deg, rgba(0, 200, 83, 0.18), rgba(0, 150, 36, 0.08));
  border: 1px solid rgba(0, 200, 83, 0.25);
}

.choice-card.solar .choice-icon {
  background: linear-gradient(145deg, rgba(255, 171, 0, 0.2), rgba(230, 81, 0, 0.08));
  border: 1px solid rgba(255, 171, 0, 0.3);
}

.choice-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.choice-card:not(.solar) .choice-title { color: var(--primary-light); }
.choice-card.solar .choice-title { color: var(--warning); }

.choice-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

.choice-cta {
  margin-top: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.55;
  transition: all 0.25s;
  position: relative;
  z-index: 1;
}

.choice-card:hover .choice-cta {
  opacity: 1;
  transform: translateX(3px);
}

.choice-card:not(.solar) .choice-cta { color: var(--primary); }
.choice-card.solar .choice-cta { color: var(--warning); }

/* ---------- Welcome ---------- */
.welcome {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.welcome .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.welcome .user {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-light);
  text-shadow: 0 0 12px rgba(0, 200, 83, 0.3);
}

.section-title {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin: var(--space-md) 0 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* ---------- Utility ---------- */
.error-msg {
  color: var(--danger);
  text-align: center;
  font-size: 0.85rem;
  min-height: 22px;
  margin-top: var(--space-sm);
}

.footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hidden { display: none !important; }

/* ---------- Particles ---------- */
.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.3;
  box-shadow: 0 0 6px var(--primary);
  animation: float 11s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.2; }
  50% { transform: translateY(-50px) scale(1.25); opacity: 0.55; }
}

/* ---------- Responsive ---------- */
@media (max-width: 400px) {
  .card { padding: 28px 18px; }
  .brand h1 { font-size: 1.35rem; }
  .brand img { width: 76px; height: 76px; }
}
