:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.42);

  --glass-bg: rgba(18, 20, 28, 0.48);
  --glass-bg-hover: rgba(26, 30, 42, 0.62);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-highlight-top: rgba(255, 255, 255, 0.42);
  --glass-highlight-bottom: rgba(255, 255, 255, 0.14);

  --accent: #0a84ff;
  --accent-glow: rgba(10, 132, 255, 0.45);
  --danger: #ff453a;

  --orb-1: rgba(56, 118, 255, 0.24);
  --orb-2: rgba(16, 185, 198, 0.18);
  --orb-3: rgba(124, 58, 237, 0.16);
  --bg-base: #07080d;
}

/* Temas oscuros seleccionables */
body[data-theme="obsidian"] {
  --bg-base: #06070a;
  --orb-1: rgba(120, 135, 175, 0.18);
  --orb-2: rgba(255, 255, 255, 0.08);
  --orb-3: rgba(70, 80, 110, 0.16);
}

body[data-theme="abyss"] {
  --bg-base: #040914;
  --orb-1: rgba(14, 98, 255, 0.28);
  --orb-2: rgba(34, 211, 238, 0.2);
  --orb-3: rgba(30, 58, 138, 0.25);
}

body[data-theme="dune"] {
  --bg-base: #0d0a08;
  --orb-1: rgba(194, 132, 68, 0.24);
  --orb-2: rgba(120, 74, 38, 0.2);
  --orb-3: rgba(235, 185, 120, 0.1);
}

body[data-theme="aurora"] {
  --bg-base: #060911;
  --orb-1: rgba(16, 185, 129, 0.2);
  --orb-2: rgba(139, 92, 246, 0.22);
  --orb-3: rgba(56, 189, 248, 0.18);
}

/* Modo Claro */
body[data-mode="light"] {
  --text-primary: rgba(17, 24, 39, 0.94);
  --text-secondary: rgba(55, 65, 81, 0.78);
  --text-muted: rgba(107, 114, 128, 0.75);
  --bg-base: #e7e9ee;
  --orb-1: rgba(59, 130, 246, 0.22);
  --orb-2: rgba(236, 178, 110, 0.22);
  --orb-3: rgba(167, 139, 250, 0.18);
}

body[data-mode="light"][data-theme="obsidian"] {
  --bg-base: #e6e8ec;
  --orb-1: rgba(148, 163, 184, 0.3);
  --orb-2: rgba(255, 255, 255, 0.7);
  --orb-3: rgba(100, 116, 139, 0.18);
}

body[data-mode="light"][data-theme="abyss"] {
  --bg-base: #e4ebf5;
  --orb-1: rgba(56, 189, 248, 0.28);
  --orb-2: rgba(59, 130, 246, 0.22);
  --orb-3: rgba(125, 211, 252, 0.25);
}

body[data-mode="light"][data-theme="dune"] {
  --bg-base: #efeae4;
  --orb-1: rgba(234, 179, 112, 0.3);
  --orb-2: rgba(255, 245, 230, 0.7);
  --orb-3: rgba(194, 132, 68, 0.18);
}

body[data-mode="light"][data-theme="aurora"] {
  --bg-base: #e8eef2;
  --orb-1: rgba(52, 211, 153, 0.22);
  --orb-2: rgba(167, 139, 250, 0.22);
  --orb-3: rgba(56, 189, 248, 0.2);
}

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

html,
body {
  min-height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.6s ease;
}

/* Fondo ambiental con orbes suaves para dar refracción real al Liquid Glass */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-custom-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.ambient-custom-bg.has-image {
  opacity: 1;
}

.ambient-custom-bg.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(6, 8, 14, 0.36) 0%,
    rgba(6, 8, 14, 0.62) 100%
  );
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.9;
  transition: background 0.8s ease;
  animation: floatOrb 22s ease-in-out infinite alternate;
}

.orb-1 {
  width: 55vw;
  height: 55vw;
  max-width: 720px;
  max-height: 720px;
  top: -18%;
  left: -10%;
  background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%);
}

