/* ═══════════════════════════════════════════════════════════
   tareas-trabajo.net — stylo.css v2
   Paleta: papiro + slate + azul profesional + acento ámbar
   Tipografía: Fraunces (display) + DM Sans (UI)
   ═══════════════════════════════════════════════════════════ */

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

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --paper:   #f7f4ee;       /* papiro base */
  --paper2:  #efeae0;       /* papiro sombra */
  --ink:     #1e2535;       /* tinta oscura */
  --slate:   #3a4a5c;       /* azul gris funcional */
  --slate2:  #546880;       /* slate medio */
  --blue:    #2e6da4;       /* azul profesional */
  --blue2:   #1a4f7a;       /* azul hover */
  --blueL:   #ddeaf7;       /* azul claro fondo */
  --amber:   #c8860a;       /* ámbar acento */
  --amberL:  #fdf3dc;       /* ámbar fondo */
  --green:   #1e7a56;       /* estado ok */
  --red:     #9b2b2b;       /* estado error */
  --border:  #d0cbbf;       /* borde papiro */
  --borderB: #b8cfe0;       /* borde azul */
  --shadow:  0 2px 12px rgba(30,37,53,0.10);
  --shadowM: 0 4px 24px rgba(30,37,53,0.15);
  --r:       8px;
  --rL:      14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(46,109,164,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(200,134,10,0.05) 0%, transparent 50%);
  background-attachment: fixed;
  opacity: 1 !important;
}

/* ── TIPOGRAFÍA ──────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; font-weight: 600; font-family: 'DM Sans', sans-serif; }
p  { margin-bottom: 0.6em; }

ul { margin: 0.6em 0 0.6em 1.4em; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue2); text-decoration: underline; }

/* ── LAYOUT ──────────────────────────────────────────────── */
header, section, footer {
  width: 96% !important;
  margin: 0 auto !important;
}

/* Override del div global que tenía background azulado */
div { background-color: transparent; margin: 0; }

/* ── HEADER ──────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--slate) 0%, var(--blue2) 60%, var(--slate) 100%) !important;
  border-radius: 0 0 var(--rL) var(--rL);
  box-shadow: var(--shadowM);
  padding: 1.2em 1.5em;
  margin-bottom: 1.5em !important;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
header h1 {
  color: white !important;
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
header h3, header h4 {
  color: rgba(255,255,255,0.85) !important;
}
header a { color: white !important; text-decoration: none; }

/* ── SECCIÓN PRINCIPAL ───────────────────────────────────── */
section {
  background-color: white !important;
  border-radius: var(--rL);
  box-shadow: var(--shadow);
  padding: 1.5em !important;
  margin-bottom: 1.5em !important;
}

/* ── ACCESO / FORMULARIOS ────────────────────────────────── */
#formuAcceso {
  background-image: url('office.png');
  background-position: top right;
  background-repeat: no-repeat;
  background-size: contain;
  background-color: transparent;
  padding: 1em;
  border-radius: var(--r);
}

#formIdent {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--rL);
  padding: 1.5em;
  margin: 1em 0;
}

/* ── PANELES COLOREADOS ──────────────────────────────────── */
#formuAcceso h3 {
  font-family: 'Fraunces', serif;
  color: var(--slate);
  border-bottom: 2px solid var(--borderB);
  padding-bottom: 0.4em;
  margin-bottom: 0.8em;
}

/* Panel interno (el cuadro "panel" con botones de acción) */
#formuAcceso > div[style*="box-shadow"] {
  background: var(--blueL) !important;
  border: 1px solid var(--borderB) !important;
  border-radius: var(--r) !important;
  padding: 0.8em !important;
  margin: 0.6em 0 !important;
}

/* ── INPUTS ──────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.45em 0.7em;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: white;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: auto;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,109,164,0.12);
}

/* ── BOTONES ─────────────────────────────────────────────── */
button {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0.3em;
  padding: 0.45em 1.1em;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--r);
  box-shadow: 0 2px 6px rgba(46,109,164,0.25);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.01em;
}
button:hover {
  background: var(--blue2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46,109,164,0.3);
}
button:active { transform: translateY(0); }

