:root {
  color-scheme: light;
  --ink: #20211f;
  --page: #f4f3ef;
  --line: #dfded7;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 7%, rgba(230, 169, 0, 0.11), transparent 24rem),
    radial-gradient(circle at 7% 28%, rgba(35, 117, 104, 0.07), transparent 25rem),
    var(--page);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 42px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.category-nav {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, auto));
  justify-content: center;
  gap: 7px;
  margin: 0 -10px 26px;
  padding: 8px;
  border: 1px solid rgba(211, 209, 201, 0.76);
  border-radius: 16px;
  background: rgba(244, 243, 239, 0.91);
  box-shadow: 0 9px 26px rgba(41, 40, 34, 0.045);
}

.category-nav a {
  --nav-color: #68717e;
  --nav-soft: #eef0f3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 108px;
  min-height: 44px;
  padding: 7px 11px 7px 8px;
  border: 1px solid #dfded8;
  border-radius: 10px;
  color: #4d4f4b;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 3px 9px rgba(42, 42, 36, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.category-icon {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--nav-color) 18%, transparent);
  color: var(--nav-color);
  background: var(--nav-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.category-nav a:hover,
.category-nav a:focus-visible {
  border-color: color-mix(in srgb, var(--nav-color) 42%, #fff);
  color: #252622;
  background: #fff;
  box-shadow: 0 7px 16px color-mix(in srgb, var(--nav-color) 11%, transparent);
  outline: none;
  transform: translateY(-1px);
}

.category-nav .category-link--periodicos {
  --nav-color: #963b4b;
  --nav-soft: #f7e7eb;
}

.category-nav .category-link--bancos {
  --nav-color: #284f7e;
  --nav-soft: #e5edf7;
}

.category-nav .category-link--familia {
  --nav-color: #cf3542;
  --nav-soft: #fbe7e9;
}

.category-nav .category-link--el-tiempo {
  --nav-color: #d86612;
  --nav-soft: #fcebdc;
}

.category-nav .category-link--vivienda,
.category-nav .category-link--organismos-y-tramites {
  --nav-color: #13805f;
  --nav-soft: #e2f2ec;
}

.category-nav .category-link--google {
  --nav-color: #1769e8;
  --nav-soft: #e4efff;
}

.category-nav .category-link--otros {
  --nav-color: #7045bd;
  --nav-soft: #eee7fa;
}

.category-link--periodicos .category-icon::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  content: "";
  transform: translate(-50%, -50%);
}

.category-link--periodicos .category-icon::after {
  position: absolute;
  top: calc(50% - 4px);
  left: calc(50% - 6px);
  width: 12px;
  height: 8px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 4px 4px no-repeat,
    linear-gradient(currentColor 0 0) 100% 0 / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) 100% 3px / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) 0 100% / 12px 1.5px no-repeat;
  content: "";
}

.category-link--familia .category-icon::before {
  content: "♥";
  font-size: 1rem;
}

.category-link--el-tiempo .category-icon::before {
  content: "☀";
  font-size: 1.2rem;
}

.category-link--vivienda .category-icon::before {
  position: absolute;
  top: calc(50% - 1px);
  left: 50%;
  width: 12px;
  height: 9px;
  border-radius: 1px;
  background:
    linear-gradient(var(--nav-soft) 0 0) center bottom / 3px 5px no-repeat,
    currentColor;
  content: "";
  transform: translateX(-50%);
}

.category-link--vivienda .category-icon::after {
  position: absolute;
  top: calc(50% - 9px);
  left: 50%;
  width: 0;
  height: 0;
  border-right: 8px solid transparent;
  border-bottom: 9px solid currentColor;
  border-left: 8px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.category-link--google .category-icon::before {
  content: "G";
  font-size: 0.95rem;
}

.category-link--otros .category-icon::before {
  position: absolute;
  top: calc(50% - 5.5px);
  left: calc(50% - 5.5px);
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 7px 0 currentColor, 0 7px currentColor, 7px 7px currentColor;
  content: "";
}

.category-link--bancos .category-icon::before {
  content: "€";
  font-size: 1rem;
}

.category-link--organismos-y-tramites .category-icon::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 16px;
  border: 1.7px solid currentColor;
  border-radius: 2px;
  content: "";
  transform: translate(-50%, -50%);
}