.orb-2 {
  width: 50vw;
  height: 50vw;
  max-width: 640px;
  max-height: 640px;
  bottom: -15%;
  right: -8%;
  background: radial-gradient(circle, var(--orb-2) 0%, transparent 70%);
  animation-delay: -7s;
}

.orb-3 {
  width: 40vw;
  height: 40vw;
  max-width: 520px;
  max-height: 520px;
  top: 38%;
  left: 48%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--orb-3) 0%, transparent 70%);
  animation-delay: -14s;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(40px, -30px) scale(1.08);
  }
}

.ambient-noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: radial-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Contenedor principal */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 140px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.55s ease,
              opacity 0.45s ease;
}

body.is-memory-opening .main-container {
  transform: scale(0.94);
  filter: blur(12px);
  opacity: 0.45;
}

body.is-memory-opening .bottom-dock-wrapper {
  transform: translate(-50%, 36px);
  opacity: 0;
}

/* Pantalla de bienvenida */
.welcome-section {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeSlideDown 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.welcome-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.glass-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.25s ease;
}

.mode-toggle-pill {
  font-family: inherit;
  cursor: pointer;
}

.mode-toggle-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  transform: translateY(-1px);
}

body[data-mode="light"] .glass-pill-badge {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body[data-mode="light"] .mode-toggle-pill:hover {
  background: rgba(255, 255, 255, 0.8);
}

.live-clock {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.welcome-title {
  font-size: clamp(2.1rem, 4.5vw, 3.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text-primary);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
  transition: color 0.35s ease;
}

body[data-mode="light"] .welcome-title {
  text-shadow: 0 2px 18px rgba(255, 255, 255, 0.65);
}

.welcome-subtitle {
  margin-top: 12px;
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Grid de tarjetas de proyectos */
.projects-section {
  flex: 1;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 24px;
  justify-items: center;
}

/* Tarjeta full-bleed estilo Liquid Glass Squircle */
.project-card {
  position: relative;
  width: 100%;
  max-width: 310px;
  aspect-ratio: 1 / 1.04;
  padding: 0;
  border-radius: 34px;
  overflow: hidden;
  background: rgba(16, 18, 26, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.48),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.42),
    inset 0 -1.5px 1px rgba(255, 255, 255, 0.22);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.38s ease,
              border-color 0.35s ease;
  animation: fadeScaleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

body[data-mode="light"] .project-card {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    0 22px 46px rgba(15, 23, 42, 0.16),
    0 8px 20px rgba(15, 23, 42, 0.08),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.65);
}

.project-card:hover {
  transform: translateY(-8px) scale(1.022);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 32px 66px rgba(0, 0, 0, 0.58),
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.58);
}

body[data-mode="light"] .project-card:hover {
  box-shadow:
    0 30px 60px rgba(15, 23, 42, 0.22),
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.85);
}

.project-card:active {
  transform: translateY(-2px) scale(0.975);
}

/* Acciones rápidas (Editar / Eliminar) en hover */
.card-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.project-card:hover .card-actions,
.project-card:focus-within .card-actions {
  opacity: 1;
  transform: translateY(0);
}

.card-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(14, 16, 22, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
}

.card-action-btn.delete:hover {
  background: rgba(255, 69, 58, 0.35);
  border-color: rgba(255, 69, 58, 0.6);
  color: #fff;
}

/* Contenedor de portada full-bleed con borde inferior difuminado estilo cristal */
.card-cover-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .card-cover-img {
  transform: scale(1.06);
}

/* Efecto de refracción / vidrio líquido en la base de la tarjeta */
.card-cover-frost {
  position: absolute;
  inset: auto 0 0 0;
  height: 52%;
  background: linear-gradient(
    to bottom,
    rgba(8, 10, 16, 0) 0%,
    rgba(8, 10, 16, 0.28) 45%,
    rgba(8, 10, 16, 0.68) 100%
  );
  backdrop-filter: blur(16px) saturate(165%);
  -webkit-backdrop-filter: blur(16px) saturate(165%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 58%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 58%);
  pointer-events: none;
}

