/* ============================================================
   SHE BY SHERLEY — Members Area CSS
   Mismas variables de marca que el sitio principal
   ============================================================ */

:root {
  --rose:       #EAD6DC;
  --rose-deep:  #C9A8B4;
  --brown:      #4A2E2B;
  --brown-light:#7A5C59;
  --ivory:      #F8F6F4;
  --sage:       #A3B18A;
  --text-muted: #9A8480;
  --bg:         #F8F6F4;
  --white:      #FFFFFF;
  --error:      #C0392B;
  --success:    #27AE60;
  --border:     rgba(74,46,43,0.12);
  --shadow-sm:  0 2px 8px rgba(74,46,43,0.08);
  --shadow-md:  0 8px 32px rgba(74,46,43,0.12);
  --radius:     4px;
  --sidebar-w:  260px;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--brown);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ── TIPOGRAFÍA ── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  line-height: 1.2;
}
.section-tag {
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.section-tag::before {
  content: ''; width: 24px; height: 1px;
  background: currentColor; display: block; flex-shrink: 0;
}

/* ── ALERTAS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.83rem;
  margin-bottom: 20px;
}
.alert-error   { background: #fdf0ef; border: 1px solid #e8b4b0; color: var(--error); }
.alert-success { background: #edf7f1; border: 1px solid #a8d5b5; color: var(--success); }
.alert-info    { background: var(--rose); border: 1px solid var(--rose-deep); color: var(--brown); }

/* ── BOTONES ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  border: none; border-radius: var(--radius);
  text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.btn-primary { background: var(--brown); color: var(--ivory); }
.btn-primary:hover { background: #3a2220; transform: translateY(-1px); }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--brown); }
.btn-ghost:hover { border-color: var(--brown); }
.btn-rose { background: var(--rose); color: var(--brown); }
.btn-rose:hover { background: var(--rose-deep); }
.btn-sm { padding: 8px 18px; font-size: 0.65rem; }
.btn-danger { background: var(--error); color: white; }

/* ── FORMULARIOS GENERALES ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.5px; color: var(--brown);
  display: flex; justify-content: space-between; align-items: center;
}
.form-label-link { font-weight: 400; color: var(--text-muted); font-size: 0.72rem; }
.form-label-link:hover { color: var(--brown); }
.form-hint { font-weight: 300; color: var(--text-muted); }
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], textarea, select {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem; font-weight: 300;
  color: var(--brown);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--brown); }
input::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 100px; }
.input-password-wrap { position: relative; }
.input-password-wrap input { padding-right: 44px; }
.toggle-password {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-muted); font-size: 1rem; cursor: pointer;
  padding: 4px;
}

/* ══════════════════════════════════════════════
   AUTH PAGES (login, registro, recuperar)
   ══════════════════════════════════════════════ */
.auth-page {
  background: var(--rose);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-container {
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}
.auth-logo img { height: 36px; width: auto; }
.auth-card {
  width: 100%;
  background: var(--ivory);
  border-radius: 6px;
  padding: 48px 44px;
  box-shadow: var(--shadow-md);
}
.auth-title {
  font-size: 1.8rem; margin-bottom: 8px;
}
.auth-sub {
  font-size: 0.87rem; color: var(--text-muted); margin-bottom: 28px;
}
.auth-form { display: flex; flex-direction: column; }
.btn-auth {
  width: 100%;
  background: var(--brown); color: var(--ivory);
  padding: 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  border: none; border-radius: var(--radius);
  cursor: pointer; margin-top: 8px;
  transition: background 0.2s;
}
.btn-auth:hover { background: #3a2220; }
.auth-switch {
  text-align: center; margin-top: 24px;
  font-size: 0.82rem; color: var(--text-muted);
}
.auth-switch a { color: var(--brown); font-weight: 500; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-terms {
  font-size: 0.72rem; color: var(--text-muted);
  margin-bottom: 8px; line-height: 1.6;
}
.auth-terms a { color: var(--brown); }

/* ══════════════════════════════════════════════
   LAYOUT CON SIDEBAR (dashboard, programa, etc.)
   ══════════════════════════════════════════════ */
.members-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brown);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 50; overflow-y: auto;
  transition: transform 0.3s;
}
.sidebar-logo {
  padding: 28px 28px 24px;
  border-bottom: 1px solid rgba(248,246,244,0.08);
  display: block; text-decoration: none;
}
.sidebar-logo img { height: 28px; }
.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  display: flex; flex-direction: column;
  list-style: none;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px;
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.5px;
  color: rgba(248,246,244,0.55);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--ivory);
  background: rgba(248,246,244,0.06);
  border-left-color: var(--rose);
}
.sidebar-nav .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-badge {
  margin-left: auto;
  background: var(--rose);
  color: var(--brown);
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}
.sidebar-divider {
  height: 1px;
  background: rgba(248,246,244,0.08);
  margin: 8px 28px;
}
.sidebar-plan-badge {
  margin: 0 20px 20px;
  background: rgba(248,246,244,0.07);
  border: 1px solid rgba(248,246,244,0.1);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.sidebar-plan-badge .plan-label {
  font-size: 0.58rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--sage); display: block; margin-bottom: 4px;
}
.sidebar-plan-badge .plan-nombre {
  font-size: 0.8rem; font-weight: 500;
  color: var(--ivory);
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── TOP BAR ── */
.topbar {
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.topbar-title {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted);
}
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.topbar-notif {
  position: relative;
  background: none; border: none;
  font-size: 1.1rem; cursor: pointer; color: var(--brown);
  padding: 4px;
}
.notif-dot {
  position: absolute; top: 0; right: 0;
  width: 8px; height: 8px;
  background: var(--rose-deep); border-radius: 50%;
  border: 2px solid var(--ivory);
}
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--rose);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem; color: var(--brown);
  cursor: pointer; text-decoration: none;
  font-weight: 500;
}
.mobile-menu-btn {
  display: none;
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer; color: var(--brown);
}

