/* ─── Variables (comparte paleta con landing) ────────────────────────────── */
:root {
    --bg:        #0d0d0d;
    --bg2:       #111;
    --bg3:       #1a1a1a;
    --bg4:       #222;
    --accent:    #ff6b00;
    --accent-h:  #e05a00;
    --green:     #34d399;
    --yellow:    #fbbf24;
    --red:       #f87171;
    --blue:      #60a5fa;
    --text:      #e2e8f0;
    --muted:     #94a3b8;
    --muted2:    #555;
    --border:    #1e1e1e;
    --radius:    14px;
    --radius-sm: 8px;
    --nav-h:     64px;
    --safe-bot:  env(safe-area-inset-bottom, 0px);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}
a { color: var(--accent); text-decoration: none; }

/* ─── LOGIN SCREEN ───────────────────────────────────────────────────────── */
.login-wrap {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(ellipse at 50% 0%, rgba(255,107,0,.15) 0%, transparent 65%);
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
}
.login-gym-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: .25rem;
}
.login-subtitle {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 2rem;
}
.mp-label  { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .5px; }
.mp-input  { width: 100%; background: var(--bg3); border: 1px solid var(--bg4); border-radius: var(--radius-sm); padding: .7rem .9rem; color: var(--text); font-size: 1rem; font-family: inherit; transition: border-color .2s; }
.mp-input:focus { outline: none; border-color: var(--accent); }
.mp-input.is-invalid { border-color: var(--red); }
.mp-field  { margin-bottom: 1.1rem; }
.mp-btn {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: .8rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, transform .1s;
    margin-top: .5rem;
}
.mp-btn:active { transform: scale(.98); }
.mp-btn:disabled { opacity: .6; cursor: not-allowed; }
.mp-btn-outline {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .7rem;
    font-size: .9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    margin-top: .6rem;
    transition: border-color .2s, color .2s;
}
.mp-btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.mp-error {
    background: rgba(248,113,113,.1);
    border: 1px solid rgba(248,113,113,.25);
    color: var(--red);
    border-radius: var(--radius-sm);
    padding: .6rem .75rem;
    font-size: .82rem;
    margin-bottom: .9rem;
}
.mp-link { text-align: center; margin-top: 1.25rem; font-size: .82rem; color: var(--muted); }
.mp-link a { color: var(--accent); font-weight: 600; }

/* ─── PIN INPUT ──────────────────────────────────────────────────────────── */
.pin-input-wrap { display: flex; gap: .5rem; justify-content: center; margin-bottom: .5rem; }
.pin-dot {
    width: 48px; height: 48px;
    border: 2px solid var(--bg4);
    border-radius: 10px;
    background: var(--bg3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    transition: border-color .2s;
}
.pin-dot.filled  { border-color: var(--accent); }
.pin-dot.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,0,.2); }
.pin-real-input  { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.pin-trigger     { cursor: pointer; -webkit-user-select: none; user-select: none; }

/* ─── PORTAL LAYOUT ──────────────────────────────────────────────────────── */
.portal-root { display: none; flex-direction: column; min-height: 100dvh; }
.portal-root.visible { display: flex; }

.portal-topbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1rem;
    padding-top: calc(.75rem + env(safe-area-inset-top, 0px));
}
.portal-topbar .gym-name { font-size: 1rem; font-weight: 700; color: var(--accent); }
.portal-topbar .member-chip {
    display: flex; align-items: center; gap: .5rem;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 50px; padding: .3rem .75rem;
}
.portal-topbar .member-avatar {
    width: 28px; height: 28px;
    background: rgba(255,107,0,.2); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: var(--accent);
}
.portal-topbar .member-name { font-size: .8rem; font-weight: 600; color: #ddd; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.portal-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: calc(var(--nav-h) + var(--safe-bot) + 1rem);
}

