/* Relación sobre Ruedas — limpio, moderno, app-like */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f8f8f8;
  --bg-elevated: #ffffff;
  --border: #e6e6e6;
  --border-strong: #d4d4d4;
  --text: #0f0f0f;
  --text-secondary: #6b6b6b;
  --text-tertiary: #9c9c9c;
  --accent: #e0395a;
  --accent-soft: #fde7ec;
  --accent-hover: #c52d4c;
  --success: #16a34a;
  --warn-soft: #fff4e6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
p  { color: var(--text-secondary); }
a  { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.muted { color: var(--text-secondary); }
.tertiary { color: var(--text-tertiary); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

/* === NAV === */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 248, 248, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.5rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.nav-brand .mark {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: white;
}
.nav-links {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.nav-links a.active { color: var(--text); background: rgba(0,0,0,0.06); }
.nav-links .logout { color: var(--text-tertiary); }
.nav-links .logout:hover { color: var(--accent); background: var(--accent-soft); }

/* === CONTAINER & SECTIONS === */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
section { padding: 1.75rem 0; }
section:first-of-type { padding-top: 2.5rem; }

.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.85rem;
  padding-left: 0.25rem;
}

/* === HERO discreto (greeting + dias) === */
.hero {
  padding: 2.5rem 0 1rem;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.hero .sub {
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-size: 1rem;
}

/* === STAT GRID (Apple Fitness style) === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.5rem;
}
.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.stat .label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.stat .label .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.stat .value {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.stat .unit {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-left: 0.3rem;
}
.stat .hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 0.4rem;
}

/* === CARD === */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.card-head h3 {
  font-size: 1.05rem;
  font-weight: 600;
}
.card-head .meta {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}
.card-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem -1.5rem;
}

/* Lista tipo Settings de iOS */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .lr-label { font-size: 0.95rem; }
.list-row .lr-value { color: var(--text-secondary); font-size: 0.9rem; }
.list-row a.lr-action {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

/* === RELOJES === */
.clocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.clock {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
}
.clock .ck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}
.clock .ck-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.clock .ck-place {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.clock .ck-time {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}
.clock .ck-date {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 0.4rem;
  text-transform: capitalize;
}

/* === TE PIENSO === */
.thinking-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem 1.8rem;
  text-align: center;
}
.heart-btn {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 2.6rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(224, 57, 90, 0.35);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  display: inline-grid;
  place-items: center;
  font-family: inherit;
  margin: 0.6rem auto 1.1rem;
  -webkit-user-select: none; user-select: none;
}
.heart-btn:hover { background: var(--accent-hover); transform: scale(1.03); }
.heart-btn:active { transform: scale(0.95); }
.heart-btn.cooldown { background: var(--text-tertiary); cursor: not-allowed; box-shadow: none; }
.heart-btn .hb-emoji { line-height: 1; transition: transform 0.3s; }
.heart-btn.pulse .hb-emoji { animation: pulse 0.55s ease; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.3); }
}

.thinking-status {
  font-size: 0.95rem;
  color: var(--text-secondary);
  min-height: 1.5em;
  max-width: 380px;
  margin: 0 auto;
}
.thinking-status strong { color: var(--accent); font-weight: 700; }

.thinking-meta {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}
.thinking-meta b { color: var(--text); font-weight: 600; }

.float-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}
.float-hearts span {
  position: absolute;
  font-size: 1.6rem;
  animation: floatUp 1.5s ease-out forwards;
  opacity: 0;
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-180px) scale(1.2); opacity: 0; }
}

/* === VISITA === */
.visit-hero {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.2rem;
  align-items: center;
}
.visit-hero .vh-num {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 0.9;
}
.visit-hero .vh-num small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}
.visit-hero h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.visit-hero p { font-size: 0.88rem; color: var(--text-secondary); }
.visit-hero.empty { grid-template-columns: 1fr auto; }
.visit-hero.empty h3 { color: var(--text); }
.visit-hero.empty p { color: var(--text-secondary); }

/* === ALBUM === */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem;
}
.album-grid .photo {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
}
.album-grid .photo:hover { transform: scale(1.02); z-index: 1; }
.album-grid .photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.album-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-tertiary);
  font-size: 0.92rem;
}

/* === TIMELINE === */
.timeline {
  position: relative;
  padding-left: 0;
}
.tl-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.tl-item:last-child { border-bottom: none; }
.tl-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}
.tl-body { padding-top: 0.15rem; }
.tl-date {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.tl-title {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.15rem;
}
.tl-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}
.tl-actions { padding-top: 0.4rem; }
.tl-del {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 0.4rem;
  line-height: 1;
}
.tl-del:hover { color: var(--accent); }

details.card summary::-webkit-details-marker { display: none; }
details.card summary { outline: none; }
details.card[open] summary { color: var(--accent); }

/* === BOTONES === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: -0.005em;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-weight: 500;
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); border-color: var(--text-tertiary); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; }

/* === FORMS === */
input[type="text"], input[type="password"], input[type="date"], input[type="file"] {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.7rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
label.field-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.error {
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
  border-left: 3px solid var(--accent);
}
.flash-success {
  background: #e8f5e9;
  color: #1b5e20;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
  border-left: 3px solid var(--success);
}

/* === LOGIN === */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.8rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card .heart {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: white;
  box-shadow: 0 6px 18px rgba(224, 57, 90, 0.3);
}
.login-card h1 {
  font-size: 1.45rem;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}
.login-card .tagline {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.6rem;
}

/* === PAGE HEADER === */
.page-header {
  padding: 2.5rem 0 0.5rem;
}
.page-header h1 {
  font-size: 1.9rem;
  margin-bottom: 0.25rem;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* === FOOTER === */
footer.site-footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

/* === BOTTOM NAV (móvil) === */
.bottom-nav { display: none; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-inner { padding: 0.6rem 1rem; }

  .container { padding: 0 1rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid .stat:nth-child(3) { grid-column: 1 / -1; }
  .clocks { grid-template-columns: 1fr; }
  .visit-hero { grid-template-columns: 1fr; gap: 0.8rem; text-align: left; padding: 1.4rem; }
  .visit-hero .vh-num { font-size: 2.6rem; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

  .bottom-nav {
    display: grid;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom));
    z-index: 50;
  }
  .bottom-nav a {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0.2rem;
    transition: color 0.15s;
    font-weight: 500;
  }
  .bottom-nav a .icon { font-size: 1.25rem; }
  .bottom-nav a.active { color: var(--accent); }

  body { padding-bottom: 70px; }
  footer.site-footer { margin-bottom: 60px; }
  .page-header { padding: 1.5rem 0 0.25rem; }
  .hero { padding: 1.5rem 0 0.5rem; }
}