/* Contenido superpuesto en la parte inferior de la tarjeta (Logo + Nombre) */
.card-identity {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.card-logo-wrap {
  width: 44px;
  height: 44px;
  margin-bottom: 2px;
  border-radius: 13px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
}

.card-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-logo-fallback {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.card-title {
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-domain {
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-secondary);
}

.empty-glass-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.75);
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

/* =========================================================
   BARRA INFERIOR FLOTANTE LIQUID GLASS (Foto 1 + Foto 2)
   ========================================================= */
.bottom-dock-wrapper {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 28px);
}

.glass-dock {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 9999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(255, 255, 255, 0.08) 100%
  );
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.48),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    inset 0 -1.5px 1px rgba(255, 255, 255, 0.2),
    inset 1.5px 0 2px rgba(255, 255, 255, 0.22),
    inset -1.5px 0 2px rgba(255, 255, 255, 0.22);
}

/* Botón Liquid Glass (Foto 2: Optical Depth & Edge Highlighting) */
.glass-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.04) 48%,
    rgba(255, 255, 255, 0.1) 100%
  );
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.5),
    inset 0 -1.5px 1px rgba(255, 255, 255, 0.22),
    inset 1.5px 0 1.5px rgba(255, 255, 255, 0.22),
    inset -1.5px 0 1.5px rgba(255, 255, 255, 0.22);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease,
              background 0.25s ease,
              border-color 0.25s ease;
}

.glass-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 80% at 20% 0%,
    rgba(255, 255, 255, 0.26) 0%,
    transparent 60%
  );
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.25s ease;
}

.glass-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.38);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.16) 100%
  );
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.45),
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.65),
    inset 0 -1.5px 1.5px rgba(255, 255, 255, 0.3),
    inset 1.5px 0 2px rgba(255, 255, 255, 0.3),
    inset -1.5px 0 2px rgba(255, 255, 255, 0.3);
}

.glass-btn:active {
  transform: translateY(0) scale(0.97);
}

/* Botones dentro del dock inferior: solo icono centrado */
.dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.22s ease,
              color 0.22s ease;
}

.dock-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.dock-btn:active {
  transform: translateY(0) scale(0.95);
}

.dock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dock-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Variantes de botón en modales */
.btn-primary {
  background: linear-gradient(
    165deg,
    rgba(56, 152, 255, 0.72) 0%,
    rgba(10, 112, 235, 0.65) 100%
  );
  border-color: rgba(140, 200, 255, 0.45);
}

.btn-primary:hover {
  background: linear-gradient(
    165deg,
    rgba(72, 165, 255, 0.88) 0%,
    rgba(16, 125, 245, 0.82) 100%
  );
  box-shadow:
    0 10px 28px var(--accent-glow),
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.65);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.btn-small {
  padding: 7px 14px;
  font-size: 0.78rem;
}

.glass-btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.glass-btn-icon:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: scale(1.06);
}