/* ─── BOTTOM NAV ─────────────────────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--nav-h) + var(--safe-bot));
    padding-bottom: var(--safe-bot);
    background: var(--bg2);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
}
.nav-tab {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .2rem;
    font-size: .65rem; font-weight: 600;
    color: var(--muted2);
    cursor: pointer;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
    border: none; background: none;
    padding: .5rem 0;
}
.nav-tab i { font-size: 1.25rem; transition: transform .15s; }
.nav-tab.active { color: var(--accent); }
.nav-tab.active i { transform: translateY(-2px); }

/* ─── SECTION PANES ──────────────────────────────────────────────────────── */
.portal-pane { display: none; }
.portal-pane.active { display: block; }

/* ─── STATUS CARD (Inicio) ───────────────────────────────────────────────── */
.status-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.status-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--glow-color, rgba(255,107,0,.08)) 0%, transparent 70%);
    pointer-events: none;
}
.status-card.activo    { --glow-color: rgba(52,211,153,.1); }
.status-card.por_vencer{ --glow-color: rgba(251,191,36,.1); }
.status-card.vencido   { --glow-color: rgba(248,113,113,.1); }
.status-card.sin_plan  { --glow-color: rgba(255,107,0,.06); }

/* Progress ring */
.ring-wrap { position: relative; width: 130px; height: 130px; margin: 0 auto 1.25rem; }
.ring-svg   { transform: rotate(-90deg); }
.ring-bg    { fill: none; stroke: var(--bg3); stroke-width: 10; }
.ring-fill  { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1); }
.ring-fill.activo     { stroke: var(--green); }
.ring-fill.por_vencer { stroke: var(--yellow); }
.ring-fill.vencido    { stroke: var(--red); }
.ring-fill.sin_plan   { stroke: var(--muted2); }
.ring-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.ring-dias   { font-size: 2rem; font-weight: 800; line-height: 1; }
.ring-label  { font-size: .68rem; color: var(--muted); font-weight: 500; margin-top: .1rem; }

.status-plan-name { font-size: 1.1rem; font-weight: 700; margin-bottom: .3rem; }
.status-venc-date { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }

.status-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .9rem; border-radius: 50px;
    font-size: .78rem; font-weight: 700;
}
.badge-activo     { background: rgba(52,211,153,.12);  color: var(--green);  border: 1px solid rgba(52,211,153,.25); }
.badge-por_vencer { background: rgba(251,191,36,.12);  color: var(--yellow); border: 1px solid rgba(251,191,36,.25); }
.badge-vencido    { background: rgba(248,113,113,.12); color: var(--red);    border: 1px solid rgba(248,113,113,.25); }
.badge-sin_plan   { background: rgba(148,163,184,.1);  color: var(--muted);  border: 1px solid rgba(148,163,184,.2); }
.badge-vence_hoy  { background: rgba(251,191,36,.15);  color: var(--yellow); border: 1px solid rgba(251,191,36,.3); }

/* ─── QUICK INFO CARDS ───────────────────────────────────────────────────── */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.quick-card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 1rem;
}
.quick-card .val  { font-size: 1.6rem; font-weight: 800; line-height: 1; margin-bottom: .2rem; }
.quick-card .lbl  { font-size: .72rem; color: var(--muted); font-weight: 500; }
.quick-card .ico  { font-size: 1.1rem; margin-bottom: .4rem; }

/* ─── ACTION BUTTONS ─────────────────────────────────────────────────────── */
.action-btn {
    display: flex; align-items: center; justify-content: center; gap: .6rem;
    width: 100%;
    padding: .85rem;
    border-radius: var(--radius-sm);
    font-size: .95rem; font-weight: 700;
    font-family: inherit; cursor: pointer;
    border: none;
    transition: background .2s, transform .1s;
    margin-bottom: .6rem;
}
.action-btn:active { transform: scale(.98); }
.action-btn.primary   { background: var(--accent); color: #fff; }
.action-btn.primary:hover { background: var(--accent-h); }
.action-btn.warning   { background: rgba(251,191,36,.15); color: var(--yellow); border: 1px solid rgba(251,191,36,.3); }
.action-btn.secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.action-btn.danger    { background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.25); }

