:root {
  --bg-main: #000000;
  --bg-card: #1c1c1e;
  --bg-card-subtle: #2c2c2e;
  --bg-card-inset: #121214;
  --bg-glass: rgba(28, 28, 30, 0.82);
  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text-main: #ffffff;
  --text-secondary: #ebebf599;
  --text-tertiary: #ebebf54d;
  --apple-green: #30d158;
  --apple-green-dim: rgba(48, 209, 88, 0.16);
  --apple-blue: #0a84ff;
  --apple-blue-dim: rgba(10, 132, 255, 0.16);
  --apple-cyan: #64d2ff;
  --apple-orange: #ff9f0a;
  --apple-red: #ff453a;
  --apple-purple: #bf5af2;
  --spotify-green: #1db954;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --bottom-bar-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.45;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.hidden {
  display: none !important;
}

/* ================= BOTÕES PADRÃO APPLE HIG ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.2px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--apple-green);
  color: #000000;
  font-weight: 700;
}

.btn-primary:hover {
  background-color: #34dc5e;
}

.btn-secondary {
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #3a3a3c;
}

.btn-danger {
  background-color: rgba(255, 69, 58, 0.16);
  color: var(--apple-red);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 24px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

.btn-apple-subtle {
  background-color: var(--apple-blue-dim);
  color: var(--apple-blue);
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease;
}

.btn-apple-subtle:active {
  transform: scale(0.95);
}

.error-banner {
  background: rgba(255, 69, 58, 0.16);
  border: 1px solid rgba(255, 69, 58, 0.35);
  color: #ff6961;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  margin-bottom: 16px;
}

/* ================= TELA DE SELEÇÃO DE PERFIL (AUTH) ================= */
#auth-screen {
  padding: 28px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.apple-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

.auth-card {
  width: 100%;
  padding: 30px 22px;
}

.auth-header {
  text-align: center;
  margin-bottom: 26px;
}

.app-brand-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--apple-green);
  background: var(--apple-green-dim);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.preset-users-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preset-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: var(--text-main);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease;
}

.preset-user-card:hover {
  background-color: #363638;
}

.preset-user-card:active {
  transform: scale(0.98);
}

.preset-user-card.loading {
  opacity: 0.6;
  pointer-events: none;
}

.preset-user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.preset-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.preset-user-name {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #ffffff;
}

.preset-user-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-user-sub.online {
  color: var(--apple-green);
  font-weight: 600;
}

.preset-arrow {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}

/* ================= HEADER PRINCIPAL APPLE ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.4px;
}

.tenant-tag {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--apple-green-dim);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--apple-green);
}

.pulsing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--apple-green);
}

.btn-icon-apple {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--apple-blue);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-main);
}

.avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--apple-green);
  color: #000;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-user-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ================= CRONÔMETRO LIVE ACTIVITY / DYNAMIC ISLAND HUD (100% VISÍVEL) ================= */
.apple-live-hud {
  position: sticky;
  top: calc(47px + env(safe-area-inset-top, 0px));
  z-index: 55;
  margin: 8px 12px 0 12px;
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 8px 12px 0 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.apple-live-hud.counting {
  border-color: rgba(48, 209, 88, 0.55);
  box-shadow: 0 8px 30px rgba(48, 209, 88, 0.18);
}

.apple-live-hud.finishing {
  border-color: rgba(255, 159, 10, 0.7);
  box-shadow: 0 8px 30px rgba(255, 159, 10, 0.24);
}

.hud-main-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
}

.hud-timer-col {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.apple-timer-ring-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.apple-timer-ring {
  transform: rotate(-90deg);
  width: 44px;
  height: 44px;
}

.apple-timer-ring .ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
}

