/* ══════════════════════════════════════════════════════════════
   BIPOWER Recursos — Stylesheet
   ══════════════════════════════════════════════════════════════ */

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

:root {
  --orange:     #FF671D;
  --blue:       #044BC5;
  --black:      #0C0C0C;
  --surface:    #FFFFFF;
  --surface-2:  #F2F2F7;
  --text:       #111111;
  --muted:      #6B7280;
  --border:     rgba(0,0,0,0.09);
  --radius:     16px;
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-2);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN ───────────────────────────────────────────────────── */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(255,103,29,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(4,75,197,0.05) 0%, transparent 55%),
    var(--surface-2);
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.login-card {
  width: 100%;
  background: radial-gradient(ellipse at 50% 30%, #2568f0 0%, #1040c8 30%, #06168a 62%, #030d50 100%);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-logo img.icon  { width: 100px; height: 100px; object-fit: contain; }
.login-logo img.brand { height: 44px; object-fit: contain; }

.login-card h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: #fff;
}

.login-card p {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  text-align: center;
  line-height: 1.55;
  margin-top: -8px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dni-input {
  width: 100%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 15px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.dni-input:focus {
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.dni-input::placeholder {
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
  font-size: 15px;
  font-weight: 400;
  text-transform: none;
}

.btn-primary {
  width: 100%;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-primary:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:disabled              { opacity: 0.5;  cursor: not-allowed; }

.spinner {
  display: none;
  gap: 5px;
  align-items: center;
}

.spinner span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  animation: bounce 1.2s ease-in-out infinite both;
}

.spinner span:nth-child(1) { animation-delay: -0.32s; }
.spinner span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1;   }
}

.error-msg {
  background: rgba(255,70,70,0.1);
  border: 1px solid rgba(255,70,70,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #FF7B7B;
  text-align: center;
  line-height: 1.4;
  display: none;
}

.login-footer {
  font-size: 13px;
  color: rgba(0,0,0,0.35);
}

/* ── APP HEADER ──────────────────────────────────────────────── */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #044BC5 0%, #022a7a 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  height: 62px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo img.icon  { width: 28px; object-fit: contain; }
.header-logo img.brand { height: 22px; object-fit: contain; }

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 7px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-logout:hover { border-color: rgba(255,255,255,0.45); color: #fff; }

.btn-compte {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.btn-compte:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.45); }
.btn-compte svg   { width: 17px; height: 17px; }

/* ── APP MAIN ────────────────────────────────────────────────── */

.app-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 52px 24px 88px;
}

/* ── HERO ────────────────────────────────────────────────────── */

.hero {
  margin-bottom: 52px;
}

.hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 14px;
}

.hero h1 .accent { color: var(--orange); }

.hero p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── SECTION LABEL ───────────────────────────────────────────── */

.section-label {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--orange);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── CARDS ───────────────────────────────────────────────────── */

.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

.card {
  background: var(--surface);
  border: 1.5px solid var(--c-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.10);
  border-color: var(--c-accent);
}
.card.open {
  border-color: var(--c-accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Card header */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.card-num {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--c-accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  transition: box-shadow 0.22s var(--ease), transform 0.22s var(--ease);
}

.card:hover .card-num  { transform: scale(1.06); }
.card.open .card-num   { box-shadow: 0 2px 8px rgba(0,0,0,0.18); transform: none; }

.card-info { min-width: 0; }

.card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: var(--c-bg);
  color: var(--c-accent);
  margin-bottom: 6px;
}

.card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.card-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.card-chevron {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s;
}

.card-chevron svg {
  width: 15px;
  height: 15px;
  stroke: var(--muted);
  transition: transform 0.3s var(--ease), stroke 0.25s;
}

.card.open .card-chevron     { background: var(--c-bg); border-color: var(--c-border); }
.card.open .card-chevron svg { transform: rotate(180deg); stroke: var(--c-accent); }

/* Card body */
.card-body {
  display: none;
  border-top: 1px solid var(--border);
}

.card.open .card-body {
  display: block;
  animation: fadeIn 0.25s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Video */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Workout details */
.workout {
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.w-block { display: flex; flex-direction: column; gap: 10px; }

.w-head  { display: flex; align-items: center; gap: 10px; }

.w-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.w-label {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.w-sub {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.badge-optional {
  display: inline-block;
  padding: 2px 7px;
  background: rgba(0,0,0,0.06);
  border-radius: 100px;
  font-size: 10px;
  color: var(--muted);
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  vertical-align: middle;
}

.ex-list {
  list-style: none;
  padding-left: 40px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ex-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
}

.ex-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-accent);
  flex-shrink: 0;
}

.timings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 40px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 13px;
  font-size: 13px;
  color: var(--muted);
}

.pill strong { color: var(--text); font-weight: 600; }

/* ── PERFIL MODAL ────────────────────────────────────────────── */

.perfil-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}

.perfil-modal {
  background: var(--surface);
  border-radius: 24px;
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  animation: popIn 0.25s var(--ease);
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.perfil-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.perfil-modal-close:hover { background: rgba(255,255,255,0.28); }
.perfil-modal-close svg   { width: 15px; height: 15px; }

.perfil-modal-hero {
  background: linear-gradient(160deg, #044BC5 0%, #022a7a 100%);
  padding: 44px 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
}

.perfil-page-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2.5px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.perfil-page-avatar svg { width: 38px; height: 38px; }

.perfil-page-nom {
  font-family: 'Poppins', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.perfil-page-badge {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 3px 13px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  font-family: 'Poppins', sans-serif;
}

.perfil-modal-body {
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perfil-info-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.perfil-info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
}

.perfil-info-icon {
  font-size: 18px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}

.perfil-info-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.perfil-info-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.perfil-info-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Poppins', sans-serif;
}

.perfil-info-sep {
  height: 1px;
  background: var(--border);
  margin: 0 18px;
}

.perfil-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(229,57,53,0.25);
  border-radius: 12px;
  padding: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #e53935;
  cursor: pointer;
  transition: background 0.2s;
}
.perfil-logout-btn:hover { background: rgba(229,57,53,0.06); }

.perfil-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,103,29,0.10);
  border: 2px solid rgba(255,103,29,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
}

.perfil-avatar svg { width: 32px; height: 32px; }

.perfil-nom {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.perfil-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.perfil-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 14px 8px;
}

.perfil-divider {
  width: 1px;
  background: var(--border);
  margin: 10px 0;
}

.perfil-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.perfil-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.perfil-data-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.perfil-data-val {
  color: var(--text);
  font-weight: 600;
}

/* ── GUIDE CARD ──────────────────────────────────────────────── */

.guide-card {
  background: linear-gradient(135deg, rgba(255,103,29,0.08) 0%, rgba(4,75,197,0.06) 100%);
  border: 1px solid rgba(255,103,29,0.22);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.guide-info { display: flex; align-items: center; gap: 16px; min-width: 0; }

.guide-icon {
  width: 50px;
  height: 50px;
  background: rgba(255,103,29,0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.guide-info h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.guide-info p { font-size: 13px; color: var(--muted); line-height: 1.4; }

.btn-download {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-download:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn-download svg    { width: 15px; height: 15px; stroke: currentColor; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .login-card   { padding: 36px 22px; }
  .app-main     { padding: 32px 16px 72px; }
  .card-head    { padding: 17px 16px; }
  .workout      { padding: 22px 16px; }
  .ex-list      { padding-left: 34px; }
  .timings      { padding-left: 34px; }

  .guide-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
  }

  .btn-download { width: 100%; justify-content: center; }
}
