/* ==========================================================================
   ÁREA DE MIEMBROS — Club BRAVO
   Extiende styles.css. Estética: más calma, más aire, menos "venta".
   ========================================================================== */

.app-shell{ min-height:100vh; display:flex; }
.app-side{
  width: 260px; flex:none; background: var(--plum-2); color: var(--paper);
  padding: 26px 20px; display:flex; flex-direction:column; gap: 6px;
}
.app-side .brand-word{ color: var(--paper); }
.app-side .brand-word em{ color: var(--ember-soft); }
.app-nav{ margin-top: 30px; display:flex; flex-direction:column; gap:4px; }
.app-nav a{
  display:flex; align-items:center; gap:10px; text-decoration:none; color: rgba(246,239,226,.75);
  font-weight:600; font-size:.92rem; padding: 11px 14px; border-radius: 10px; transition: background .2s ease, color .2s ease;
}
.app-nav a:hover{ background: rgba(246,239,226,.08); color: var(--paper); }
.app-nav a.active{ background: var(--clay); color: var(--paper); }
.app-status{ margin-top:auto; background: rgba(246,239,226,.06); border-radius: 12px; padding: 14px; font-size: .78rem; }
.app-status strong{ display:block; color: var(--ember-soft); font-family: var(--font-display); font-size:1rem; margin-bottom:2px; }
.app-main{ flex:1; padding: 40px clamp(20px,4vw,56px); max-width: 1100px; }
@media (max-width: 880px){
  .app-shell{ flex-direction:column; }
  .app-side{ width:auto; flex-direction: row; flex-wrap:wrap; align-items:center; }
  .app-nav{ flex-direction:row; margin-top:0; flex-wrap:wrap; }
  .app-status{ margin-top:0; margin-left:auto; }
}

.app-greeting{ margin-bottom: 34px; }
.app-greeting .eyebrow{ margin-bottom: 8px; }

.card-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
@media (max-width: 900px){ .card-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px){ .card-grid{ grid-template-columns: 1fr; } }

.app-card{
  background: var(--paper); border: 1px solid var(--paper-line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-soft);
}
.app-card h3{ margin-bottom: .3em; }
.app-card .muted{ font-size:.88rem; }

/* Racha / gamificación */
.streak-row{ display:flex; align-items:center; gap: 14px; margin-top: 10px; }
.streak-flame{ font-size: 2.2rem; }
.streak-count{ font-family: var(--font-display); font-size: 2rem; color: var(--clay-dark); }
.badge-row{ display:flex; gap:10px; margin-top:16px; flex-wrap:wrap; }
.badge{
  width: 54px; height:54px; border-radius: 14px; display:flex; align-items:center; justify-content:center;
  font-size: 1.4rem; background: var(--paper-2); border: 1px solid var(--paper-line); position:relative;
}
.badge.unlocked{ background: linear-gradient(160deg, var(--ember-soft), var(--ember)); border-color: var(--ember); }
.badge.locked{ opacity:.4; filter: grayscale(1); }
.badge-label{ font-size:.62rem; text-align:center; color: var(--ink-soft); margin-top:4px; }
.progress-track{ height: 8px; background: var(--paper-2); border-radius: 999px; overflow:hidden; margin-top:10px; }
.progress-fill{ height:100%; background: linear-gradient(90deg, var(--sage), var(--sage-dark)); border-radius: 999px; transition: width .5s ease; }