.today-check {
    display: flex; align-items: center; gap: .75rem;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: .9rem 1rem;
    margin-bottom: 1rem;
}
.today-check .check-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.today-check .check-icon.yes { background: rgba(52,211,153,.15); color: var(--green); }
.today-check .check-icon.no  { background: var(--bg3); color: var(--muted2); }
.today-check .check-text .title { font-size: .9rem; font-weight: 600; }
.today-check .check-text .sub   { font-size: .75rem; color: var(--muted); }

/* ─── CALENDAR (Asistencias) ─────────────────────────────────────────────── */
.cal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .75rem;
}
.cal-header .cal-title { font-size: 1rem; font-weight: 700; }
.cal-nav-btn {
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text); border-radius: 8px; padding: .4rem .75rem;
    font-size: .85rem; cursor: pointer;
}
.cal-grid {
    display: grid; grid-template-columns: repeat(7,1fr);
    gap: .3rem; margin-bottom: 1.25rem;
}
.cal-day-head { text-align: center; font-size: .68rem; color: var(--muted); font-weight: 700; padding: .2rem 0; }
.cal-day {
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    font-size: .8rem;
    color: var(--muted2);
    background: transparent;
}
.cal-day.has-visit {
    background: rgba(52,211,153,.15);
    color: var(--green);
    font-weight: 700;
}
.cal-day.today {
    border: 2px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
}
.cal-day.today.has-visit {
    background: rgba(255,107,0,.12);
    border-color: var(--accent);
    color: var(--accent);
}
.cal-day.other-month { opacity: .25; }

.section-title { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: .6rem; }

/* ─── ATTENDANCE LIST ────────────────────────────────────────────────────── */
.visit-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 0; border-bottom: 1px solid var(--border);
}
.visit-item:last-child { border-bottom: none; }
.visit-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: .9rem;
}
.visit-icon.entrada { background: rgba(52,211,153,.12); color: var(--green); }
.visit-icon.salida  { background: rgba(148,163,184,.08); color: var(--muted); }
.visit-date  { font-size: .88rem; font-weight: 600; }
.visit-time  { font-size: .75rem; color: var(--muted); }

/* ─── PAYMENT LIST ───────────────────────────────────────────────────────── */
.payment-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: .6rem;
}
.payment-item .pago-icon {
    width: 40px; height: 40px;
    background: rgba(96,165,250,.1); color: var(--blue);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 1.1rem;
}
.payment-item .pago-body { flex: 1; min-width: 0; }
.payment-item .pago-plan  { font-size: .88rem; font-weight: 700; }
.payment-item .pago-meta  { font-size: .74rem; color: var(--muted); }
.payment-item .pago-monto { font-size: 1rem; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.pago-badge {
    display: inline-block; padding: .15rem .5rem;
    border-radius: 50px; font-size: .68rem; font-weight: 700;
    margin-top: .2rem;
}
.pago-badge.confirmado { background: rgba(52,211,153,.12); color: var(--green); }
.pago-badge.pendiente  { background: rgba(251,191,36,.12);  color: var(--yellow); }
.pago-badge.cancelado  { background: rgba(148,163,184,.08); color: var(--muted); }

/* ─── PROFILE ────────────────────────────────────────────────────────────── */
.profile-avatar-wrap { text-align: center; margin: .5rem 0 1.5rem; }
.profile-avatar {
    width: 72px; height: 72px;
    background: rgba(255,107,0,.15);
    border: 2px solid rgba(255,107,0,.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; font-weight: 800;
    color: var(--accent);
    margin: 0 auto .6rem;
}
.profile-full-name { font-size: 1.1rem; font-weight: 700; }
.profile-dni       { font-size: .82rem; color: var(--muted); }

.profile-section {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    margin-bottom: .9rem;
}
.profile-section-head {
    padding: .75rem 1rem;
    font-size: .72rem; font-weight: 700;
    color: var(--muted); text-transform: uppercase; letter-spacing: .8px;
    border-bottom: 1px solid var(--border);
}
.profile-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-row-label { font-size: .85rem; color: var(--muted); }
.profile-row-value { font-size: .9rem; font-weight: 600; color: var(--text); text-align: right; }
.profile-edit-btn {
    background: none; border: none; color: var(--accent);
    font-size: .82rem; font-weight: 600; cursor: pointer; padding: 0;
    font-family: inherit;
}

/* ─── MODAL (shared) ─────────────────────────────────────────────────────── */
.mp-modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,.75);
    display: flex; align-items: flex-end;
    padding: 0;
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
}
.mp-modal-overlay.open { opacity: 1; pointer-events: all; }
.mp-modal-sheet {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.25rem 1.25rem calc(1.25rem + var(--safe-bot));
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    max-height: 90dvh;
    overflow-y: auto;
}
.mp-modal-overlay.open .mp-modal-sheet { transform: translateY(0); }
.mp-modal-handle {
    width: 40px; height: 4px;
    background: var(--bg4); border-radius: 2px;
    margin: 0 auto .9rem;
}
.mp-modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1.25rem; }