.apple-timer-ring .ring-fill {
  fill: none;
  stroke: var(--apple-green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 119.38;
  stroke-dashoffset: 119.38;
  transition: stroke-dashoffset 0.25s linear, stroke 0.2s ease;
}

.hud-ring-icon {
  position: absolute;
  color: var(--apple-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-time-text {
  display: flex;
  flex-direction: column;
}

.hud-digits {
  font-size: 1.55rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.6px;
  line-height: 1.05;
  color: #ffffff;
}

.hud-digits.active {
  color: var(--apple-green);
}

.hud-digits.finishing {
  color: var(--apple-orange);
}

.hud-status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.hud-actions-col {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.hud-pill-btn {
  background: var(--bg-card-subtle);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 0.73rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.hud-pill-btn:active {
  transform: scale(0.92);
  background: var(--apple-green);
  color: #000;
}

.hud-pill-btn.active {
  background: rgba(48, 209, 88, 0.18);
  color: var(--apple-green);
  border-color: rgba(48, 209, 88, 0.35);
}

.hud-icon-btn {
  background: rgba(255, 69, 58, 0.18);
  border: none;
  color: var(--apple-red);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hud-track-line {
  width: calc(100% + 24px);
  margin-left: -12px;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.hud-fill-line {
  height: 100%;
  background: var(--apple-green);
  width: 0%;
  transition: width 0.25s linear;
}

/* ================= SPOTIFY AUDIO DOCK ================= */
.spotify-workout-dock {
  margin: 8px 12px 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
}

.spotify-dock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
}

.spotify-brand-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.spotify-text-group {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.spotify-title-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.spotify-sub-text {
  font-size: 0.75rem;
  color: var(--spotify-green);
  font-weight: 500;
}

.spotify-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-spotify-app-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(29, 185, 84, 0.15);
  color: var(--spotify-green);
  border: none;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-spotify-toggle {
  background: var(--bg-card-subtle);
  border: none;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.spotify-dock-body {
  padding: 8px 12px 12px 12px;
  border-top: 1px solid var(--border-subtle);
}

.spotify-playlists-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.spotify-pill {
  flex-shrink: 0;
  background: var(--bg-card-subtle);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.spotify-pill.active {
  background: rgba(29, 185, 84, 0.18);
  color: var(--spotify-green);
  border-color: rgba(29, 185, 84, 0.4);
}

.spotify-custom-url-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.spotify-input {
  flex: 1;
  background: var(--bg-card-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-main);
  font-size: 0.78rem;
  outline: none;
}

.spotify-iframe-container {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  height: 80px;
}

/* ================= TOAST ================= */
.live-toast {
  position: fixed;
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 44, 46, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 120;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-green);
  flex-shrink: 0;
}

/* ================= ÁREA DE CONTEÚDO ================= */
.tab-content-area {
  padding: 12px 12px calc(var(--bottom-bar-height) + 28px) 12px;
  min-height: calc(100vh - 140px);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fade-in 0.18s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= SELETOR DE MODO (APPLE SEGMENTED CONTROL) ================= */
.workout-mode-selector-wrapper {
  margin-bottom: 14px;
}

.workout-mode-tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: 11px;
  padding: 3px;
  gap: 3px;
}

.workout-mode-btn {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.83rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.workout-mode-btn.active {
  background: var(--bg-card-subtle);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.workout-mode-info-card {
  margin-top: 8px;
  padding: 9px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mode-info-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--apple-green);
  white-space: nowrap;
}

.mode-info-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================= PÍLULAS DOS DIAS E LISTA CLEAN ================= */
.day-pills-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.day-pill-btn {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.day-pill-btn.active {
  background: var(--apple-green);
  color: #000000;
  border-color: var(--apple-green);
  font-weight: 700;
}

.clean-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.clean-day-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.clean-day-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.clean-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.clean-exercise-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.clean-exercise-row:active {
  transform: scale(0.985);
  background: var(--bg-card-subtle);
}

.clean-ex-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.clean-ex-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.clean-ex-num.done {
  background: var(--apple-green);
  color: #000;
}

.clean-ex-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.clean-ex-name {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clean-ex-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clean-ex-tag {
  color: var(--apple-green);
  font-weight: 600;
}

.btn-view-demo {
  background: var(--bg-card-subtle);
  border: none;
  color: var(--apple-blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.start-workout-cta-wrapper {
  position: sticky;
  bottom: calc(var(--bottom-bar-height) + 12px);
  z-index: 40;
}

/* ================= 2. MODO TREINO ATIVO (PALCO & SÉRIES TÁTEIS) ================= */
.active-workout-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.btn-back-list {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--apple-blue);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.active-progress-pill {
  background: var(--apple-green-dim);
  color: var(--apple-green);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
}

.active-members-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 10px;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.exercise-stepper-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.step-ex-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.step-ex-btn.active {
  background: var(--apple-green);
  color: #000000;
  border-color: var(--apple-green);
}

.step-ex-btn.completed {
  background: rgba(48, 209, 88, 0.16);
  color: var(--apple-green);
  border-color: rgba(48, 209, 88, 0.35);
}

.active-exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-bottom: 14px;
}

.active-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.active-ex-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--apple-green);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.active-ex-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-top: 2px;
}

.active-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.meta-chip {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
}

.meta-chip.highlight {
  background: var(--apple-green-dim);
  color: var(--apple-green);
}

/* Galeria de Fotos do Exercício */
.exercise-photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.exercise-photo-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.exercise-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-phase-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.visual-demo-box {
  width: 100%;
  height: 185px;
  background: var(--bg-card-inset);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.visual-demo-svg {
  width: 100%;
  height: 100%;
}

.active-quick-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-card-inset);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.quick-tip-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-clean-howto {
  background: var(--bg-card-subtle);
  border: none;
  color: var(--apple-blue);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

/* Controle de Carga Apple */
.weight-control-box {
  background: var(--bg-card-inset);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.weight-control-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.weight-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.weight-last-hint {
  font-size: 0.75rem;
  color: var(--apple-green);
}

.weight-stepper-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-weight-adj {
  background: var(--bg-card-subtle);
  border: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-weight-adj:active {
  background: var(--apple-green);
  color: #000;
}

.weight-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
}

.weight-input {
  width: 64px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
}

.weight-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ================= NOVO SISTEMA TÁTIL DE MARCAÇÃO DE SÉRIES (APPLE FITNESS+) ================= */
.active-sets-section {
  margin-bottom: 14px;
}

.active-sets-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.active-sets-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.active-sets-subhint {
  font-size: 0.73rem;
  color: var(--text-tertiary);
}

/* Cards de Séries do Usuário Atual (Táteis e Grandes) */
.my-sets-tactile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.tactile-set-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text-main);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.18s ease, border-color 0.18s ease;
}

.tactile-set-card:active {
  transform: scale(0.93);
}

.tactile-set-card.done {
  background: rgba(48, 209, 88, 0.18);
  border-color: var(--apple-green);
}

.tactile-set-left {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.tactile-set-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.tactile-set-card.done .tactile-set-title {
  color: var(--apple-green);
}

.tactile-set-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.tactile-check-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tactile-set-card.done .tactile-check-circle {
  background: var(--apple-green);
  border-color: var(--apple-green);
  color: #000000;
  transform: scale(1.06);
}

/* Séries sincronizadas dos parceiros de treino */
.partners-sets-wrapper {
  background: var(--bg-card-inset);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.partners-sets-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.member-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.member-set-row:last-child {
  border-bottom: none;
}

.member-set-name {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}

.set-dots-group {
  display: flex;
  gap: 6px;
}

.partner-set-pill {
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-tertiary);
  font-size: 0.73rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.partner-set-pill.partner-done {
  background: var(--apple-blue-dim);
  color: var(--apple-cyan);
}

.active-action-bar {
  display: flex;
  margin-top: 10px;
}

.btn-swap-machine {
  width: 100%;
  background: var(--bg-card-subtle);
  border: none;
  color: var(--apple-blue);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 11px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.active-nav-footer {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

/* ================= TURMA, PERFIL E HISTÓRICO ================= */
.invite-banner-card {
  padding: 20px;
  margin-bottom: 20px;
}

.invite-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.section-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--apple-green);
  text-transform: uppercase;
}

.invite-card-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.member-capacity-tag {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.invite-code-box {
  background: var(--bg-card-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.the-code {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--apple-green);
  font-variant-numeric: tabular-nums;
}

.btn-copy {
  background: var(--apple-green);
  color: #000;
  font-weight: 600;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.invite-explanation {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.share-buttons-row {
  display: flex;
  gap: 8px;
}

.section-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.team-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-member-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.member-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.member-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.member-role-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
}

.member-desires-box {
  background: var(--bg-card-inset);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.profile-card {
  padding: 20px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.avatar-circle-lg {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--apple-green);
  color: #000;
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-role-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--apple-green);
  background: var(--apple-green-dim);
  padding: 2px 9px;
  border-radius: 999px;
  margin-top: 4px;
}

.input-group {
  margin-bottom: 14px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-card-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.94rem;
  font-family: inherit;
  outline: none;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--apple-blue);
}

.apple-card-inset {
  margin-top: 20px;
  padding: 14px;
  background: var(--bg-card-inset);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.sys-metrics {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: 6px;
  color: var(--apple-cyan);
  font-size: 0.74rem;
}

.logout-box {
  margin-top: 14px;
}

.history-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
}

.history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.history-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--apple-green);
  text-transform: uppercase;
}

.history-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 2px 0;
}

.history-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.history-sets-tag {
  background: var(--apple-green-dim);
  color: var(--apple-green);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.history-participants {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.history-ex-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-ex-row {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.empty-state-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* ================= BOTTOM NAVIGATION BAR (APPLE TAB BAR) ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 640px;
  height: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
  background: rgba(22, 22, 24, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 60;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.nav-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  gap: 3px;
}

.nav-item.active {
  color: var(--apple-green);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--apple-green);
  color: #000;
  font-size: 0.62rem;
  font-weight: 700;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= MODAIS APPLE SHEET ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 150;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom)) 20px;
  overflow-y: auto;
  animation: modal-up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes modal-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--apple-blue);
  text-transform: uppercase;
}

.modal-title {
  font-size: 1.18rem;
  font-weight: 700;
}

.btn-close-modal {
  background: var(--bg-card-subtle);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.howto-card-box {
  background: var(--bg-card-inset);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.howto-header-row {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--apple-green);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.howto-step-item {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.howto-tip-box {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--apple-cyan);
}

.howto-actions-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
  margin-top: 14px;
}

.alt-reason-selector {
  margin-bottom: 14px;
}

.alt-reason-selector label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: var(--bg-card-subtle);
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  background: var(--apple-blue-dim);
  border-color: var(--apple-blue);
  color: var(--apple-blue);
}

.alt-loading-state {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--apple-green);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.alt-option-card {
  background: var(--bg-card-inset);
  border-radius: var(--radius-md);
  padding: 14px;
}

.alt-option-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.alt-option-reason {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mt-2 {
  margin-top: 8px;
}

/* ================= BANNER E MODAL DE INSTALAÇÃO NO IPHONE ================= */
.install-prompt-box {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--bg-card-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.install-prompt-content {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.install-prompt-text {
  display: flex;
  flex-direction: column;
}

.install-prompt-text strong {
  font-size: 0.86rem;
  color: #ffffff;
}

.install-prompt-text span {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.ios-install-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.ios-install-intro {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.ios-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.ios-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card-inset);
  border-radius: var(--radius-md);
  padding: 12px;
}

.ios-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-step-content strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.ios-step-content p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.ios-icon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 10px;
  background: var(--bg-card-subtle);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.ios-tip-box {
  background: var(--bg-card-inset);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