/* Botón primario (Tengo Tarea / Yo Me Encargo) */
#deman1, #ofer1 {
  font-size: 1.1rem !important;
  padding: 0.6em 1.6em !important;
  border-radius: 10px !important;
}
#deman1 { background: var(--blue) !important; }
#ofer1  { background: var(--green) !important; box-shadow: 0 2px 6px rgba(30,122,86,0.25) !important; }
#ofer1:hover { background: #155e3e !important; }

/* ── TABLAS ──────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; }
tr    { border-bottom: 1px solid var(--border); }
tr:hover { background: rgba(46,109,164,0.04); }
thead {
  background: var(--slate);
  color: white;
}
thead td, thead th {
  padding: 0.5em 0.8em;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
tbody td { padding: 0.45em 0.8em; font-size: 0.9rem; }

/* Tabla del presupuesto */
#pres1 { overflow: auto; max-width: 100%; }
#pres1 fieldset {
  border: 1.5px solid var(--borderB);
  border-radius: var(--r);
  padding: 1em;
  background: white;
}
#pres1 legend {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--slate);
  padding: 0 0.5em;
}
#pres2 tr:nth-child(even) { background: var(--blueL); }

/* ── SECCIONES INTERNAS ──────────────────────────────────── */
#publicarDemanda,
#publicarOferta,
#consultarDemandas,
#consultarOfertas {
  background: var(--paper) !important;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1em;
  margin: 0.5em 0;
}

#publicarDemanda h3,
#publicarOferta h3,
#consultarDemandas h3,
#consultarOfertas h3 {
  color: var(--slate);
  border-bottom: 2px solid var(--borderB);
  padding-bottom: 0.4em;
  margin-bottom: 0.8em;
}

/* Panel de búsqueda demandas */
#consultarDemandas,
#consultarOfertas {
  height: 380px;
  padding: 0 !important;
}
#busqueda {
  background: var(--blueL) !important;
  padding: 0.6em !important;
  border-radius: var(--r) var(--r) 0 0;
  border-bottom: 1px solid var(--borderB);
}
#resulDem, #resulOfer {
  background: white !important;
  border-radius: 0 0 var(--r) var(--r);
}
#detalleDem, #detalleOfer {
  background: white !important;
  border-left: 1px solid var(--border);
}

/* ── FIELDSETS ───────────────────────────────────────────── */
fieldset {
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 1em;
  margin: 0.8em 0;
  background: white;
}
legend {
  font-weight: 600;
  color: var(--slate);
  padding: 0 0.5em;
  font-size: 0.9rem;
}

/* ── MENSAJES ────────────────────────────────────────────── */
#mensajeAccion {
  overflow: auto;
  background: var(--amberL) !important;
  border: 1px solid rgba(200,134,10,0.25);
  border-radius: var(--r);
  padding: 0.8em 1em;
  margin: 0.6em 0;
  font-size: 0.9rem;
  color: var(--slate);
}
#mensajeAcceso,
#mensajeReg {
  background: transparent !important;
  font-size: 0.88rem;
  color: var(--slate2);
  padding: 0.3em 0;
}

/* ── MODAL ESTADO ────────────────────────────────────────── */
#estado11 {
  position: fixed;
  display: none;
  z-index: 1100;
  width: 420px;
  max-width: 90vw;
  height: auto;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 1.5px solid var(--borderB);
  border-radius: var(--rL);
  box-shadow: 0 12px 40px rgba(30,37,53,0.2);
  padding: 1.5em;
}
#estado11 h4 {
  color: var(--slate);
  margin-bottom: 1em;
  font-size: 0.9rem;
  line-height: 1.5;
}
#estado11 > input { margin-left: 5%; display: block; margin-bottom: 0.4em; }

/* ── COVER (aviso primera visita) ────────────────────────── */
#cover {
  display: inline-block;
  position: fixed;
  z-index: 1000;
  color: white;
  font-weight: bold;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(30,37,53,0.88);
  backdrop-filter: blur(6px);
  line-height: 100%;
}
#cover span {
  background: white !important;
  color: var(--ink) !important;
  border-radius: var(--rL);
  padding: 2em 2.5em;
  display: inline-block;
  position: relative;
  width: auto !important;
  margin-top: 15%;
  box-shadow: var(--shadowM);
  line-height: 1.8;
  text-align: center;
}
#cover button {
  margin-top: 1em;
  background: var(--blue);
  font-size: 1rem;
  padding: 0.5em 2em;
}