/* ─── REGISTRO WIZARD ────────────────────────────────────────────────────── */
.reg-wrap {
    min-height: 100dvh;
    background: var(--bg);
    padding: 0;
    display: flex;
    flex-direction: column;
}
.reg-topbar {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.25rem;
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}
.reg-topbar .back-btn {
    background: none; border: none; color: var(--muted);
    font-size: 1.2rem; cursor: pointer; padding: .25rem;
    display: flex; align-items: center;
}
.reg-topbar .reg-gym-name { font-size: 1rem; font-weight: 700; color: var(--accent); }
.reg-body { flex: 1; padding: 1.25rem; max-width: 480px; margin: 0 auto; width: 100%; }

/* Stepper */
.stepper { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-bottom: 1.75rem; }
.step-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700;
    background: var(--bg3); color: var(--muted);
    border: 2px solid var(--border);
    transition: all .2s;
}
.step-dot.active   { background: var(--accent); color: #fff; border-color: var(--accent); }
.step-dot.done     { background: rgba(52,211,153,.15); color: var(--green); border-color: rgba(52,211,153,.4); }
.step-line { flex: 1; height: 2px; background: var(--border); max-width: 40px; }
.step-line.done { background: var(--green); }

.reg-step { display: none; }
.reg-step.active { display: block; }
.reg-step-title { font-size: 1.2rem; font-weight: 700; margin-bottom: .4rem; }
.reg-step-sub   { font-size: .85rem; color: var(--muted); margin-bottom: 1.5rem; }

/* Plan cards in registration */
.reg-plans { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.reg-plan-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    display: flex; align-items: center; gap: .9rem;
    position: relative;
}
.reg-plan-card.selected { border-color: var(--accent); background: rgba(255,107,0,.06); }
.reg-plan-card.featured { border-color: rgba(255,107,0,.4); }
.reg-plan-dot {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0; transition: all .15s;
    display: flex; align-items: center; justify-content: center;
}
.reg-plan-card.selected .reg-plan-dot { background: var(--accent); border-color: var(--accent); }
.reg-plan-card.selected .reg-plan-dot::after { content: '✓'; font-size: .65rem; color: #fff; font-weight: 900; }
.reg-plan-info { flex: 1; }
.reg-plan-name  { font-size: .95rem; font-weight: 700; }
.reg-plan-desc  { font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.reg-plan-price { font-size: 1.1rem; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.reg-plan-feat  { position: absolute; top: -.6rem; right: .9rem; background: var(--accent); color: #fff; padding: .1rem .6rem; border-radius: 50px; font-size: .65rem; font-weight: 700; }
.reg-skip { text-align: center; margin-top: .5rem; }
.reg-skip a { font-size: .82rem; color: var(--muted); }
.reg-skip a:hover { color: var(--accent); }

/* Success screen */
.success-screen { text-align: center; padding: 2rem 0; }
.success-icon {
    width: 72px; height: 72px;
    background: rgba(52,211,153,.12);
    border: 2px solid rgba(52,211,153,.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--green);
    margin: 0 auto 1.25rem;
}
.success-title { font-size: 1.3rem; font-weight: 700; margin-bottom: .75rem; }
.success-text  { font-size: .9rem; color: var(--muted); line-height: 1.6; margin-bottom: 1.75rem; }
.pin-reveal {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 1rem;
    text-align: center; margin-bottom: 1.5rem;
}
.pin-reveal-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .3rem; }
.pin-reveal-value { font-size: 1.6rem; font-weight: 800; letter-spacing: .4rem; color: var(--accent); }

/* ─── EMPTY STATES ───────────────────────────────────────────────────────── */
.mp-empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted2); }
.mp-empty i { font-size: 2.5rem; opacity: .35; display: block; margin-bottom: .75rem; }
.mp-empty p { font-size: .88rem; }

/* ─── RENEWAL PLAN CARDS ─────────────────────────────────────────────────── */
.renew-plan-card {
    border: 2px solid var(--border); border-radius: var(--radius);
    padding: 1rem; cursor: pointer; transition: border-color .2s, background .2s;
    margin-bottom: .6rem; display: flex; align-items: center; gap: .85rem;
}
.renew-plan-card.selected { border-color: var(--accent); background: rgba(255,107,0,.05); }
.renew-plan-card .rp-name  { font-size: .92rem; font-weight: 700; }
.renew-plan-card .rp-dur   { font-size: .74rem; color: var(--muted); }
.renew-plan-card .rp-price { font-size: 1.05rem; font-weight: 800; color: var(--accent); margin-left: auto; flex-shrink: 0; }

/* ─── LOADING SPINNER ────────────────────────────────────────────────────── */
.mp-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── PENDING / SUSPENDED BANNERS ───────────────────────────────────────────── */
.pending-banner {
    background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25);
    border-radius: var(--radius); padding: 1rem 1.1rem;
    margin-bottom: 1rem; display: flex; align-items: flex-start; gap: .75rem;
}
.pending-banner .pb-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    background: rgba(251,191,36,.15); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--yellow);
}
.pending-banner .pb-title { font-size: .92rem; font-weight: 700; color: var(--yellow); margin-bottom: .2rem; }
.pending-banner .pb-text  { font-size: .8rem; color: var(--muted); line-height: 1.5; }
.suspended-banner {
    background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.25);
    border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; text-align: center;
}
.suspended-banner .sb-title { font-size: 1rem; font-weight: 700; color: var(--red); margin-bottom: .3rem; }
.suspended-banner .sb-text  { font-size: .85rem; color: var(--muted); }