/* Respiración guiada */
.breath-widget{ text-align:center; padding: 30px 10px; }
.breath-orb-wrap{ display:flex; align-items:center; justify-content:center; height: 220px; }
.breath-orb{
  width: 130px; height:130px; border-radius:50%;
  background: radial-gradient(circle at 35% 30%, var(--sage), var(--sage-dark));
  box-shadow: 0 0 0 14px rgba(110,124,86,.12), 0 0 60px rgba(110,124,86,.25);
  transition: transform 4s ease-in-out;
  display:flex; align-items:center; justify-content:center; color: var(--paper); font-weight:700; font-size:.85rem;
}
.breath-orb.inhale{ transform: scale(1.35); transition-duration: 4s; }
.breath-orb.hold{ transform: scale(1.35); transition-duration: .2s; }
.breath-orb.exhale{ transform: scale(.85); transition-duration: 6s; }
.breath-controls{ display:flex; gap: 10px; justify-content:center; margin-top: 18px; flex-wrap:wrap; }
.breath-pattern-select{ display:flex; gap:8px; justify-content:center; margin-bottom: 18px; flex-wrap:wrap; }
.breath-pattern-select button{
  border: 1.5px solid var(--paper-line); background: var(--paper); border-radius: 999px; padding: 8px 14px;
  font-size:.8rem; font-weight:700; color: var(--ink-soft);
}
.breath-pattern-select button.active{ border-color: var(--sage-dark); color: var(--sage-dark); background: rgba(110,124,86,.1); }
.breath-timer{ font-family: var(--font-display); font-size: 1.1rem; color: var(--ink-soft); margin-top: 12px; }

