@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

:root {
  --bg: #e8e8e8;
  --surface: #f5f5f5;
  --text: #2f3542;
  --text-muted: #57606f;
  --accent: #4b7bec;
  --shadow-light: rgba(255, 255, 255, 0.9);
  --shadow-dark: rgba(163, 177, 198, 0.6);
  --radius: 16px;
  --accent-warm: #e08e0b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--text);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: -8px -8px 16px var(--shadow-light), 8px 8px 16px var(--shadow-dark);
}

.input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset -4px -4px 8px var(--shadow-light), inset 4px 4px 8px var(--shadow-dark);
  font-size: 16px;
  color: var(--text);
}
.input:focus {
  outline: 2px solid var(--accent);
}

.button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: -6px -6px 12px var(--shadow-light), 6px 6px 12px var(--shadow-dark);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.button:active {
  box-shadow: inset -4px -4px 8px var(--shadow-light), inset 4px 4px 8px var(--shadow-dark);
  transform: scale(0.97);
}

.toggle-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface);
  box-shadow: -10px -10px 20px var(--shadow-light), 10px 10px 20px var(--shadow-dark);
  transition: box-shadow 150ms ease, transform 150ms ease, color 150ms ease;
}
.toggle-circle.is-on {
  color: var(--accent);
  box-shadow: inset -6px -6px 14px var(--shadow-light), inset 6px 6px 14px var(--shadow-dark);
}
.toggle-circle:active {
  transform: scale(0.97);
}

.error-text { color: #eb3b5a; margin-bottom: 16px; }
.muted { color: var(--text-muted); font-size: 14px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: -3px -3px 6px var(--shadow-light), 3px 3px 6px var(--shadow-dark);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 200ms ease;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a4b0be;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  transition: background 200ms ease, box-shadow 200ms ease;
}
.status-badge.is-connected {
  color: #1e9e57;
}
.status-badge.is-connected .status-dot {
  background: #2ecc71;
  box-shadow: 0 0 6px 1px rgba(46, 204, 113, 0.6);
}
.status-badge.is-disconnected {
  color: #eb3b5a;
}
.status-badge.is-disconnected .status-dot {
  background: #eb3b5a;
  box-shadow: 0 0 6px 1px rgba(235, 59, 90, 0.5);
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: -4px -4px 8px var(--shadow-light), 4px 4px 8px var(--shadow-dark);
}

table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 8px 12px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-tile {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  box-shadow: -4px -4px 8px var(--shadow-light), 4px 4px 8px var(--shadow-dark);
}
.stat-tile .stat-value { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-tile.stat-cost .stat-value { color: var(--accent-warm); }
.stat-tile .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.breakdown-row { margin-bottom: 14px; }
.breakdown-row .breakdown-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}
.breakdown-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: inset -2px -2px 4px var(--shadow-light), inset 2px 2px 4px var(--shadow-dark);
  overflow: hidden;
}
.breakdown-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 400ms ease;
}

.report-section { margin-bottom: 18px; }
.report-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.report-section p { margin: 0; line-height: 1.6; }

.recommendation-list { margin: 0; padding-left: 18px; }
.recommendation-list li { margin-bottom: 6px; line-height: 1.5; }

.efficiency-note {
  border-left: 3px solid var(--accent-warm);
  padding: 12px 16px;
  background: rgba(224, 142, 11, 0.08);
  border-radius: 0 12px 12px 0;
  font-size: 14px;
  line-height: 1.5;
}

.peak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(224, 142, 11, 0.12);
  color: var(--accent-warm);
  font-size: 13px;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 30, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-card { width: 100%; max-width: 320px; text-align: center; }
.modal-card h3 { margin: 0 0 12px; font-size: 17px; }
.modal-card p { margin: 0; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions .button { margin-bottom: 0; flex: 1; width: auto; }
.button.button-warn { color: var(--accent-warm); }
