/* Snapshot — Reusable Components */

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: white;
  box-shadow: 0 4px 14px var(--green-glow);
}
.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--green-glow);
  color: white;
}

.btn-dark {
  background: var(--dark);
  color: white;
}
.btn-dark:hover {
  background: var(--dark-soft);
  transform: translateY(-1px);
  color: white;
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover {
  border-color: var(--border-medium);
  background: var(--bg-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-gray);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-danger {
  background: var(--error);
  color: white;
}

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── Input Fields ────────────────────────────────────────── */
.input-field {
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-field:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
.input-field::placeholder {
  color: var(--text-muted);
}

.input-lg {
  padding: 16px 20px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-group {
  margin-bottom: 16px;
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 440px;
  position: relative;
  animation: fadeIn 0.3s ease-out;
  box-shadow: var(--shadow-xl);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

.modal-title {
  font-size: 22px;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ─── Tab switcher ────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* ─── Score Gauges ────────────────────────────────────────── */
.score-gauge {
  text-align: center;
  padding: 20px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.score-gauge-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.score-gauge-value {
  font-size: 48px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1;
}

.score-gauge-rating {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

/* ─── Flaw / Warning Banners ──────────────────────────────── */
.flaw-banner {
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}
.flaw-banner-fatal {
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.flaw-banner-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.flaw-banner-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.flaw-banner-fatal .flaw-banner-title { color: var(--error); }
.flaw-banner-warning .flaw-banner-title { color: var(--warning); }

.flaw-banner-item {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.flaw-banner-item:last-child { border-bottom: none; }

/* ─── Loading Overlay ─────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.loading-overlay.active { display: flex; }

.loading-text {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.loading-subtext {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .btn-lg {
    padding: 14px 24px;
    font-size: 15px;
  }
  .modal {
    padding: 24px;
    max-width: 100%;
  }
}

/* ─── Building Footprint Selection ────────────────────────── */

.footprint-prompt {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: 560px;
  width: calc(100% - 32px);
  background: white;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  animation: fpSlideUp 0.3s ease-out;
}

@keyframes fpSlideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.footprint-prompt-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.footprint-prompt-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-light, #dcfce7);
  color: var(--green, #16a34a);
  border-radius: var(--radius-md, 8px);
}

.footprint-prompt-text {
  flex: 1;
  min-width: 0;
}

.footprint-prompt-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
  margin-bottom: 2px;
}

.footprint-prompt-text span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
}

.footprint-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.footprint-source-btn {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green, #16a34a);
  background: var(--green-light, #dcfce7);
  border: none;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.footprint-source-btn:hover {
  background: #bbf7d0;
}

.footprint-skip-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  background: none;
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s;
}

.footprint-skip-btn:hover {
  background: var(--bg-gray, #f3f4f6);
  color: var(--text-primary, #1a1a2e);
}

.footprint-selected-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--green-light, #dcfce7);
  border-top: 1px solid #bbf7d0;
  font-size: 13px;
  color: var(--text-primary, #1a1a2e);
}

.footprint-selected-label {
  font-weight: 700;
  color: var(--green, #16a34a);
}

.footprint-selected-source {
  color: var(--text-secondary, #6b7280);
  font-size: 11px;
}

.footprint-confirm-btn {
  margin-left: auto;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  background: var(--green, #16a34a);
  border: none;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.15s;
}

.footprint-confirm-btn:hover {
  background: #15803d;
}