/* ─── STREAK ─────────────────────────────────────────────────────────────────── */
.streak-card {
    background: linear-gradient(135deg, rgba(255,107,0,.1), rgba(255,107,0,.04));
    border: 1px solid rgba(255,107,0,.2); border-radius: var(--radius-sm);
    padding: .85rem 1rem; display: flex; align-items: center; gap: .75rem;
    margin-bottom: 1rem;
}
.streak-icon  { font-size: 1.4rem; flex-shrink: 0; }
.streak-count { font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1; }
.streak-label { font-size: .72rem; color: var(--muted); }

/* ─── SCHEDULE NOTE ──────────────────────────────────────────────────────────── */
.schedule-note { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; }
.schedule-note-title { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .5rem; }
.schedule-note-row { display: flex; justify-content: space-between; font-size: .82rem; padding: .2rem 0; }
.schedule-note-row span:first-child { color: var(--muted); }
.schedule-note-row span:last-child  { font-weight: 600; }

/* ─── TOAST ──────────────────────────────────────────────────────────────── */
.mp-toast {
    position: fixed; bottom: calc(var(--nav-h) + var(--safe-bot) + .75rem);
    left: 50%; transform: translateX(-50%) translateY(120%);
    background: #1e1e1e; border: 1px solid var(--border);
    border-radius: 50px; padding: .6rem 1.4rem;
    font-size: .85rem; font-weight: 600; color: var(--text);
    white-space: nowrap; z-index: 999;
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .25s;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    max-width: 88vw; text-align: center;
    cursor: pointer; -webkit-user-select: none; user-select: none;
    will-change: transform;
}
.mp-toast.show { transform: translateX(-50%) translateY(0); }
.mp-toast.success { background: rgba(52,211,153,.15);  border-color: rgba(52,211,153,.4);  color: var(--green); }
.mp-toast.error   { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.4); color: var(--red); }
.mp-toast.warning { background: rgba(251,191,36,.12);  border-color: rgba(251,191,36,.35); color: var(--yellow); }

