:root {
  --green-dark: #1b5e20;
  --green-main: #2e7d32;
  --green-light: #a5d6a7;
  --green-soft: #e8f5e9;
  --white: #ffffff;
  --text-dark: #1f2a24;
  --text-muted: #607064;
  --shadow: 0 12px 30px rgba(27, 94, 32, 0.15);
  --radius: 22px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f1f8e9, #ffffff);
  color: var(--text-dark);
  min-height: 100vh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 90px;
  position: relative;
}

.header {
  padding: 28px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  color: var(--green-main);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.header h1 {
  font-size: 1.85rem;
  color: var(--green-dark);
}

.header-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.main {
  padding: 0 20px;
}

.section {
  display: none;
  animation: fadeIn 0.25s ease;
}

.section.active {
  display: block;
}

.hero {
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  color: var(--white);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: var(--shadow);
}

.hero h2 {
  font-size: 1.7rem;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero p {
  color: #e8f5e9;
  line-height: 1.5;
  margin-bottom: 22px;
}

.primary-button {
  width: 100%;
  border: none;
  background: var(--green-main);
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
  padding: 16px;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(46, 125, 50, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}

.hero .primary-button {
  background: var(--white);
  color: var(--green-dark);
}

.primary-button:active {
  transform: scale(0.97);
}

.section-title {
  margin: 26px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title h3 {
  font-size: 1.25rem;
}

.section-title span {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--green-soft);
  padding: 6px 10px;
  border-radius: 999px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}

.card h2 {
  font-size: 1.5rem;
  color: var(--green-dark);
  margin-bottom: 8px;
}

.card-subtitle {
  margin-bottom: 22px;
  color: var(--text-muted);
  line-height: 1.45;
}

form {
  display: grid;
  gap: 14px;
}

label {
  font-weight: 800;
  color: var(--text-dark);
  font-size: 0.9rem;
}

input,
select {
  width: 100%;
  border: 2px solid #dbeede;
  border-radius: 16px;
  padding: 15px;
  font-size: 1rem;
  outline: none;
  background: #fbfffb;
}

input:focus,
select:focus {
  border-color: var(--green-main);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 28px));
  background: var(--white);
  border-radius: 24px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

.nav-button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 18px;
  padding: 10px 4px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  gap: 3px;
  place-items: center;
}

.nav-button span {
  font-size: 1.2rem;
}

.nav-button.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.photo-section {
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
}

.photo-preview {
  width: 100%;
  min-height: 190px;
  border: 2px dashed var(--green-light);
  border-radius: 20px;
  background: var(--green-soft);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  color: var(--text-muted);
  padding: 18px;
}

.photo-preview span {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 6px;
}

.photo-preview p {
  font-weight: 700;
}

.photo-preview img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

.photo-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.secondary-button {
  width: 100%;
  border: 2px solid var(--green-light);
  background: #ffffff;
  color: var(--green-dark);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.secondary-button:active {
  transform: scale(0.97);
  background: var(--green-soft);
}

.plants-list {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.empty-plants {
  display: block;
}

.empty-state {
  background: var(--white);
  border: 2px dashed var(--green-light);
  border-radius: 24px;
  padding: 32px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  font-size: 2.3rem;
}

.empty-state h3 {
  color: var(--green-dark);
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  line-height: 1.45;
}

.plant-item {
  background: var(--white);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.plant-top {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.plant-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--green-soft);
  border: 3px solid #ffffff;
  box-shadow: 0 6px 16px rgba(27, 94, 32, 0.18);
}

.plant-info h4 {
  color: var(--green-dark);
  font-size: 1.05rem;
  margin-bottom: 3px;
}

.plant-info p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.watering-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 7px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.watering-status.ok {
  background: #e8f5e9;
  color: #1b5e20;
}

.watering-status.ok .status-dot {
  background: #2e7d32;
}

.watering-status.soon {
  background: #fff3e0;
  color: #e65100;
}

.watering-status.soon .status-dot {
  background: #fb8c00;
}

.watering-status.urgent {
  background: #ffebee;
  color: #b71c1c;
}

.watering-status.urgent .status-dot {
  background: #e53935;
}

.watering-box {
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.watering-box.ok {
  background: #e8f5e9;
}

.watering-box.soon {
  background: #fff3e0;
}

.watering-box.urgent {
  background: #ffebee;
}

.watering-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.watering-box h5 {
  font-size: 1.1rem;
  color: var(--text-dark);
}

.watering-days-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  font-weight: 950;
  font-size: 1.1rem;
  color: var(--green-dark);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.plant-dates {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.plant-dates p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.plant-dates strong {
  color: var(--text-dark);
}

.plant-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.watered-button {
  border: none;
  background: var(--green-main);
  color: #ffffff;
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(46, 125, 50, 0.22);
}

.delete-plant-button {
  border: none;
  background: #ffebee;
  color: #b71c1c;
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 900;
  cursor: pointer;
}

.watered-button:active,
.delete-plant-button:active {
  transform: scale(0.97);
}

.reminders-list {
  display: grid;
  gap: 14px;
}

.empty {
  background: var(--white);
  border: 1px dashed var(--green-light);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty p {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.reminder-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.reminder-card h4 {
  color: var(--green-dark);
  margin-bottom: 8px;
}

.reminder-card p {
  color: var(--text-muted);
  line-height: 1.45;
}

.spinner-wrapper {
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--green-dark);
  font-weight: 800;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #c8e6c9;
  border-top-color: var(--green-main);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.identification-result,
.identification-error {
  width: 100%;
  display: grid;
  gap: 14px;
}

.identification-result img,
.identification-error img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 18px;
}

.plantnet-result-card,
.plantnet-error-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  box-shadow: 0 8px 22px rgba(27, 94, 32, 0.12);
}

.result-label {
  color: var(--green-main);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.plantnet-result-card h3 {
  color: var(--green-dark);
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.plantnet-result-card p,
.plantnet-error-card p {
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 8px;
}

.care-recommendation-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
}

.care-recommendation-box p {
  margin-bottom: 10px;
}

.care-recommendation-box p:last-child {
  margin-bottom: 0;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (min-width: 420px) {
  .photo-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .plant-top {
    grid-template-columns: 52px 1fr;
  }

  .watering-status {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .plant-actions {
    grid-template-columns: 1fr;
  }

  .header h1 {
    font-size: 1.55rem;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

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


.fallback-title {
  font-weight: 900;
  color: var(--text-dark) !important;
  margin-bottom: 8px !important;
}

.fallback-small {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.fallback-error-detail {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff3e0;
  color: #8a4b00;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.fallback-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 14px 0;
}

.fallback-button {
  border: 2px solid var(--green-light);
  background: #ffffff;
  color: var(--green-dark);
  border-radius: 14px;
  padding: 12px;
  font-weight: 900;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
}

.fallback-button:active {
  transform: scale(0.98);
  background: var(--green-soft);
}

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


.push-card {
  background: linear-gradient(135deg, #e8f5e9, #ffffff);
  border: 2px solid #c8e6c9;
  border-radius: 22px;
  padding: 18px;
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.push-card h3 {
  color: var(--green-dark);
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.push-card p {
  color: var(--text-muted);
  line-height: 1.45;
}

.push-card .secondary-button {
  margin-top: -4px;
}

.ios-note {
  color: var(--text-muted);
  line-height: 1.35;
  font-weight: 700;
}
