/* =============================================
   MyLawnWeek Subscriber Portal - Stylesheet
   Brand: #2D6A2D (dark green), #4A904A (medium)
   Font: Montserrat
   ============================================= */

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

body {
  font-family: 'Montserrat', Arial, sans-serif;
  background: #f2f4f0;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ---- Login page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a3d1a 0%, #2D6A2D 50%, #4A904A 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-bg-art {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 28px;
  opacity: 0.08;
  letter-spacing: 8px;
  padding: 16px;
  white-space: nowrap;
  overflow: hidden;
}

.login-card {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 1;
}

.login-brand {
  background: #2D6A2D;
  padding: 36px 32px 28px;
  text-align: center;
  color: white;
}
.login-brand .brand-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.login-brand h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.login-brand p { font-size: 13px; opacity: 0.8; margin-top: 4px; }

.login-content { padding: 32px; }
.login-content h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.login-sub { color: #666; font-size: 14px; line-height: 1.6; margin-bottom: 24px; }

.login-form label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.login-form input[type=email] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}
.login-form input[type=email]:focus { border-color: #4A904A; }

.login-footer { text-align: center; margin-top: 20px; font-size: 13px; color: #999; }
.login-footer a { color: #4A904A; text-decoration: none; font-weight: 600; }

.sent-state { padding: 32px; text-align: center; }
.sent-icon { font-size: 48px; margin-bottom: 16px; }
.sent-state h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.sent-state p { color: #555; line-height: 1.6; }
.sent-sub { font-size: 13px; color: #999 !important; margin-top: 8px !important; }

.error-banner {
  background: #fff3f3;
  border: 1px solid #ffcdd2;
  color: #c62828;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Buttons ---- */
.btn-primary {
  background: #2D6A2D;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}
.btn-primary:hover { background: #245424; }

.btn-outline {
  background: white;
  color: #2D6A2D;
  border: 2px solid #2D6A2D;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-outline:hover { background: #2D6A2D; color: white; }

.btn-green {
  background: #2D6A2D;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-green:hover { background: #245424; }

.btn-sm { font-size: 12px; padding: 6px 14px; }
.btn-ghost { background: transparent; border: 1px solid #ddd; color: #666; padding: 8px 16px; border-radius: 6px; font-family: inherit; font-size: 13px; cursor: pointer; }
.btn-link { color: #4A904A; text-decoration: none; font-size: 13px; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.btn-icon { background: none; border: none; color: #bbb; cursor: pointer; font-size: 14px; padding: 4px; transition: color 0.15s; }
.btn-icon:hover { color: #c62828; }

/* ---- Nav ---- */
.main-nav {
  background: #2D6A2D;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-left { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.nav-center { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.nav-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.nav-brand { color: white; font-weight: 800; font-size: 16px; text-decoration: none; letter-spacing: -0.3px; }
.zone-badge { background: rgba(255,255,255,0.18); color: white; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.nav-link { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 6px; transition: all 0.15s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.15); color: white; }
.nav-user { color: rgba(255,255,255,0.85); font-size: 13px; }
.nav-logout { color: rgba(255,255,255,0.6); font-size: 12px; text-decoration: none; }
.nav-logout:hover { color: white; }

/* ---- Alerts strip ---- */
.alerts-strip {
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  padding: 10px 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.alert-item {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.alert-frost { color: #1565c0; }
.alert-rain  { color: #1976d2; }
.alert-soil  { color: #2e7d32; }

/* ---- Page layout ---- */
.page-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Stat row ---- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-tile {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #ddd;
}
.stat-soil { border-left-color: #795548; }
.stat-rain { border-left-color: #1976d2; }
.stat-temp { border-left-color: #f57c00; }
.stat-season { border-left-color: #4A904A; }
.stat-warning { border-left-color: #e53935; background: #fff8f8; }
.stat-ok { border-left-color: #43a047; }

.stat-value { font-size: 28px; font-weight: 800; color: #1a1a1a; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-note { font-size: 12px; color: #666; }

/* ---- Content grid ---- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}
.grid-left, .grid-right { display: flex; flex-direction: column; gap: 20px; }

/* ---- Cards ---- */
.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 700; color: #1a1a1a; }

/* ---- Task list ---- */
.task-list { display: flex; flex-direction: column; gap: 2px; }
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
  border-radius: 8px;
  transition: background 0.15s;
  gap: 12px;
}
.task-item:hover { background: #f9f9f9; }
.task-done { opacity: 0.55; }
.task-skipped { opacity: 0.35; }
.task-left { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
}
.task-check.checked { background: #2D6A2D; border-color: #2D6A2D; }
.task-check:hover { border-color: #4A904A; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; color: #1a1a1a; display: block; }
.task-title.done { text-decoration: line-through; color: #bbb; }
.task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.task-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-mowing    { background: #e8f5e9; color: #2e7d32; }
.badge-fertilising { background: #fff8e1; color: #f57f17; }
.badge-watering  { background: #e3f2fd; color: #1565c0; }
.badge-weeds     { background: #fce4ec; color: #c62828; }
.badge-general   { background: #f5f5f5; color: #666; }
.badge-overseeding { background: #f3e5f5; color: #6a1b9a; }
.badge-aeration  { background: #e0f2f1; color: #00695c; }
.badge-products  { background: #fff3e0; color: #e65100; }
.badge-custom    { background: #e8eaf6; color: #283593; }
.task-priority { font-size: 10px; color: #bbb; font-weight: 500; }
.priority-high { color: #e53935; }
.priority-low  { color: #bbb; }
.task-remind { font-size: 11px; color: #f57c00; }
.task-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.task-btn {
  background: #f5f5f5;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.task-btn:hover { background: #e8f5e9; color: #2D6A2D; }
.task-btn-skip:hover { background: #ffebee; color: #c62828; }

/* ---- Weather card ---- */
.card-weather { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); }
.weather-loc { font-size: 11px; color: #888; }
.forecast-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.forecast-day { text-align: center; padding: 8px 2px; border-radius: 8px; }
.forecast-today { background: rgba(45, 106, 45, 0.08); }
.fc-name { font-size: 10px; font-weight: 600; color: #666; margin-bottom: 4px; text-transform: uppercase; }
.fc-icon { font-size: 20px; margin-bottom: 4px; }
.fc-high { font-size: 13px; font-weight: 700; color: #1a1a1a; }
.fc-low  { font-size: 11px; color: #999; }
.fc-rain { font-size: 10px; color: #1976d2; margin-top: 2px; }

/* ---- Edition preview ---- */
.card-edition { border-left: 4px solid #4A904A; }
.edition-week { font-size: 11px; color: #888; }
.edition-preview { font-size: 13px; color: #555; line-height: 1.6; margin-bottom: 12px; }

/* ---- Budget ---- */
.budget-summary { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.budget-total { font-size: 28px; font-weight: 800; color: #2D6A2D; }
.budget-label { font-size: 12px; color: #999; }
.budget-year { font-size: 11px; color: #bbb; }
.budget-list { border-top: 1px solid #f0f0f0; }
.budget-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.budget-item-left { flex: 1; }
.budget-item-right { display: flex; align-items: center; gap: 6px; }
.budget-desc { font-size: 13px; font-weight: 500; display: block; }
.budget-cat { font-size: 11px; color: #bbb; }
.budget-amount { font-size: 14px; font-weight: 700; color: #1a1a1a; }
.budget-more { font-size: 12px; color: #bbb; margin-top: 8px; }

/* ---- Deals ---- */
.deals-list { display: flex; flex-direction: column; gap: 12px; }
.deal-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: #f9f9f9; border-radius: 8px; }
.deal-info { flex: 1; }
.deal-name { font-size: 14px; font-weight: 600; display: block; }
.deal-desc { font-size: 12px; color: #666; display: block; margin-top: 2px; }
.deal-pricing { margin-top: 4px; }
.deal-orig { font-size: 12px; color: #bbb; text-decoration: line-through; margin-right: 6px; }
.deal-sale { font-size: 15px; font-weight: 700; color: #2D6A2D; }
.deal-actions { display: flex; flex-direction: column; gap: 6px; }

/* ---- Watches ---- */
.watch-list { display: flex; flex-direction: column; gap: 8px; }
.watch-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #f9f9f9; border-radius: 8px; border-left: 3px solid #ddd; }
.watch-sale { background: #f1f8e9; border-left-color: #4A904A; }
.watch-info { flex: 1; }
.watch-name { font-size: 13px; font-weight: 600; display: block; }
.watch-status { font-size: 11px; color: #bbb; display: block; margin-top: 2px; }
.watch-sale-badge { font-size: 11px; color: #2D6A2D; font-weight: 600; display: block; margin-top: 2px; }
.watch-target { font-size: 11px; color: #888; display: block; }

/* ---- Archive ---- */
.archive-card .card-header { margin-bottom: 12px; }
.archive-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.archive-grid-full { grid-template-columns: repeat(3, 1fr); }
.archive-item {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #eee;
  transition: all 0.15s;
  display: block;
}
.archive-item:hover { background: #e8f5e9; border-color: #4A904A; }
.archive-item.loading { color: #bbb; font-size: 13px; }
.archive-week { font-size: 13px; font-weight: 700; color: #2D6A2D; margin-bottom: 6px; }
.archive-summary { font-size: 12px; color: #666; line-height: 1.5; }
.archive-date { font-size: 11px; color: #bbb; margin-top: 8px; }

/* ---- Edition full view ---- */
.edition-full-card .card-header { margin-bottom: 20px; }
.edition-content { line-height: 1.7; color: #333; }
.edition-content h1, .edition-content h2, .edition-content h3 { color: #2D6A2D; margin: 20px 0 8px; }
.edition-content p { margin-bottom: 12px; }
.edition-content ul, .edition-content ol { padding-left: 20px; margin-bottom: 12px; }

/* ---- Empty states ---- */
.empty-state { text-align: center; padding: 24px 16px; color: #999; }
.empty-state p { margin-bottom: 6px; font-size: 14px; }
.empty-sub { font-size: 12px !important; }

/* ---- Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.15s ease;
}
.modal-sm { max-width: 320px; }
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 0; }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #bbb; padding: 4px; }
.modal-body { padding: 16px 20px; }
.modal-body label { display: block; font-size: 12px; font-weight: 600; color: #555; margin: 12px 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.modal-body label:first-child { margin-top: 0; }
.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: #4A904A; }
.modal-footer { padding: 12px 20px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.quick-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-btn {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.quick-btn:hover { background: #e8f5e9; border-color: #4A904A; color: #2D6A2D; }

/* ---- Toast ---- */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1a1a1a;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.toast-show { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .forecast-row { grid-template-columns: repeat(4, 1fr); }
  .forecast-row > *:nth-child(n+5) { display: none; }
}
@media (max-width: 600px) {
  .nav-center { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .archive-grid { grid-template-columns: 1fr 1fr; }
  .page-main { padding: 12px; gap: 12px; }
}
