/* Identidad visual basada en candinagroup.com:
   marino #213559 (acento) · tinta #0E1317 · texto #6D7A8E · superficies #F3F3F5 */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --marino: #213559;
  --marino-oscuro: #182843;
  --marino-suave: #2e4570;
  --tinta: #0e1317;
  --texto: #26303d;
  --gris: #6d7a8e;
  --superficie: #f3f3f5;
  --tarjeta: #ffffff;
  --borde: #e2e5ea;
  --verde: #2e7d4f;
  --rojo: #b3423a;
  --ambar: #8a6d1f;
  --sombra: 0 1px 2px rgba(33, 53, 89, 0.06), 0 8px 24px -12px rgba(33, 53, 89, 0.18);
  --radio: 12px;
}

body {
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--superficie);
  color: var(--texto);
  min-height: 100dvh;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: "Poppins", "Open Sans", system-ui, sans-serif;
  color: var(--tinta);
  letter-spacing: -0.015em;
  line-height: 1.25;
  text-wrap: balance;
}

/* --- Cabecera --- */

header.barra {
  background: var(--marino);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  box-shadow: 0 2px 12px rgba(14, 19, 23, 0.25);
}

.marca-cabecera { display: flex; align-items: center; gap: 0.7rem; }
.marca-cabecera img { height: 42px; width: 42px; }
.marca-cabecera .titulo {
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}
.marca-cabecera .subtitulo {
  display: block;
  font-family: "Open Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: #aebad0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

header.barra nav { display: flex; gap: 1.1rem; align-items: center; font-size: 0.9rem; }
header.barra nav .usuario { color: #aebad0; }
header.barra a {
  color: #d5deee;
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
header.barra a:hover { color: #fff; }
header.barra a.activo { color: #fff; border-bottom-color: #fff; }

main { max-width: 840px; margin: 2.5rem auto 3.5rem; padding: 0 1.25rem; }

.encabezado-pagina { margin-bottom: 1.5rem; }
.encabezado-pagina h2 { font-size: 1.45rem; }
.encabezado-pagina p { color: var(--gris); max-width: 62ch; margin-top: 0.35rem; }

/* --- Tarjetas --- */

.tarjeta {
  background: var(--tarjeta);
  border-radius: var(--radio);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--sombra);
}

.tarjeta h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }

/* --- Formularios --- */

label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--tinta);
  margin: 1.1rem 0 0.35rem;
}
label .opcional { font-weight: 400; color: var(--gris); }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  font: inherit;
  color: var(--texto);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:hover, textarea:hover { border-color: #c3cad6; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--marino);
  box-shadow: 0 0 0 3px rgba(33, 53, 89, 0.15);
}
input::placeholder, textarea::placeholder { color: #a3adbd; }
textarea { resize: vertical; min-height: 92px; }

input[type="file"] { font-size: 0.9rem; color: var(--gris); margin-top: 0.2rem; }
input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--marino);
  background: #eef1f6;
  border: 1px solid var(--borde);
  border-radius: 7px;
  padding: 0.45rem 0.9rem;
  margin-right: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
input[type="file"]::file-selector-button:hover { background: #e3e8f0; }

/* --- Botones --- */

.boton {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--marino);
  color: #fff;
  margin-top: 1.3rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(14, 19, 23, 0.15);
}

.boton:hover { background: var(--marino-suave); box-shadow: 0 3px 10px -2px rgba(33, 53, 89, 0.4); }
.boton:active { transform: scale(0.98); }
.boton:focus-visible { outline: 3px solid rgba(33, 53, 89, 0.35); outline-offset: 2px; }

.boton.verde { background: var(--verde); }
.boton.verde:hover { background: #35915c; }
.boton.rojo { background: var(--rojo); }
.boton.rojo:hover { background: #c25049; }
.boton.gris { background: #5d6c81; }
.boton.gris:hover { background: #6b7b92; }
.boton.pequeno { padding: 0.45rem 1rem; font-size: 0.88rem; margin-top: 0.5rem; }

/* --- Avisos y etiquetas --- */

.aviso, .fallo {
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 0.93rem;
}
.aviso { background: #e8f3ec; color: #1e5637; border: 1px solid #c5e0d0; }
.fallo { background: #f9eae9; color: #7e2d27; border: 1px solid #ecc8c5; }

.etiqueta {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.65rem;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.etiqueta.pendiente { background: #f5edd7; color: var(--ambar); }
.etiqueta.publicado { background: #e2f0e8; color: var(--verde); }
.etiqueta.rechazado { background: #e9ecf1; color: var(--gris); }
.etiqueta.error { background: #f9e7e5; color: var(--rojo); }

.meta { color: var(--gris); font-size: 0.85rem; margin-bottom: 0.6rem; }
.datos-post { font-size: 0.9rem; color: var(--gris); margin-bottom: 0.8rem; }
.datos-post strong { color: var(--texto); font-weight: 600; }

.previsualizacion {
  white-space: pre-wrap;
  background: #f7f8fa;
  border: 1px solid var(--borde);
  border-left: 3px solid var(--marino);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-top: 1rem;
}

img.miniatura {
  max-width: 230px;
  max-height: 160px;
  border-radius: 8px;
  display: block;
  margin: 0.6rem 0;
  box-shadow: var(--sombra);
}

.acciones { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.acciones form { display: inline; }

/* --- Tabla de historial --- */

table.historial {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
table.historial th, table.historial td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--borde);
  vertical-align: top;
}
table.historial tr:last-child td { border-bottom: 0; }
table.historial th {
  color: var(--gris);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.historial tbody tr { transition: background 0.15s ease; }
table.historial tbody tr:hover { background: #f7f8fa; }

.vacio {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--gris);
}
.vacio img { height: 64px; width: 64px; opacity: 0.35; margin-bottom: 0.8rem; }

/* --- Página de acceso --- */

body.acceso {
  background:
    linear-gradient(160deg, rgba(14, 19, 23, 0.82) 0%, rgba(33, 53, 89, 0.78) 55%, rgba(3, 25, 85, 0.72) 100%),
    url("/marca/fondo-barco.jpg") center / cover no-repeat fixed;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.panel-acceso { width: 100%; max-width: 400px; }
.panel-acceso .logo-grande { display: block; height: 96px; width: 96px; margin: 0 auto 1.2rem; }
.panel-acceso .lema {
  text-align: center;
  color: #d5deee;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}
.panel-acceso .tarjeta { padding: 2rem; }
.panel-acceso h2 { font-size: 1.15rem; }
.panel-acceso .boton { width: 100%; }
.panel-acceso .pie {
  text-align: center;
  color: #93a3c0;
  font-size: 0.78rem;
  margin-top: 1.4rem;
}

/* --- Pie de página --- */

footer.pie-portal {
  text-align: center;
  color: var(--gris);
  font-size: 0.8rem;
  padding: 0 1rem 2rem;
}

@media (max-width: 640px) {
  main { margin-top: 1.5rem; }
  .tarjeta { padding: 1.25rem; }
  header.barra { padding: 0.7rem 1rem; }
  .marca-cabecera .subtitulo { display: none; }
}
