/* ════════════════════════════════════════
   ContaDeLuzJusta — Global Styles
   ════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --yellow: #F5A623;
  --orange: #E8720C;
  --blue-dark: #1A3C5E;
  --blue-medium: #2A5A8A;
  --white: #FFFFFF;
  --gray-light: #F7F7F7;
  --gray-text: #6B7280;
  --green: #27AE60;
  --red: #E74C3C;
  --whatsapp: #25D366;
  --gradient-btn: linear-gradient(135deg, var(--yellow), var(--orange));
  --gradient-bg: linear-gradient(160deg, #0F2A47 0%, #1A3C5E 40%, #2A5A8A 100%);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.18);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.28);
  --radius-card: 16px;
  --radius-btn: 50px;
  --max-width: 480px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--gradient-bg);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Page Wrapper ── */
.page-wrapper {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 20px 40px;
  margin: 0 auto;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Logo ── */
.logo {
  text-align: center;
  padding: 24px 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  user-select: none;
}

.logo span {
  background: var(--gradient-btn);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo .bolt {
  font-size: 1.5rem;
  margin-right: 4px;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 0 8px rgba(245, 166, 35, 0.6));
}

/* ── Progress Bar ── */
.progress-container {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 20px;
  margin-bottom: 24px;
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
  text-align: center;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-btn);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Section Titles ── */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  text-align: center;
}

.section-subtitle {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ── Cards ── */
.card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card-main {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  border: none;
}

/* ── Selection Cards ── */
.selection-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.sel-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.sel-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(232, 114, 12, 0.05));
  opacity: 0;
  transition: opacity 0.3s;
}

.sel-card:hover {
  border-color: rgba(245, 166, 35, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.sel-card:hover::before {
  opacity: 1;
}

.sel-card.selected {
  border-color: var(--yellow);
  background: rgba(245, 166, 35, 0.12);
  box-shadow: 0 0 0 1px var(--yellow), var(--shadow-card);
}

.sel-card.selected::before {
  opacity: 1;
}

.sel-card .icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.sel-card .text h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.sel-card .text p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

.sel-card .check {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 1.1rem;
  color: var(--yellow);
  opacity: 0;
  transition: opacity 0.3s;
}

.sel-card.selected .check {
  opacity: 1;
}

/* ── Form Inputs ── */
.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.85);
}

.form-group label .required {
  color: var(--yellow);
  margin-left: 2px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 1rem;
  transition: color 0.3s;
  z-index: 1;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--yellow);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.input-wrapper input:focus + i,
.input-wrapper input:focus ~ i {
  color: var(--yellow);
}

.input-wrapper .suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  font-weight: 500;
}

.input-error {
  border-color: var(--red) !important;
}

.error-msg {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 4px;
  display: none;
}

.error-msg.show {
  display: block;
}

.input-info {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-height: 52px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-btn);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245, 166, 35, 0.5);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  font-size: 0.95rem;
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-card);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: rgba(255, 255, 255, 0.03);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--yellow);
  background: rgba(245, 166, 35, 0.06);
}

.upload-zone .upload-icon {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 16px;
  transition: var(--transition);
}

.upload-zone:hover .upload-icon {
  color: var(--yellow);
  transform: translateY(-4px);
}

.upload-zone .upload-text {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.upload-zone .upload-subtext {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

.upload-preview {
  display: none;
  margin-top: 20px;
  padding: 16px;
  background: rgba(39, 174, 96, 0.1);
  border: 1px solid rgba(39, 174, 96, 0.3);
  border-radius: 12px;
  text-align: center;
}

.upload-preview.show {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

.upload-preview img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.upload-preview .file-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 500;
}

.upload-preview .file-info i {
  font-size: 1.1rem;
}

/* ── Security Text ── */
.security-text {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 16px;
}

.security-text i {
  margin-right: 4px;
}

.skip-link {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 12px;
  text-decoration: none;
  transition: color 0.3s;
}

.skip-link:hover {
  color: var(--yellow);
}

/* ── Tooltip ── */
.help-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--yellow);
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 20px;
  transition: opacity 0.3s;
}

.help-link:hover {
  opacity: 0.8;
}

.tooltip-box {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 16px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.3s ease-out;
}

.tooltip-box.show {
  display: block;
}

/* ── Result Page ── */
.result-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 20px;
}

.result-loading .calc-icon {
  font-size: 3.5rem;
  color: var(--yellow);
  animation: spin 1.5s linear infinite;
}

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

.result-loading p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.result-content {
  display: none;
}

.result-content.show {
  display: block;
  animation: fadeInUp 0.6s ease-out;
}

.kwh-card {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  border-radius: var(--radius-card);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.kwh-card .kwh-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-text);
  margin-bottom: 4px;
}

.kwh-card .kwh-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 8px 0;
}

.kwh-card .kwh-value.green { color: var(--green); }
.kwh-card .kwh-value.red { color: var(--red); }

.kwh-card .kwh-status {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 50px;
  display: inline-block;
  margin-top: 8px;
}

.kwh-card .kwh-status.green {
  background: rgba(39, 174, 96, 0.12);
  color: var(--green);
}

.kwh-card .kwh-status.red {
  background: rgba(231, 76, 60, 0.12);
  color: var(--red);
}

.recommendation {
  font-size: 0.85rem;
  color: #555;
  margin-top: 12px;
  line-height: 1.5;
}

/* ── Accordion ── */
.accordion {
  margin-bottom: 20px;
}

.accordion-header {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.12);
}

.accordion-header i.chevron {
  transition: transform 0.3s;
}

.accordion-header.open i.chevron {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 16px 20px;
}

.accordion-body.open {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row .label {
  color: rgba(255, 255, 255, 0.55);
}

.summary-row .value {
  font-weight: 600;
  color: var(--white);
}

/* ── Opportunity Page ── */
.opp-card {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  border-radius: var(--radius-card);
  padding: 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.opp-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.opp-card .benefit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.opp-card .benefit i {
  color: var(--green);
  margin-top: 3px;
  flex-shrink: 0;
}

.chart-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-card);
  padding: 24px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.chart-container h3 {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: #1a1a2e;
  margin-bottom: 16px;
}

.economy-summary {
  text-align: center;
  padding: 16px 0 0;
}

.economy-summary .eco-row {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.economy-summary .eco-row span {
  color: var(--green);
}

.disclaimer-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.disclaimer-card p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.6;
}

.cta-extras {
  text-align: center;
  margin-top: 12px;
}

.cta-extras p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
}

.cta-extras p i {
  margin-right: 4px;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-dark {
  border-color: rgba(0, 0, 0, 0.15);
  border-top-color: var(--orange);
}

/* ── Toast / Alert ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--green);
  color: var(--white);
}

.toast.error {
  background: var(--orange);
  color: var(--white);
}

/* ── Footer ── */
.page-footer {
  text-align: center;
  padding: 32px 20px 24px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
  width: 100%;
  max-width: var(--max-width);
}

/* ── Pulse animation ── */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ── Hero icon ── */
.hero-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(245, 166, 35, 0.5));
}

/* ── Responsive ── */
@media (min-width: 600px) {
  .page-wrapper {
    padding: 0 24px 48px;
  }

  .section-title {
    font-size: 1.7rem;
  }
}

@media (max-width: 360px) {
  .section-title {
    font-size: 1.25rem;
  }
  
  .sel-card {
    padding: 16px 14px;
  }
  
  .kwh-card .kwh-value {
    font-size: 2rem;
  }
}