/* ── PAGE CONTENT ── */
.page-content { padding: 40px; flex: 1; }
.page-header { margin-bottom: 36px; }
.page-header h1 { font-size: 2rem; margin-bottom: 8px; }
.page-header p { color: var(--text-muted); font-size: 0.88rem; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 1rem; font-family: 'Playfair Display', serif;
  margin-bottom: 16px;
}

/* ── GRID HELPERS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 6px; padding: 24px 28px;
}
.stat-card .stat-label {
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px; display: block;
}
.stat-card .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem; font-weight: 500; color: var(--brown);
  line-height: 1;
}
.stat-card .stat-unit {
  font-size: 0.75rem; font-weight: 400;
  color: var(--text-muted); margin-left: 4px;
}
.stat-card .stat-delta {
  font-size: 0.75rem; margin-top: 6px; display: block;
  color: var(--success);
}
.stat-card .stat-delta.neg { color: var(--error); }

/* ── PROGRESS BAR ── */
.progress-bar-wrap {
  background: var(--rose); border-radius: 20px;
  height: 6px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--brown);
  border-radius: 20px; transition: width 0.6s ease;
}

/* ── VIDEO CARDS ── */
.video-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; display: block;
}
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.video-thumb {
  aspect-ratio: 16/9;
  position: relative; overflow: hidden;
  background: var(--brown);
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.video-thumb .play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.play-circle {
  width: 48px; height: 48px;
  background: var(--rose); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--brown);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.video-complete-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--success); color: white;
  font-size: 0.6rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
}
.video-info { padding: 16px 18px; }
.video-title { font-size: 0.88rem; font-weight: 500; color: var(--brown); margin-bottom: 4px; }
.video-meta { font-size: 0.72rem; color: var(--text-muted); display: flex; gap: 12px; }

/* ── MÓDULO ACCORDION ── */
.modulo-block { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.modulo-header {
  background: var(--white); padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
  transition: background 0.2s;
}
.modulo-header:hover { background: var(--bg); }
.modulo-header.open { background: var(--brown); color: var(--ivory); }
.modulo-title { font-family: 'Playfair Display', serif; font-size: 1rem; }
.modulo-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.modulo-header.open .modulo-meta { color: rgba(248,246,244,0.55); }
.modulo-toggle { font-size: 1.2rem; transition: transform 0.3s; }
.modulo-header.open .modulo-toggle { transform: rotate(45deg); }
.modulo-videos { display: none; padding: 8px; background: var(--bg); }
.modulo-videos.open { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 10px; }

/* ── COMUNIDAD / POSTS ── */
.post-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 6px; padding: 24px 28px; margin-bottom: 12px;
}
.post-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--rose); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 0.9rem; font-weight: 500;
  color: var(--brown);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author-name { font-size: 0.85rem; font-weight: 600; color: var(--brown); }
.post-plan-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--rose); color: var(--brown);
  font-size: 0.58rem; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 20px;
  margin-left: 6px;
}
.post-date { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.post-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; margin-bottom: 8px; }
.post-content { font-size: 0.85rem; font-weight: 300; line-height: 1.75; color: var(--brown-light); }
.post-photo { margin: 14px 0; border-radius: 4px; overflow: hidden; max-height: 400px; }
.post-photo img { width: 100%; object-fit: cover; }
.post-actions { display: flex; align-items: center; gap: 20px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.post-action-btn {
  background: none; border: none; padding: 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: color 0.2s;
}
.post-action-btn:hover, .post-action-btn.liked { color: var(--brown); }
.post-action-btn .icon { font-size: 1rem; }

/* ── MEDIDAS / PROGRESO ── */
.medidas-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.medidas-form .full-width { grid-column: 1 / -1; }
.chart-wrap { background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 24px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: block; }
  .page-content { padding: 24px 20px; }
  .topbar { padding: 0 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .auth-card { padding: 36px 28px; }
  .medidas-form { grid-template-columns: 1fr; }
}
