* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #172033;
  --muted: #687286;
  --border: #e2e5eb;
  --accent: #234f7d;
  --shadow: 0 5px 18px rgba(23, 32, 51, 0.08);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 18px;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
  line-height: 1.15;
}

.header-inner p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.container {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.search-box span {
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

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

.list-card {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.list-card:active {
  transform: scale(0.985);
}

.preview {
  height: 75px;
  background: #eef0f4;
  overflow: hidden;
}

.preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-title {
  padding: 11px 12px 13px;
  font-weight: 650;
  font-size: 0.95rem;
}

.empty-state {
  margin: 40px 0;
  text-align: center;
  color: var(--muted);
}

/* Modal */

.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-modal.active {
  display: flex;
}

.modal-content {
  width: 100%;
  height: 90vh;
  max-width: 95vw;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.modal-content img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0px;

  transform: translate(0px, 0px) scale(1);
  transform-origin: center center;

  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;

  will-change: transform;
  transition: transform 0.25s ease;
}

.modal-close {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 1001;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #222;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

@media (min-width: 700px) {
  .container {
    padding-top: 26px;
  }

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

  .list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 25px rgba(23, 32, 51, 0.11);
  }
}

@media (min-width: 1000px) {
  .list-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* =========================
   BOTÓN DE INICIAR SESIÓN
   ========================= */

.header-inner {
  position: relative;
}

.login-button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);

  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  text-decoration: none;
}

.login-button img {
  width: 32px;
  height: 32px;

  object-fit: contain;

  display: block;

  opacity: 0.5;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.login-button:hover img {
  transform: scale(1.08);
  opacity: 0.85;
}

.login-button:active img {
  transform: scale(0.95);
}