:root {
  --bg-soft: #f8fafc;
  --bg-white: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --brand: #0ea5e9;
  --brand-strong: #0284c7;
  --danger: #dc2626;
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-soft) 100%);
  color: var(--ink);
}

/* LOGIN */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 45%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.16), transparent 40%),
    #ffffff;
}

.login-card {
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 28px;
  width: 90%;
  max-width: 390px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.login-card h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.6rem;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 1.1rem;
  letter-spacing: 3px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.16);
}

.login-card button {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s;
}

.login-card button:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}

.login-error {
  margin-top: 12px;
  color: var(--danger);
  font-size: 0.9rem;
  display: none;
}

/* APP */
#app {
  display: none;
}

header {
  background: #ffffff;
  color: var(--ink);
  text-align: center;
  padding: 18px 56px 16px;
  position: relative;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

header h1 {
  margin: 0;
  color: var(--brand-strong);
  font-size: clamp(1.2rem, 4vw, 2rem);
}

header p {
  font-size: clamp(0.85rem, 2vw, 1rem);
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.logout-btn {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--brand-strong);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s;
}

.logout-btn:hover {
  background: #f0f9ff;
  border-color: #bae6fd;
}

/* TABS */
.tabs {
  display: flex;
  gap: 8px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 12px;
}

.tab-btn {
  flex: 1;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border-color: transparent;
}

.tab-btn:hover:not(.active) {
  color: var(--ink);
  background: #f1f5f9;
}

/* SECTIONS */
.section {
  display: none;
}

.section.active {
  display: block;
}

.container {
  width: 95%;
  max-width: 1200px;
  margin: 18px auto;
}

/* GUIA BICI */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.step {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease;
}

.step:hover {
  transform: translateY(-3px);
}

.step img {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: cover;
  display: block;
}

.step-content {
  padding: 15px;
}

.step-content h3 {
  margin-top: 0;
  color: var(--brand-strong);
  font-size: 1.1rem;
}

.step-content p {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

#map {
  width: 100%;
  height: 450px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  margin-top: 20px;
}

.bike-panel {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.bike-panel-copy h2,
.bike-list-header h2 {
  margin: 6px 0 10px;
  color: var(--ink);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.bike-panel-copy p,
.bike-list-header p,
.bike-empty-state p,
.bike-description,
.bike-contact,
.form-message {
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bike-form {
  margin-top: 20px;
}

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

.bike-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.bike-form label span {
  font-size: 0.95rem;
}

.bike-form input,
.bike-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
}

.bike-form textarea {
  resize: vertical;
  min-height: 118px;
}

.bike-form input:focus,
.bike-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.full-width {
  grid-column: 1 / -1;
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.preview-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.preview-card img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.preview-card figcaption {
  padding: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.primary-btn,
.ghost-btn,
.delete-bike-btn {
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #ffffff;
}

.ghost-btn {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.delete-bike-btn {
  background: #fee2e2;
  color: #b91c1c;
  padding-inline: 14px;
}

.form-message {
  min-height: 22px;
  margin: 14px 0 0;
}

.bike-list-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin: 28px 0 18px;
}

.bike-list-header p {
  margin: 0;
}

.bike-empty-state {
  border: 1px dashed #bae6fd;
  border-radius: 18px;
  background: #f8fdff;
  padding: 26px 20px;
  text-align: center;
}

.bike-empty-state h3 {
  margin: 0 0 8px;
  color: var(--ink);
}

.bike-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.bike-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.bike-gallery {
  padding: 14px;
}

.bike-main-photo {
  display: block;
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 16px;
  background: #e2e8f0;
}

.bike-thumb-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
}

.bike-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  flex: 0 0 66px;
}

.bike-thumb.active {
  border-color: var(--brand);
}

.bike-thumb img {
  display: block;
  width: 100%;
  height: 60px;
  object-fit: cover;
}

.bike-card-body {
  padding: 4px 16px 18px;
}

.bike-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.bike-card-top h3 {
  margin: 0;
  color: var(--ink);
}

.bike-date {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.85rem;
}

.bike-price {
  color: var(--brand-strong);
  font-size: 1.1rem;
}

.bike-description {
  margin: 14px 0 10px;
  line-height: 1.5;
}

.bike-contact {
  margin: 0 0 14px;
}

.is-hidden {
  display: none;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
}

.image-modal.is-open {
  display: block;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(2px);
}

.image-modal-content {
  position: relative;
  z-index: 1;
  width: min(94vw, 1100px);
  margin: 4vh auto;
  max-height: 92vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-modal-content img {
  width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  background: #0f172a;
}

.image-modal-close {
  position: absolute;
  top: -42px;
  right: 0;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* PASOS */
.pasos-lista {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pasos-lista li {
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.paso-num {
  background: #1e88e5;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
}

.paso-texto strong {
  display: block;
  color: #1e88e5;
  margin-bottom: 4px;
  font-size: 1rem;
}

.paso-texto p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #555;
}

/* APRENDIENDO BICI */
.aprende-bici {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  margin-top: 30px;
}

.aprende-bici h2 {
  margin: 0 0 6px;
  color: var(--brand-strong);
  font-size: 1.3rem;
}

.aprende-bici p.subtitulo {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.videos-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.video-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 700px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.video-item span {
  font-weight: bold;
  color: var(--ink);
  font-size: 0.95rem;
}

.video-item video {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  background: #000;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .container { width: 92%; }
  .steps { grid-template-columns: 1fr; }
  #map { height: 320px; }
  .step-content { padding: 12px; }
  .videos-grid { align-items: stretch; }
  .tabs { padding: 8px; }
  .tab-btn { font-size: 0.9rem; }
  .form-grid { grid-template-columns: 1fr; }
  .bike-list-header,
  .bike-card-top,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  #login-screen { padding: 14px; }
  .login-card {
    width: 100%;
    padding: 28px 20px;
    border-radius: 18px;
  }
  .login-card h2 { font-size: 1.4rem; }
  header { padding: 14px 52px 14px 12px; }
  #map { height: 280px; }
  .logout-btn { right: 10px; font-size: 0.74rem; padding: 5px 9px; }
  .aprende-bici { padding: 18px 14px; }
  .bike-panel { padding: 18px 14px; }
  .bike-main-photo { height: 220px; }
}
