/* =============================================================================
   NUTRITUPP · /perfil — mi cuenta
   -----------------------------------------------------------------------------
   Hereda los tokens de sistema.css y planificador.css (crema, teal, verde,
   campos, botones). Aquí solo va lo propio de la página.
   ========================================================================== */

.perfil {
  max-width: 46rem;
  margin: 0 auto;
  padding: 24px 16px 72px;
  background: var(--papel-fondo, #f6f2ed);
  color: var(--titulo, #161915);
  font-family: var(--tipo-texto, system-ui), sans-serif;
}

.perfil__cab { text-align: center; padding: 8px 0 22px; }
.perfil__eyebrow {
  margin: 0 0 8px; font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--verde-osc, #3a7026);
}
.perfil h1 {
  margin: 0 0 10px; font-family: var(--tipo, inherit);
  font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); line-height: 1.08; letter-spacing: -.02em;
}
.perfil__intro { margin: 0 auto; max-width: 34rem; color: var(--texto, #556354); line-height: 1.55; }
.perfil__nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin: 16px 0 0; }
.perfil__nav a { color: var(--teal, #145961); font-weight: 600; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.perfil__nav a:hover { text-decoration: underline; }

.perfil__entrar,
.perfil__caja {
  background: var(--papel, #fff);
  border: 1px solid var(--linea, #dcd2c4);
  border-radius: 14px;
  padding: 20px;
  margin: 0 0 16px;
}
.perfil__entrar h2,
.perfil__caja h2 { margin: 0 0 6px; font-family: var(--tipo, inherit); font-size: 1.15rem; }
.perfil__ayuda { margin: 0 0 14px; color: var(--texto, #556354); font-size: .92rem; line-height: 1.5; }
.perfil__ayuda a { color: var(--teal, #145961); }
.perfil__acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; }
.perfil__acciones--pie { justify-content: center; margin-top: 24px; }
.perfil__ok { color: var(--verde-osc, #3a7026); font-weight: 700; font-size: .9rem; }

/* --- Invita a un amigo ---------------------------------------------------- */
.perfil__caja--refe { border-color: var(--verde, #74b74e); }
.refe__codigo {
  margin: 4px 0 8px;
  font-family: var(--tipo, inherit);
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); font-weight: 800; letter-spacing: .06em;
  color: var(--teal, #145961);
}
.refe__enlace {
  margin: 0 0 4px; padding: 10px 12px;
  background: var(--papel-fondo, #f6f2ed); border-radius: 8px;
  font-size: .88rem; color: var(--texto, #556354); word-break: break-all;
}
.refe__estado { margin: 14px 0 0; font-size: .92rem; color: var(--texto, #556354); line-height: 1.5; }
#refeWasap { text-decoration: none; display: inline-flex; align-items: center; }

/* --- Mis pedidos ---------------------------------------------------------- */
.ped {
  padding: 12px 0;
  border-top: 1px solid var(--linea-fina, #ece6dc);
}
.ped:first-child { border-top: 0; padding-top: 0; }
.ped__alto { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ped__fecha { font-size: .84rem; color: var(--texto, #556354); }
.ped__estado {
  font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--crema-honda, #e5dcd0); color: var(--titulo, #161915);
}
.ped__estado[data-e="ok"] { background: #e6f1dc; color: #3a7026; }
.ped__estado[data-e="no"] { background: #f7e3e3; color: #a82c2c; }
.ped__platos { margin: 6px 0 2px; font-weight: 600; line-height: 1.35; }
.ped__pie { margin: 0; font-size: .88rem; color: var(--texto, #556354); font-variant-numeric: tabular-nums; }
.ped__pie b { color: var(--teal, #145961); font-size: 1rem; }

@media (max-width: 480px) {
  .perfil__acciones .btn-fuerte, .perfil__acciones .btn-simple { flex: 1 1 100%; justify-content: center; }
}

/* --- MI PLAN: anillos, tira de días y gráfica --------------------------------
   Andrés, 09-09: «no se parece en nada a un dashboard de kalorias ni planning
   con graficas, ruedecitas como apple watch». Esto es esa pantalla.

   TRES COLORES Y NO MÁS, y cada uno significa siempre lo mismo en toda la
   página: teal = calorías, verde = proteína, ámbar = hidratos. El ámbar
   (#C87F2E) es el único color nuevo del sistema; se eligió tostado en vez de
   amarillo porque sobre crema un amarillo saturado se pierde y además chocaba
   con el verde de la marca. La grasa y la fibra NO tienen anillo a propósito:
   tres aros es lo que se lee de un vistazo, el cuarto ya es ruido.

   Las cifras van todas en tabular-nums: si no, al cambiar de día bailan. */
.perfil__caja--plan { padding-bottom: 18px; }

.plan__cab {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.plan__titulo { flex: 1 1 16rem; min-width: 0; }
.plan__titulo h2 { margin-bottom: 4px; }
.plan__titulo .perfil__ayuda { margin-bottom: 0; }
.plan__ajuste {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: 999px;
  background: var(--crema-honda, #e5dcd0); border: 1.5px solid transparent;
  color: var(--titulo, #161915); font: inherit; font-size: .86rem; font-weight: 700;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.plan__ajuste:hover { border-color: var(--teal, #145961); background: #fff; }
.plan__ajuste:focus-visible { outline: 3px solid var(--teal, #145961); outline-offset: 2px; }

/* Sin objetivo no se pintan anillos vacíos: se pide la meta. */
.plan__pedir {
  margin: 16px 0 4px; padding: 18px;
  border: 1.5px dashed #d8cfc2; border-radius: 12px;
  background: var(--papel-fondo, #f6f2ed);
}
.plan__pedir p { margin: 0 0 8px; line-height: 1.5; }
.plan__pedir .perfil__ayuda { margin-bottom: 14px; }

/* --- El día: anillos + cifras --------------------------------------------- */
.plan__dia {
  display: grid; gap: 18px 24px; align-items: center;
  grid-template-columns: 236px minmax(0, 1fr);
  margin: 20px 0 6px;
}
.plan__anillos { display: flex; justify-content: center; }
.anillos { width: 100%; max-width: 236px; height: auto; display: block; }
.anillos__fondo circle { fill: none; stroke: var(--crema-honda, #e5dcd0); stroke-width: 15; }
.anillos__valor circle {
  fill: none; stroke-width: 15; stroke-linecap: round;
  transition: stroke-dashoffset .7s cubic-bezier(.22, 1, .36, 1);
}
.anillos__valor circle[data-anillo="kcal"] { stroke: var(--teal, #145961); }
.anillos__valor circle[data-anillo="prot"] { stroke: var(--verde, #74b74e); }
.anillos__valor circle[data-anillo="hid"]  { stroke: #c87f2e; }

.plan__cuando {
  margin: 0 0 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--linea-fina, #ece6dc);
  font-size: .95rem; color: var(--texto, #556354);
}
.plan__cuando b { color: var(--titulo, #161915); text-transform: none; }

.cifras { list-style: none; margin: 0; padding: 0; }
.cifra {
  display: grid; align-items: baseline; gap: 0 8px;
  grid-template-columns: 10px 5.5rem auto minmax(0, 1fr) 3.4rem;
  padding: 10px 0; border-top: 1px solid var(--linea-fina, #ece6dc);
  font-variant-numeric: tabular-nums;
}
.cifra:first-child { border-top: 0; padding-top: 0; }
.cifra__punto { width: 10px; height: 10px; border-radius: 50%; background: var(--crema-honda, #e5dcd0); }
.cifra[data-k="kcal"] .cifra__punto { background: var(--teal, #145961); }
.cifra[data-k="prot"] .cifra__punto { background: var(--verde, #74b74e); }
.cifra[data-k="hid"]  .cifra__punto { background: #c87f2e; }
.cifra__nom { font-size: .84rem; color: var(--texto, #556354); }
.cifra__val { font-weight: 800; font-size: 1.05rem; color: var(--titulo, #161915); }
.cifra__meta { font-size: .8rem; color: var(--texto, #556354); opacity: .85; }
.cifra__pct {
  justify-self: end; font-size: .82rem; font-weight: 700;
  color: var(--teal, #145961); min-width: 3.2rem; text-align: right;
}
.cifra__pct[data-pasa="si"] { color: #a8642c; }
.cifra--suelta .cifra__val { font-size: .95rem; font-weight: 700; }
.cifra--suelta .cifra__nom, .cifra--suelta .cifra__meta { opacity: .8; }

.plan__platos {
  grid-column: 1 / -1;
  margin: 0; padding: 12px 14px; border-radius: 10px;
  background: var(--papel-fondo, #f6f2ed);
  font-size: .9rem; font-weight: 600; line-height: 1.4; color: var(--titulo, #161915);
}
.plan__platos em { font-weight: 400; color: var(--texto, #556354); }

@media (max-width: 560px) {
  .plan__dia { grid-template-columns: 1fr; gap: 16px; }
  .anillos { max-width: 200px; }
  .cifra { grid-template-columns: 10px 5rem auto minmax(0, 1fr) 3.2rem; }
}

/* --- La tira de días: calendario y selector a la vez ------------------------
   Los llenos son botones que cambian los anillos; los vacíos son enlaces que
   llevan a planificar ese día. La diferencia tiene que verse sin leer: sólido
   contra contorno de puntos. El aro pequeño repite el dato de calorías en
   forma, no solo en cifra. */
.tira {
  display: grid; gap: 8px; margin: 16px 0 4px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.tira__dia {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border-radius: 12px; min-height: 96px;
  font: inherit; text-decoration: none; color: inherit; text-align: center;
  cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.tira__dia:active { transform: scale(.97); }
.tira__dia:focus-visible { outline: 3px solid var(--teal, #145961); outline-offset: 2px; }
.tira__cab { font-size: .72rem; color: var(--texto, #556354); line-height: 1.2; }
.tira__cab b { display: block; font-size: .82rem; color: var(--titulo, #161915); }
.tira__pie { font-size: .72rem; font-weight: 700; color: var(--teal, #145961); font-variant-numeric: tabular-nums; }

.tira__dia--lleno { background: #fff; border: 1.5px solid var(--crema-honda, #e5dcd0); }
.tira__dia--lleno[data-hoy="si"] { border-color: var(--verde, #74b74e); }
.tira__dia--lleno[aria-selected="true"] {
  border-color: var(--teal, #145961);
  box-shadow: 0 0 0 3px rgba(20, 89, 97, .14);
}
/* el aro chico: un donut de gradiente cónico, sin un SVG por día */
.tira__aro {
  width: 30px; height: 30px; border-radius: 50%;
  background: conic-gradient(var(--teal, #145961) calc(var(--pct, 0) * 1%), var(--crema-honda, #e5dcd0) 0);
  -webkit-mask: radial-gradient(circle, transparent 8px, #000 9px);
  mask: radial-gradient(circle, transparent 8px, #000 9px);
}
.tira__dia--vacio { border: 1.5px dashed #d8cfc2; background: transparent; justify-content: center; }
.tira__dia--vacio:hover { border-color: var(--teal, #145961); background: #fff; }
.tira__hueco { font-size: 1.5rem; font-weight: 300; color: var(--teal, #145961); line-height: 1; }
.tira__dia--vacio .tira__pie { font-weight: 600; }

@media (max-width: 560px) {
  .tira { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* --- La gráfica: diez laborables contra la línea del objetivo -------------- */
.grafica { margin: 20px 0 4px; }
.grafica figcaption {
  margin: 0 0 10px; font-size: .84rem; color: var(--texto, #556354);
  font-variant-numeric: tabular-nums;
}
.grafica figcaption b { color: var(--titulo, #161915); }
.grafica__lienzo {
  position: relative;
  display: flex; align-items: flex-end; gap: 6px;
  height: 168px; padding: 0 0 20px;
  border-bottom: 1px solid var(--linea, #dcd2c4);
}
.grafica__col {
  position: relative; flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  cursor: pointer;
}
.grafica__barra {
  width: 100%; max-width: 30px; border-radius: 5px 5px 0 0;
  background: var(--teal, #145961); opacity: .5;
  transition: opacity .15s ease, background .15s ease;
}
.grafica__barra[data-vacia="si"] {
  min-height: 3px; background: var(--crema-honda, #e5dcd0); opacity: 1;
}
.grafica__col:hover .grafica__barra { opacity: .55; }
.grafica__col--sel .grafica__barra { opacity: 1; }
.grafica__eje {
  position: absolute; bottom: -19px; left: 0; right: 0;
  font-size: .7rem; color: var(--texto, #556354);
}
/* la línea del objetivo: se lee como referencia, no como dato */
.grafica__meta {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1.5px dashed #c87f2e; pointer-events: none;
}
.grafica__meta b {
  position: absolute; right: 0; top: -8px;
  padding: 1px 6px; border-radius: 4px;
  background: #c87f2e; color: #fff; font-size: .62rem; letter-spacing: .04em; text-transform: uppercase;
}

/* --- El diálogo del objetivo ----------------------------------------------- */
.obj {
  width: min(30rem, calc(100vw - 24px));
  padding: 0; border: 0; border-radius: 16px;
  background: var(--papel, #fff); color: var(--titulo, #161915);
  box-shadow: 0 24px 60px rgba(7, 52, 57, .22);
  max-height: min(92vh, 52rem);
}
.obj__form { max-height: inherit; overflow-y: auto; overscroll-behavior: contain; }
.obj::backdrop { background: rgba(7, 52, 57, .42); }
.obj__form { padding: 22px 20px; margin: 0; }
.obj h2 { margin: 0 0 6px; font-family: var(--tipo, inherit); font-size: 1.2rem; }
.obj__nota { margin: 0 0 16px; font-size: .84rem; line-height: 1.5; color: var(--texto, #556354); }
.obj__pista { margin: -6px 0 14px; font-size: .78rem; color: var(--texto, #556354); opacity: .9; line-height: 1.45; }
/* dentro de un fieldset la pista va DESPUES de los controles, asi que el
   margen negativo la montaba encima de los botones de Sexo */
.obj__grupo .obj__pista { margin-top: 7px; margin-bottom: 0; }
.obj__grupo { margin-bottom: 14px; }
.obj__rejilla { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.obj .campo { display: block; margin: 0 0 12px; }
.obj .campo > span { display: block; margin-bottom: 5px; font-size: .82rem; font-weight: 600; color: var(--texto, #556354); }
.obj .campo input[type="number"],
.obj .campo select {
  width: 100%; min-height: 46px; padding: 8px 10px;
  border: 1.5px solid var(--linea, #dcd2c4); border-radius: 8px;
  background: #fff; color: inherit; font: inherit;
}
.obj .campo input[type="range"] { width: 100%; accent-color: var(--teal, #145961); }
.obj__grupo { margin: 0 0 12px; padding: 0; border: 0; }
.obj__grupo legend { padding: 0; margin-bottom: 5px; font-size: .82rem; font-weight: 600; color: var(--texto, #556354); }
.obj__opciones { display: flex; gap: 8px; }
.obj__opciones label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 10px; border-radius: 8px;
  border: 1.5px solid var(--linea, #dcd2c4); cursor: pointer; font-size: .9rem; font-weight: 600;
}
.obj__opciones label:has(input:checked) { border-color: var(--teal, #145961); background: #f1f5f4; }
.obj__opciones input { accent-color: var(--teal, #145961); }

.obj__salida { display: grid; gap: 10px; margin: 6px 0 4px; }
.obj__falta { font-size: .86rem; color: var(--texto, #556354); }
.obj__res { padding: 12px 14px; border-radius: 10px; background: var(--papel-fondo, #f6f2ed); }
.obj__res--comida { background: #f1f5f4; border: 1.5px solid var(--teal, #145961); }
.obj__res-cab { margin: 0 0 2px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texto, #556354); }
.obj__res-kcal {
  margin: 0; font-family: var(--tipo, inherit); font-size: 1.7rem; font-weight: 800;
  line-height: 1.1; color: var(--teal, #145961); font-variant-numeric: tabular-nums;
}
.obj__res-kcal small { font-size: .9rem; font-weight: 700; }
.obj__res-macros { margin: 2px 0 0; font-size: .84rem; color: var(--texto, #556354); font-variant-numeric: tabular-nums; }

.obj__acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 0; }
.obj__quitar {
  margin-left: auto; padding: 6px 4px;
  background: none; border: 0; font: inherit; font-size: .82rem;
  color: #a8642c; text-decoration: underline; cursor: pointer;
}
@media (max-width: 420px) {
  .obj__acciones .btn-fuerte, .obj__acciones .btn-simple { flex: 1 1 100%; justify-content: center; }
  .obj__quitar { margin: 4px auto 0; }
}

@media (prefers-reduced-motion: reduce) {
  .anillos__valor circle { transition: none; }
  .tira__dia, .grafica__barra { transition: none; }
  .tira__dia:active { transform: none; }
}

/* --- LOS BOTONES DEL PERFIL ------------------------------------------------
   .btn-fuerte y .btn-simple SOLO estaban definidos en plato.css, y perfil.html
   no lo carga. Resultado: «Guardar», «Quiero mi código», «Enviar código» y
   «Compartir por WhatsApp» salían como botones grises del navegador, y los
   enlaces con esa clase como texto subrayado. Se definen aquí, que es donde
   viven, en vez de arrastrar todo plato.css a esta página. */
.btn-fuerte, .btn-simple {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 8px;
  font: inherit; font-size: .95rem; font-weight: 700; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.btn-fuerte { background: var(--teal, #145961); color: #fff; border: 1.5px solid var(--teal, #145961); }
.btn-fuerte:hover { background: var(--teal-osc, #073439); }
.btn-simple { background: transparent; color: var(--teal, #145961); border: 1.5px solid var(--linea, #dcd2c4); }
.btn-simple:hover { border-color: var(--teal, #145961); }
.btn-fuerte:active, .btn-simple:active { transform: scale(.97); }
.btn-fuerte:focus-visible, .btn-simple:focus-visible { outline: 3px solid var(--teal, #145961); outline-offset: 2px; }
.btn-fuerte[disabled], .btn-simple[disabled] { opacity: .55; cursor: default; }
