/* styles.css – RehabMe PWA paciente */

/* ---------- Reset mínimo ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* ---------- Base ---------- */
:root {
  --rm-bg: #f3f4f6;
  --rm-bg-card: #ffffff;
  --rm-primary: #2563eb;
  --rm-primary-soft: #dbeafe;
  --rm-primary-dark: #1d4ed8;
  --rm-text-main: #111827;
  --rm-text-muted: #6b7280;
  --rm-border-soft: #e5e7eb;
  --rm-radius-lg: 18px;
  --rm-radius-md: 12px;
  --rm-shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--rm-text-main);
  background: radial-gradient(circle at top, #eff6ff 0, #f9fafb 55%, #eef2ff 100%);
  min-height: 100vh;
}

/* Contenedor principal */
#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ---------- Header ---------- */
.rm-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.rm-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

/* Logo RehabMe (70px de alto) */
.rm-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* quitamos el círculo y el fondo */
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
}

.rm-logo img {
  height: 70px;
  width: auto;
  display: block;
}


.rm-header-text h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.rm-header-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--rm-text-muted);
}

/* ---------- Card ---------- */
.rm-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-radius: var(--rm-radius-lg);
  box-shadow: var(--rm-shadow-soft);
  padding: 20px 18px 18px;
}

/* ---------- Textos ---------- */
.rm-text-muted {
  color: var(--rm-text-muted);
  font-size: 0.9rem;
}

.rm-error-message {
  margin-top: 10px;
  color: #b91c1c;
  font-size: 0.88rem;
}

/* ---------- Formularios ---------- */
.rm-label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.rm-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--rm-border-soft);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
  background-color: #f9fafb;
}

.rm-input::placeholder {
  color: #9ca3af;
}

.rm-input:focus {
  border-color: var(--rm-primary);
  box-shadow: 0 0 0 1px var(--rm-primary-soft);
  background-color: #ffffff;
}

/* ---------- Botones ---------- */
.rm-btn {
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 0.15s ease, transform 0.12s ease,
    box-shadow 0.15s ease;
}

.rm-btn-primary {
  background: linear-gradient(135deg, var(--rm-primary), var(--rm-primary-dark));
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.rm-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.4);
}

.rm-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.rm-btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.rm-btn-secondary:hover {
  background: #d1d5db;
}

.rm-btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

/* ---------- Login view ---------- */
#login-view h2 {
  margin: 0 0 10px;
}

#login-view p {
  margin-top: 0;
  margin-bottom: 18px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Vista ejercicios ---------- */
#ejercicios-view {
  margin-top: 18px;
}

.rm-ejercicios-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rm-ejercicios-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Tarjeta de ejercicio */
.rm-ejercicio-item {
  border-radius: var(--rm-radius-md);
  border: 1px solid rgba(209, 213, 219, 0.8);
  padding: 10px 12px;
  background: linear-gradient(
      135deg,
      rgba(219, 234, 254, 0.75),
      rgba(248, 250, 252, 0.95)
    );
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rm-ejercicio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.rm-ejercicio-titulo {
  font-size: 0.98rem;
  font-weight: 600;
}

.rm-ejercicio-detalle {
  font-size: 0.85rem;
  color: var(--rm-text-muted);
}

.rm-ejercicio-meta {
  font-size: 0.8rem;
  color: var(--rm-text-muted);
}

/* Botón de video en la tarjeta */
.rm-ejercicio-actions {
  margin-top: 6px;
}

/* ---------- Modal de video ---------- */
.rm-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
}

.rm-modal-content {
  position: relative;
  z-index: 50;
  width: 100%;
  max-width: 560px;
  margin: 16px;
  background: #020617;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.75);
  color: #f9fafb;
}

.rm-modal-body {
  padding: 16px 16px 14px;
}

.rm-modal-body h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.rm-modal-body p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #cbd5f5;
}

/* Botón cerrar */
.rm-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Video */
.rm-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 360px;        /* ancho máximo cómodo en desktop */
  margin: 0 auto;          /* centrado */
  aspect-ratio: 9 / 16;    /* formato vertical */
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

.rm-video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;        /* llena el cuadro; si quieres que no recorte, usa 'contain' */
}

/* ---------- Utilidades ---------- */
.rm-hidden {
  display: none !important;
}

/* ---------- Responsivo ---------- */
@media (min-width: 640px) {
  #app {
    padding-top: 32px;
  }

  .rm-header-text h1 {
    font-size: 1.7rem;
  }

  .rm-card {
    padding: 22px 22px 20px;
  }

  #login-form {
    flex-direction: row;
    align-items: flex-end;
  }

  #login-form .rm-input {
    flex: 1;
  }
}