.category-link--organismos-y-tramites .category-icon::after {
  position: absolute;
  top: calc(50% - 4px);
  left: calc(50% - 4px);
  width: 8px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 4px currentColor, 0 8px currentColor;
  content: "";
}

.groups {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.group {
  --group-color: #3f5268;
  --group-soft: #eef1f4;
  grid-column: span 4;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--group-color);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(39, 39, 34, 0.045);
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
  scroll-margin-top: 12px;
}

.group--periodicos,
.group--google,
.group--organismos-y-tramites {
  grid-column: 1 / -1;
}

.group--bancos {
  grid-column: span 8;
}

.group--tone-navy {
  --group-color: #324b6c;
  --group-soft: #e9eef4;
}

.group--tone-red {
  --group-color: #c2474d;
  --group-soft: #f9eaeb;
}

.group--tone-blue {
  --group-color: #3372c7;
  --group-soft: #eaf2fc;
}

.group--tone-orange {
  --group-color: #d4762c;
  --group-soft: #faeee5;
}

.group--tone-green {
  --group-color: #287a61;
  --group-soft: #e8f3ef;
}

.group--tone-violet {
  --group-color: #785cb2;
  --group-soft: #f0ecf8;
}

.group--periodicos {
  --group-color: #963b4b;
  --group-soft: #f7e7eb;
}

.group-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 19px 20px 15px;
}

.group-heading h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.group-symbol {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: var(--group-color);
  background: var(--group-soft);
  font-size: 0.83rem;
  font-weight: 900;
}

.group-symbol::before {
  content: "•";
}

.group--periodicos .group-symbol::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 14px;
  border: 1.7px solid currentColor;
  border-radius: 3px;
  content: "";
  transform: translate(-50%, -50%);
}

.group--periodicos .group-symbol::after {
  position: absolute;
  top: calc(50% - 4.5px);
  left: calc(50% - 7px);
  width: 14px;
  height: 9px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 100% 0 / 7px 1.7px no-repeat,
    linear-gradient(currentColor 0 0) 100% 3.5px / 7px 1.7px no-repeat,
    linear-gradient(currentColor 0 0) 0 100% / 14px 1.7px no-repeat;
  content: "";
}

.group--familia .group-symbol::before {
  content: "♥";
  font-size: 1.15rem;
}

.group--google .group-symbol::before {
  content: "G";
  font-size: 1.1rem;
}

.group--el-tiempo .group-symbol::before {
  content: "☀";
  font-size: 1.35rem;
}

.group--vivienda .group-symbol::before {
  position: absolute;
  top: calc(50% - 1px);
  left: 50%;
  width: 14px;
  height: 10px;
  border-radius: 1px;
  background:
    linear-gradient(var(--group-soft) 0 0) center bottom / 4px 6px no-repeat,
    currentColor;
  content: "";
  transform: translateX(-50%);
}

.group--vivienda .group-symbol::after {
  position: absolute;
  top: calc(50% - 11px);
  left: 50%;
  width: 0;
  height: 0;
  border-right: 9px solid transparent;
  border-bottom: 10px solid currentColor;
  border-left: 9px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.group--otros .group-symbol::before {
  position: absolute;
  top: calc(50% - 6.5px);
  left: calc(50% - 6.5px);
  width: 5px;
  height: 5px;
  border-radius: 1.5px;
  background: currentColor;
  box-shadow: 8px 0 currentColor, 0 8px currentColor, 8px 8px currentColor;
  content: "";
}

.group--bancos .group-symbol::before {
  content: "€";
  font-size: 1.15rem;
}

.group--organismos-y-tramites .group-symbol::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 18px;
  border: 1.8px solid currentColor;
  border-radius: 2px;
  content: "";
  transform: translate(-50%, -50%);
}

.group--organismos-y-tramites .group-symbol::after {
  position: absolute;
  top: calc(50% - 5px);
  left: calc(50% - 5px);
  width: 10px;
  height: 1.7px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 4.5px currentColor, 0 9px currentColor;
  content: "";
}