/* =========================================================
   MODALES LIQUID GLASS (Tarjetas flotantes)
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 12, 0.24);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.glass-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.04) 52%,
    rgba(255, 255, 255, 0.09) 100%
  );
  backdrop-filter: blur(28px) saturate(185%);
  -webkit-backdrop-filter: blur(28px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 1px 0 1px rgba(255, 255, 255, 0.18),
    inset 0 -1px 1px rgba(255, 255, 255, 0.12);
  transform: translateY(18px) scale(0.96);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.is-open .glass-modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.modal-subtitle {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-group input[type="text"],
.form-group input[type="url"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input:focus {
  border-color: rgba(120, 190, 255, 0.55);
  background: rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(10, 132, 255, 0.18);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.image-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-preview {
  width: 100%;
  height: 84px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.75rem;
  color: var(--text-muted);
  background-size: cover;
  background-position: center;
}

.upload-pill {
  width: 100%;
  text-align: center;
}

.bg-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.backup-status {
  min-height: 16px;
  font-size: 0.78rem;
  color: rgba(125, 211, 252, 0.9);
}

/* Presets de tema oscuro */
.theme-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.preset-chip.active {
  border-color: rgba(120, 190, 255, 0.6);
  background: rgba(10, 132, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.preset-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dot-obsidian { background: linear-gradient(135deg, #2b3040, #0b0d14); }
.dot-abyss { background: linear-gradient(135deg, #0ea5e9, #1e3a8a); }
.dot-dune { background: linear-gradient(135deg, #d99b52, #3b2313); }
.dot-aurora { background: linear-gradient(135deg, #10b981, #7c3aed); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Animaciones */
@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive */
@media (max-width: 600px) {
  .main-container {
    padding: 36px 16px 128px;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .glass-dock {
    padding: 8px 18px;
  }

  .dock-btn {
    min-width: 76px;
    padding: 6px 10px;
  }

  .glass-modal {
    padding: 22px;
    border-radius: 26px;
  }
}

/* =========================================================
   SELECTOR MODO OSCURO / CLARO & ESTILOS MODO CLARO
   ========================================================= */
.mode-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mode-seg-btn {
  padding: 9px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.22s ease;
}

.mode-seg-btn:hover {
  color: var(--text-primary);
}

.mode-seg-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body[data-mode="light"] .mode-segmented {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.08);
}

body[data-mode="light"] .mode-seg-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

/* Dock & Modales en Modo Claro */
body[data-mode="light"] .glass-dock {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.68) 0%,
    rgba(255, 255, 255, 0.44) 100%
  );
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.14),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(255, 255, 255, 0.6);
}

body[data-mode="light"] .dock-btn {
  color: rgba(17, 24, 39, 0.82);
}

body[data-mode="light"] .dock-btn:hover {
  color: #000000;
  background: rgba(15, 23, 42, 0.06);
}

body[data-mode="light"] .modal-overlay {
  background: rgba(235, 240, 248, 0.25);
}

body[data-mode="light"] .glass-modal {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.52) 0%,
    rgba(255, 255, 255, 0.24) 55%,
    rgba(255, 255, 255, 0.38) 100%
  );
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 28px 65px rgba(15, 23, 42, 0.16),
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 1px 0 1px rgba(255, 255, 255, 0.6);
}

body[data-mode="light"] .modal-title {
  color: #0f172a;
}

body[data-mode="light"] .form-group input[type="text"],
body[data-mode="light"] .form-group input[type="url"] {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

body[data-mode="light"] .preset-chip {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(15, 23, 42, 0.1);
  color: #334155;
}

body[data-mode="light"] .preset-chip.active {
  background: rgba(10, 132, 255, 0.14);
  border-color: rgba(10, 132, 255, 0.5);
  color: #0f172a;
}

body[data-mode="light"] .glass-btn-icon,
body[data-mode="light"] .btn-secondary,
body[data-mode="light"] .upload-pill {
  background: rgba(15, 23, 42, 0.07);
  border-color: rgba(15, 23, 42, 0.12);
  color: #1e293b;
}

body[data-mode="light"] .glass-btn-icon:hover,
body[data-mode="light"] .btn-secondary:hover,
body[data-mode="light"] .upload-pill:hover {
  background: rgba(15, 23, 42, 0.13);
  color: #0f172a;
}

/* =========================================================
   ANIMACIÓN TIPO "RECUERDO" AL ABRIR UNA TARJETA
   ========================================================= */
.bottom-dock-wrapper {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.memory-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.memory-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.memory-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

body[data-mode="light"] .memory-backdrop {
  background: rgba(232, 235, 242, 0.65);
}

.memory-card {
  position: fixed;
  overflow: hidden;
  border-radius: 34px;
  box-shadow:
    0 36px 90px rgba(0, 0, 0, 0.55),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45);
  transition:
    top 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
}

.memory-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-frost {
  position: absolute;
  inset: auto 0 0 0;
  height: 50%;
  background: linear-gradient(
    to bottom,
    rgba(8, 10, 16, 0) 0%,
    rgba(8, 10, 16, 0.35) 50%,
    rgba(8, 10, 16, 0.78) 100%
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  mask-image: linear-gradient(to bottom, transparent 0%, black 55%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 55%);
}

.memory-content {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: #ffffff;
}

.memory-logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
}

.memory-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.memory-subtitle {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
}
