/* =========================
   Light UI - Water Footprint
   (FULL CSS - updated)
   ========================= */

:root{
  --bg: #f8fafc;           /* slate-50 */
  --bg2: #eef2ff;          /* indigo-50 */
  --card: #ffffff;

  --text: #0f172a;         /* slate-900 */
  --muted: #475569;        /* slate-600 */
  --muted2: #64748b;       /* slate-500 */

  --border: rgba(15, 23, 42, .10);

  --accent: #7c3aed;       /* violet-600 */
  --accent2: #06b6d4;      /* cyan-500 */

  --shadow: 0 18px 55px rgba(15, 23, 42, .10);
  --shadow2: 0 12px 30px rgba(15, 23, 42, .08);

  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 12px;

  --gap: 14px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);

  /* Más claro y suave, sin sentirse oscuro */
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(124,58,237,.10), transparent 58%),
    radial-gradient(760px 480px at 88% 10%, rgba(6,182,212,.08), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));

  padding: 26px 14px 60px;
}

/* ===== Main card ===== */
.card{
  width: min(980px, 100%);
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ===== Header ===== */
.header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

#title{
  margin: 0;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 900;
}

#subtitle{
  margin: 8px 0 0;
  max-width: 66ch;
  color: var(--muted);
  font-size: 14.5px;
}

/* ===== Language switch ===== */
.lang-switch{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  backdrop-filter: blur(8px);
}

.lang-switch label{
  font-size: 12px;
  color: var(--muted2);
  margin: 0;
  font-weight: 800;
}

/* ===== Sections ===== */
section{ padding: 18px 22px; }
section + section{ border-top: 1px solid rgba(15, 23, 42, .06); }

/* Cards / Boxes */
.result-box{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow2);
  padding: 16px;
}

/* Caja principal de resultados (Total + gráfica) con un toque “dashboard” */
.result .result-box:first-child{
  background:
    radial-gradient(700px 220px at 20% 20%, rgba(124,58,237,.08), transparent 60%),
    radial-gradient(700px 220px at 90% 10%, rgba(6,182,212,.06), transparent 60%),
    rgba(255,255,255,.96);
  border: 1px solid rgba(15, 23, 42, .10);
}

/* Titles */
.result-title{
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: #0b1220;
}

.muted{ color: var(--muted); }
.small{ font-size: 12.5px; }

/* ===== Grid & Fields ===== */
.grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: var(--gap);
}

.field{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(15, 23, 42, .10);
  background: rgba(255,255,255,.92);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.field:hover{
  transform: translateY(-1px);
  border-color: rgba(124,58,237,.25);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .10);
}

label{
  font-size: 13px;
  color: #0f172a;
  font-weight: 850;
  letter-spacing: -0.01em;
}

/* Inputs */
input, select{
  width: 100%;
  border: 1px solid rgba(15, 23, 42, .16);
  background: rgba(255,255,255,.98);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
  transition: border .15s ease, box-shadow .15s ease, transform .15s ease;
}

/* prettier select arrow */
select{
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(15,23,42,.65) 50%),
    linear-gradient(135deg, rgba(15,23,42,.65) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 1px),
    calc(100% - 12px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input:focus, select:focus{
  border-color: rgba(124,58,237,.70);
  box-shadow: 0 0 0 4px rgba(124,58,237,.16);
  transform: translateY(-1px);
}

small{
  color: var(--muted2);
  line-height: 1.25;
}

/* ===== Results ===== */
.result{
  padding-top: 0;
}

.result-value{
  margin-top: 6px;
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  /* brillo sutil */
  text-shadow: 0 8px 30px rgba(124,58,237,.10);
}

#breakdown{
  margin-top: 10px;
  line-height: 1.6;
  color: var(--muted);
}

/* ===== Chart ===== */
.chart-wrap{
  margin-top: 12px;
  display: flex;
  justify-content: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(248,250,252,.90);
  border: 1px solid rgba(15,23,42,.08);
}

#wfChart{
  max-width: 100%;
  height: auto;
}

/* ===== Buttons ===== */
.actions{
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

button{
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 12px 28px rgba(124,58,237,.18);
  transition: transform .15s ease, filter .15s ease;
}

button:hover{
  transform: translateY(-1px);
  filter: brightness(1.02);
}

button.secondary{
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .14);
  box-shadow: 0 10px 22px rgba(15,23,42,.07);
}

/* ===== Responsive ===== */
@media (max-width: 820px){
  .header{ flex-direction: column; align-items: stretch; }
  .lang-switch{ justify-content: space-between; }
}

@media (max-width: 640px){
  body{ padding: 14px 10px 50px; }
  section{ padding: 14px; }
  .grid{ grid-template-columns: 1fr; }
  .actions{ flex-direction: column; }
  button{ width: 100%; }
}