.group-count {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 99px;
  color: var(--group-color);
  background: var(--group-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 0 14px 14px;
}

.group--periodicos .link-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.group--google .link-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.group--familia .link-grid,
.group--el-tiempo .link-grid {
  grid-template-columns: 1fr;
}

.group--organismos-y-tramites .link-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.group--bancos .link-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.favorite-link {
  --link-color: #48515e;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 68px;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid #e6e5df;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.favorite-link:hover,
.favorite-link:focus-visible {
  z-index: 1;
  border-color: color-mix(in srgb, var(--link-color) 40%, #fff);
  box-shadow: 0 10px 23px color-mix(in srgb, var(--link-color) 12%, transparent);
  outline: none;
  transform: translateY(-2px);
}

.favorite-link--ink {
  --link-color: #30343b;
}

.favorite-link--blue {
  --link-color: #2268c3;
}

.favorite-link--navy {
  --link-color: #334e73;
}

.favorite-link--cyan {
  --link-color: #1584a0;
}

.favorite-link--orange {
  --link-color: #cc6c27;
}

.favorite-link--green {
  --link-color: #23815d;
}

.favorite-link--red {
  --link-color: #c6434a;
}

.favorite-link--gold {
  --link-color: #a97510;
}

.favorite-link--violet {
  --link-color: #7658af;
}

.link-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--link-color) 9%, #fff);
}

.link-icon img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.link-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  font-weight: 690;
  line-height: 1.22;
}

.page-exit {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 104px 0 12px;
  text-align: center;
}

.page-exit a {
  color: #696a65;
  font-size: 0.78rem;
  text-underline-offset: 3px;
}

.page-exit a:hover,
.page-exit a:focus-visible {
  color: #292a27;
}

.page-exit p {
  margin: 0;
  color: #a05b55;
  font-size: 0.7rem;
  line-height: 1.35;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 410px);
}

.login-panel {
  padding: 36px;
  border: 1px solid rgba(211, 209, 201, 0.92);
  border-top: 4px solid #d49a14;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 58px rgba(39, 39, 34, 0.1);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-mark {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  color: #e8ad20;
  background: #263a57;
  box-shadow: 0 10px 25px rgba(38, 58, 87, 0.2);
  font-size: 1.65rem;
  line-height: 1;
}

.login-heading h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.035em;
}

.login-message {
  margin: 20px 0 0;
  padding: 11px 12px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.login-message--error {
  border-color: #efc8ca;
  color: #8f2930;
  background: #fff1f2;
}

.login-message--success {
  border-color: #bee0d3;
  color: #21664f;
  background: #edf8f4;
}

.login-form {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.login-form label {
  font-size: 0.82rem;
  font-weight: 760;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #d8d7d0;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form input:focus {
  border-color: #8b7850;
  box-shadow: 0 0 0 3px rgba(212, 154, 20, 0.15);
}

.login-form button {
  min-height: 48px;
  margin-top: 5px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #263a57;
  box-shadow: 0 8px 20px rgba(38, 58, 87, 0.18);
  font-weight: 760;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.login-form button:hover,
.login-form button:focus-visible {
  background: #304a70;
  box-shadow: 0 10px 24px rgba(38, 58, 87, 0.24);
  outline: none;
  transform: translateY(-1px);
}

@media (max-width: 1120px) {
  .group--periodicos .link-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .category-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .group {
    grid-column: 1 / -1;
  }

  .group--periodicos .link-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .group--familia .link-grid,
  .group--el-tiempo .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 24px, 1480px);
    padding: 12px 0 50px;
  }

  .category-nav {
    margin-right: -4px;
    margin-left: -4px;
    padding: 5px;
    gap: 4px;
  }

  .category-nav a {
    flex-direction: column;
    min-width: 0;
    min-height: 52px;
    gap: 3px;
    padding: 5px 3px;
    font-size: 0.78rem;
    line-height: 1;
  }

  .category-icon {
    width: 23px;
    height: 23px;
    border-radius: 7px;
    font-size: 0.65rem;
  }

  .groups {
    gap: 13px;
  }

  .group {
    border-radius: 14px;
    scroll-margin-top: 12px;
  }

  .group-heading {
    padding: 15px 14px 12px;
  }

  .group .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 0 9px 9px;
  }

  .favorite-link {
    min-height: 62px;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
  }

  .link-icon {
    width: 39px;
    height: 39px;
    border-radius: 9px;
  }

  .link-icon img {
    width: 29px;
    height: 29px;
  }

  .link-name {
    font-size: 0.78rem;
  }

  .login-page {
    padding: 16px;
  }

  .login-panel {
    padding: 28px 22px;
    border-radius: 17px;
  }

  .login-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 1.48rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