/* Compositor emocional (microlecturas) */
.composer-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px){ .composer-grid{ grid-template-columns: 1fr; } }
.chip-select{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.chip-option{
  border: 1.5px solid var(--paper-line); background: var(--paper); border-radius: 999px;
  padding: 8px 14px; font-size:.82rem; font-weight:700; color: var(--ink-soft); transition: all .18s ease;
}
.chip-option:hover{ border-color: var(--clay); }
.chip-option.selected{ background: var(--clay); border-color: var(--clay); color: var(--paper); }
.composer-textarea{
  width:100%; border: 1.5px solid var(--paper-line); border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size:.9rem; resize: vertical; min-height: 70px; background: var(--paper); color: var(--ink);
}
.composer-textarea:focus{ outline:none; border-color: var(--clay); }
.reading-result{
  margin-top: 22px; background: var(--paper-2); border-left: 4px solid var(--clay); border-radius: 10px;
  padding: 22px 24px; display:none;
}
.reading-result.show{ display:block; animation: fadeUp .5s ease; }
.reading-result h4{ font-family: var(--font-display); font-style:italic; color: var(--clay-dark); margin-bottom: 10px; }
.reading-result p{ font-size:.95rem; color: var(--ink-soft); }
@keyframes fadeUp{ from{ opacity:0; transform: translateY(10px);} to{ opacity:1; transform:none; } }

/* Recursos exclusivos */
.resource-row{ display:flex; align-items:center; gap:16px; padding: 16px 0; border-bottom: 1px solid var(--paper-line); }
.resource-row:last-child{ border-bottom:none; }
.resource-icon{ width:44px; height:44px; border-radius: 10px; background: var(--paper-2); display:flex; align-items:center; justify-content:center; font-size:1.2rem; flex:none; }
.resource-row h4{ margin:0 0 2px; font-size:.98rem; font-family: var(--font-body); font-weight:700; }
.resource-row p{ margin:0; font-size:.8rem; color: var(--ink-soft); }
.resource-row .btn{ margin-left:auto; flex:none; }

/* Microlecturas biblioteca */
.reading-lib-item{ padding: 14px 0; border-bottom: 1px solid var(--paper-line); cursor:pointer; }
.reading-lib-item:last-child{ border-bottom:none; }
.reading-lib-item h4{ margin:0 0 4px; font-size:.95rem; }
.reading-lib-item p{ margin:0; font-size:.82rem; color: var(--ink-soft); }

/* Estado de suscripción restringida */
.lock-screen{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding: 40px 20px; }
.lock-card{ max-width: 460px; text-align:center; background: var(--paper); border: 1px solid var(--paper-line); border-radius: var(--radius-lg); padding: 44px 36px; box-shadow: var(--shadow-lift); }
.lock-icon{ font-size: 2.6rem; margin-bottom: 14px; }

/* Login */
.auth-shell{ min-height:100vh; display:grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px){ .auth-shell{ grid-template-columns: 1fr; } }
.auth-visual{ background: linear-gradient(160deg, var(--plum), var(--plum-2)); color: var(--paper); padding: 60px 50px; display:flex; flex-direction:column; justify-content:space-between; }
@media (max-width: 860px){ .auth-visual{ display:none; } }
.auth-form-side{ display:flex; align-items:center; justify-content:center; padding: 40px 24px; }
.auth-form{ width:100%; max-width: 380px; }

/* Acceso con Google del equipo (bajo el formulario de miembros) */
.auth-google{ margin-top: 22px; }
.auth-divider{
  display:flex; align-items:center; gap:12px; margin-bottom:16px;
  color: var(--ink-soft); font-size:.7rem; text-transform:uppercase; letter-spacing:.1em;
}
.auth-divider::before, .auth-divider::after{
  content:""; flex:1; height:1px; background: var(--paper-line);
}
.auth-google-btn{ display:flex; justify-content:center; min-height:44px; }
.field{ margin-bottom: 18px; }
.field label{ display:block; font-size:.82rem; font-weight:700; margin-bottom:6px; color: var(--ink-soft); }
.field input, .field select{
  width:100%; border: 1.5px solid var(--paper-line); border-radius: 10px; padding: 12px 14px;
  font-family: inherit; font-size:.92rem; background: var(--paper); color: var(--ink);
}
.field input:focus, .field select:focus{ outline:none; border-color: var(--clay); }
.field-error{ color: var(--danger); font-size:.78rem; margin-top:4px; display:none; }
.form-msg{ font-size:.85rem; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; display:none; }
.form-msg.show{ display:block; }
.form-msg.error{ background: rgba(168,59,50,.1); color: var(--danger); }
.form-msg.ok{ background: rgba(79,122,84,.12); color: var(--ok); }

/* ---- FIDELIZACION TIER BADGES ---- */
.tier-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tier-bronce {
    background: linear-gradient(135deg, #cd7f32, #a05a1d);
    color: #fff;
    box-shadow: 0 2px 5px rgba(205,127,50,0.3);
}
.tier-plata {
    background: linear-gradient(135deg, #e0e0e0, #9e9e9e);
    color: #333;
    box-shadow: 0 2px 5px rgba(158,158,158,0.3);
}
.tier-oro {
    background: linear-gradient(135deg, #ffd700, #daa520);
    color: #5a3a00;
    box-shadow: 0 2px 5px rgba(218,165,32,0.4);
}

/* ---- STAR PROGRESS BAR ---- */
.star-progress-bar {
    position: relative;
    height: 24px;
    background: var(--paper-2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.star-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--gold), #ffdf00);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.stars-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    pointer-events: none;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ---- GAMIFICATION ANIMATIONS ---- */
@keyframes levelUpPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    50% { transform: scale(1.3); box-shadow: 0 0 20px 10px rgba(255, 215, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.level-up-anim {
    animation: levelUpPulse 0.8s cubic-bezier(0.25, 1.5, 0.5, 1) forwards !important;
}

@keyframes goldGlow {
    0% { box-shadow: 0 0 5px rgba(218,165,32,0.4); }
    50% { box-shadow: 0 0 20px rgba(255,215,0,0.8); }
    100% { box-shadow: 0 0 5px rgba(218,165,32,0.4); }
}

@keyframes shineSweep {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

.tier-oro {
    background: linear-gradient(135deg, #ffd700 20%, #ffdf00 40%, #ffffff 50%, #ffdf00 60%, #daa520 80%);
    background-size: 200% auto;
    animation: goldGlow 2s infinite, shineSweep 3s infinite linear;
    border: 1px solid #ffea70;
}

/* Enhancing the Progress Bar */
.star-progress-bar {
    border: 1px solid rgba(0,0,0,0.05);
}
.star-progress-fill {
    position: relative;
    overflow: hidden;
}
.star-progress-fill::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shineSweep 2s infinite;
}