/* ── 10 ENCARGOS / INSCRITOS ─────────────────────────────── */
#10encargos, #10ofertantes {
  background: transparent !important;
  margin: 0.5em 0 !important;
}
#10encargos table,
#10ofertantes table {
  background: white;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}
#10encargos thead,
#10ofertantes thead {
  background: linear-gradient(90deg, var(--slate), var(--slate2));
}

/* ── ENCUESTA ────────────────────────────────────────────── */
#encuesta {
  background: var(--amberL) !important;
  border: 1px solid rgba(200,134,10,0.2);
  border-radius: var(--rL);
  padding: 1.2em !important;
  margin: 1em 0 !important;
}
#encuesta h3 {
  color: var(--amber);
  font-family: 'Fraunces', serif;
}
#encuesta fieldset {
  background: transparent;
  border-color: rgba(200,134,10,0.25);
}

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--slate) !important;
  color: rgba(255,255,255,0.7);
  border-radius: var(--rL) var(--rL) 0 0;
  margin-top: 2em !important;
  padding: 2em !important;
  columns: 240px 4;
  font-size: 0.82rem;
  line-height: 1.8;
}
footer a { color: rgba(255,255,255,0.75); }
footer a:hover { color: var(--amber); text-decoration: none; }
footer h3 { color: white; font-family: 'Fraunces', serif; font-size: 1rem; margin: 0.8em 0 0.3em; }

/* ── UTILIDADES ──────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.8em 0;
}

/* Copy-launch icon */
.crossed { transform: rotate(135deg); cursor: copy; display: inline-block; position: relative; }
.crossed:before {
  content: ''; position: absolute; top: 47%; left: -23%;
  width: 147%; height: 2%; background-color: var(--slate);
}
.crossed:hover:before { left: -223%; }

/* Hover de filas de ofertas/demandas */
.act:hover { cursor: pointer; background: var(--amberL) !important; }

/* ── PANEL CATÁLOGO (addon) ──────────────────────────────── */
#panelCatalogo {
  background: var(--blueL) !important;
  border: 1.5px solid var(--borderB) !important;
  border-radius: var(--rL) !important;
  padding: 1.2em !important;
  margin: 1em 0 !important;
}
#panelCatalogo h3 {
  color: var(--slate);
  font-family: 'Fraunces', serif;
}
#listaCatalogo table thead { background: var(--slate2); }

/* ── ANIMACIÓN ENTRADA ───────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
section, #formIdent, #panelCatalogo {
  animation: fadeIn 0.35s ease both;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media screen and (max-width: 640px) {
  body { font-size: 14px; }
  header { border-radius: 0 !important; padding: 0.8em 1em; }
  header h1 { font-size: 1.4rem; }
  section { padding: 1em !important; border-radius: var(--r) !important; }
  button { font-size: 0.85rem; padding: 0.4em 0.8em; margin: 0.2em; }

  #consultarDemandas,
  #consultarOfertas {
    height: 760px;
    overflow: auto;
    border: 2px solid var(--borderB) !important;
  }
  #busqueda { min-height: 8em; }
  #pres1 { overflow: auto; min-height: 3em; max-width: 100%; margin: 0 !important; }

  .crossed { width: 12px !important; height: 12px !important; margin: 5px; }
  .crossed:before { content: ''; position: relative; top: 4px; left: -7px; width: 17px; height: 1px; background-color: var(--ink); }

  /* Forzar layout lineal en móvil */
  :not(td):not(th):not(tr):not(thead):not(tbody):not(table) {
    /* solo aplica a contenedores flex/grid si los hay */
  }
}

@media screen and (max-width: 421px) {
  header > h1, h3, h4 { display: inline-block; width: initial !important; }
  header > span { display: inline-block; width: initial !important; }
}