/* ─── DESKTOP CENTERING ──────────────────────────────────────────────────── */
@media (min-width: 540px) {
    .portal-root {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 0 100vw rgba(0,0,0,.5);
    }
    .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
    .mp-toast   { bottom: calc(var(--nav-h) + var(--safe-bot) + 1.5rem); }
}

/* ─── Routines ──────────────────────────────────────────────────────────── */
.rtn-today-card {
    display: flex; align-items: center; gap: .85rem;
    background: linear-gradient(135deg, rgba(255,107,0,.12), rgba(255,107,0,.04));
    border: 1px solid rgba(255,107,0,.25);
    border-radius: var(--radius); padding: 1rem 1.1rem;
}
.rtn-today-card.rest {
    background: rgba(255,255,255,.03); border-color: var(--border);
}
.rtn-today-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(255,107,0,.15); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.rtn-today-card.rest .rtn-today-icon { background: rgba(255,255,255,.05); color: var(--muted2); }
.rtn-today-label { font-weight: 700; font-size: .95rem; }
.rtn-today-sub   { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.rtn-today-btn   {
    margin-left: auto; background: var(--accent); color: #fff; border: none;
    border-radius: 8px; padding: .45rem .85rem; font-size: .82rem; font-weight: 600;
    cursor: pointer; white-space: nowrap; flex-shrink: 0; font-family: inherit;
}
.rtn-section-title { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: .65rem; }
.rtn-week-strip {
    display: grid; grid-template-columns: repeat(7,1fr); gap: .35rem;
}
.rtn-week-day {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 10px; padding: .6rem .2rem; cursor: pointer; transition: border-color .15s;
}
.rtn-week-day:not(.rest):hover { border-color: var(--accent); }
.rtn-week-day.today { border-color: var(--accent); background: rgba(255,107,0,.08); }
.rtn-week-day.rest  { cursor: default; opacity: .5; }
.rtn-week-day-name  { font-size: .62rem; font-weight: 700; color: var(--muted2); text-transform: uppercase; }
.rtn-week-day-icon  { font-size: .95rem; color: var(--muted); }
.rtn-week-day:not(.rest) .rtn-week-day-icon { color: var(--accent); }
.rtn-week-day-count { font-size: .65rem; font-weight: 700; color: var(--accent); }

/* Exercise detail modal */
.rtn-ex-detail-card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: .6rem; overflow: hidden;
}
.rtn-ex-detail-header {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1rem; cursor: pointer; user-select: none;
}
.rtn-ex-detail-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,107,0,.15); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 800; flex-shrink: 0;
}
.rtn-ex-detail-info { flex: 1; min-width: 0; }
.rtn-ex-detail-name { font-weight: 700; font-size: .92rem; }
.rtn-ex-detail-meta { font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.rtn-ex-chevron { color: var(--muted2); font-size: .75rem; transition: transform .2s; flex-shrink: 0; }
.rtn-ex-detail-body { display: none; padding: 0 1rem 1rem; }
.rtn-ex-detail-body.open { display: block; }
.rtn-ex-detail-header:has(+ .rtn-ex-detail-body.open) .rtn-ex-chevron { transform: rotate(180deg); }
.rtn-ex-media { border-radius: 8px; overflow: hidden; margin-bottom: .75rem; text-align: center; background: #000; }
.rtn-ex-media img { max-height: 220px; width: 100%; object-fit: contain; }
.rtn-ex-desc { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.rtn-ex-instructions { background: var(--bg3); border-radius: 8px; padding: .75rem; margin-bottom: .5rem; }
.rtn-ex-instr-title { font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .5px; }
.rtn-ex-instr-body  { font-size: .84rem; color: var(--muted); line-height: 1.7; }
.rtn-ex-note { font-size: .8rem; color: var(--yellow); background: rgba(251,191,36,.08); border-left: 3px solid var(--yellow); padding: .5rem .75rem; border-radius: 0 6px 6px 0; }
