/* GuitarBajaao · components */

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 52px; padding: 0 var(--sp-5); border-radius: var(--r-lg); font-weight: 700; font-size: var(--fs-md); background: var(--accent); color: #fff; transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-fast); user-select: none; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.btn:active { transform: scale(.985); }
.btn:hover { background: var(--accent-2); }
.btn.block { width: 100%; }
.btn.lg { min-height: 60px; font-size: var(--fs-lg); border-radius: var(--r-xl); }
.btn.sm { min-height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-sm); border-radius: var(--r-md); }
.btn.xs { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn.dark { background: var(--ink); } .btn.dark:hover { background: #262B31; }
.btn.green { background: var(--green); } .btn.green:hover { background: #0B4A3D; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); } .btn.ghost:hover { background: var(--bg-2); }
.btn.soft { background: var(--accent-soft); color: var(--accent); } .btn.soft:hover { background: var(--accent-soft-2); }
.btn.danger { background: var(--red); }
.btn.link { background: none; color: var(--accent); min-height: 0; padding: 0; border-radius: 4px; }
.btn.icon { width: 48px; min-height: 48px; padding: 0; border-radius: 50%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn .spinner { width: 18px; height: 18px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); box-shadow: var(--shadow-1); }
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.soft { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.card.greenish { background: var(--green-soft); border-color: #CFE1DB; }
.card.dark { background: var(--ink); color: var(--dk-ink); border-color: var(--ink); }
.card.dark .muted { color: var(--dk-ink-2); }
.card.dark .faint { color: var(--dk-ink-3); }
.card.tap { cursor: pointer; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.card.tap:active { transform: scale(.99); }
.card.selectable { cursor: pointer; border-width: 1.5px; }
.card.selectable.on { border-color: var(--accent); background: var(--accent-soft); }

/* list rows inside a card */
.rows > * { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line-2); }
.rows > *:first-child { border-top: 0; padding-top: 0; }
.rows > *:last-child { padding-bottom: 0; }
.rows.tap > * { cursor: pointer; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--sp-4); border-radius: var(--r-pill); background: var(--card); border: 1.5px solid var(--line); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; transition: all var(--t-fast); user-select: none; -webkit-tap-highlight-color: transparent; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.accent.on { background: var(--accent); border-color: var(--accent); }
.chip.sm { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }

/* tags & pills */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; background: var(--green-soft); color: var(--green); white-space: nowrap; max-width: 100%; }
.tag.wrap { white-space: normal; line-height: 1.25; }
.num { white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.grey { background: var(--bg-2); color: var(--ink-2); }
.tag.dark { background: rgba(255,255,255,.14); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.grey { background: var(--ink-3); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* avatars */
.avatar { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #E9B49A, var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--font-display); flex: none; overflow: hidden; object-fit: cover; }
.avatar.round { border-radius: 50%; }
.avatar.lg { width: 72px; height: 72px; font-size: var(--fs-xl); border-radius: 20px; }
.avatar.xl { width: 96px; height: 96px; font-size: var(--fs-2xl); border-radius: 28px; }
.avatar.sm { width: 36px; height: 36px; font-size: var(--fs-sm); border-radius: 10px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.g2 { background: linear-gradient(135deg, #9EC7BC, var(--green)); }
.avatar.g3 { background: linear-gradient(135deg, #C9D4E6, #4A5C7A); }
.avatar.g4 { background: linear-gradient(135deg, #D9CFB8, #7A6A48); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: var(--fs-xs); color: var(--ink-3); }
.field .error { font-size: var(--fs-xs); color: var(--red); font-weight: 600; }
.input, .select, .textarea { width: 100%; min-height: 52px; padding: 0 var(--sp-4); border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--card); font-size: var(--fs-md); transition: border-color var(--t-fast), box-shadow var(--t-fast); outline: none; }
.textarea { min-height: 110px; padding: var(--sp-3) var(--sp-4); resize: vertical; line-height: 1.4; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(201,58,8,.12); }
.input.invalid { border-color: var(--red); }
.input-row { display: flex; gap: var(--sp-2); }
.input-row .input { flex: 1; }
.prefix { display: flex; align-items: center; padding: 0 var(--sp-3); border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); font-weight: 700; color: var(--ink-2); }
.search { position: relative; }
.search .input { padding-left: 44px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.otp { display: flex; gap: var(--sp-2); }
.otp input { flex: 1; min-width: 0; height: 60px; text-align: center; font-size: 26px; font-weight: 800; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--card); outline: none; font-family: var(--font-display); }
.otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(201,58,8,.12); }
.toggle { position: relative; width: 46px; height: 26px; border-radius: 13px; background: #CBD0CA; transition: background var(--t-fast); flex: none; cursor: pointer; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left var(--t-fast) var(--ease); box-shadow: var(--shadow-1); }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 23px; }
.segmented { display: flex; background: var(--bg-2); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.segmented button { flex: 1; min-height: 38px; border-radius: 11px; font-weight: 700; font-size: var(--fs-sm); color: var(--ink-2); transition: all var(--t-fast); }
.segmented button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.stepper { display: flex; align-items: center; gap: var(--sp-2); }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); font-size: 20px; font-weight: 700; }
.stepper output { min-width: 40px; text-align: center; font-weight: 800; font-size: var(--fs-lg); }
.range { width: 100%; accent-color: var(--accent); }

/* progress */
.bar { height: 8px; background: #E4E7E2; border-radius: 9px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 9px; transition: width var(--t-slow) var(--ease); }
.bar.accent > i { background: var(--accent); }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 6px; border-radius: 9px; background: var(--line); }
.steps i.on { background: var(--accent); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p) * 1%), #E4E7E2 0); display: grid; place-items: center; }
.ring > span { width: 50px; height: 50px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 800; font-size: var(--fs-sm); }

/* nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: stretch; z-index: 40; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); position: relative; transition: color var(--t-fast); }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--accent); }
.nav a .badge { top: 6px; right: calc(50% - 20px); }
@media (min-width: 900px) {
  .nav { top: 0; bottom: auto; height: 64px; padding: 0 var(--sp-6); justify-content: flex-start; gap: var(--sp-2); border-top: 0; border-bottom: 1px solid var(--line); }
  .nav a { flex: none; flex-direction: row; padding: 0 var(--sp-4); font-size: var(--fs-sm); border-radius: var(--r-md); }
  .nav a.on { background: var(--accent-soft); }
  .nav .brand { display: flex; align-items: center; margin-right: var(--sp-6); font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); color: var(--ink); }
  .nav .spacer { flex: 1; }
  .page:not(.no-nav) { padding-top: calc(64px + var(--sp-8)); }
}
.nav .brand { display: none; }
@media (min-width: 900px) { .nav .brand { display: flex; } }

/* top bar */
.topbar { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; }
.topbar .back { width: 40px; height: 40px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; }
.topbar h1 { font-size: var(--fs-xl); }

/* sticky bottom bar */
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + var(--safe-b)); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; gap: var(--sp-3); z-index: 41; }
.sticky-bar > * { flex: 1; }
.page.has-sticky { padding-bottom: calc(110px + var(--safe-b)); }
@media (min-width: 900px) { .sticky-bar { left: 50%; right: auto; width: 520px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: var(--r-xl) var(--r-xl) 0 0; } }

/* sheets, modals, toasts */
.scrim { position: fixed; inset: 0; background: rgba(14,16,19,.55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade var(--t-fast); }
@media (min-width: 700px) { .scrim { align-items: center; } }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--card); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--sp-5) var(--sp-4) calc(var(--sp-6) + var(--safe-b)); display: flex; flex-direction: column; gap: var(--sp-4); animation: sheet-in var(--t-med) var(--ease); }
@media (min-width: 700px) { .sheet { border-radius: var(--r-xl); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: -8px auto 0; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--sp-4) + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); z-index: 70; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--shadow-3); animation: toast-in var(--t-med) var(--ease); max-width: 92vw; display: flex; align-items: center; gap: 8px; }
.toast.ok { background: var(--green); } .toast.err { background: var(--red); }
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* spinner */
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.35); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.dark { border-color: var(--line); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { flex: 1; display: grid; place-items: center; min-height: 50dvh; }

/* empty states */
.empty { text-align: center; padding: var(--sp-10) var(--sp-4); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); color: var(--ink-2); }
.empty .icon { width: 72px; height: 72px; border-radius: 24px; background: var(--bg-2); display: grid; place-items: center; font-size: 32px; }

/* hero (dark card with big button) */
.hero { background: var(--ink); color: var(--dk-ink); border-radius: var(--r-xl); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); position: relative; overflow: hidden; }
.hero .eyebrow { color: var(--dk-accent); }
.hero .muted { color: var(--dk-ink-2); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(201,58,8,.35), transparent 65%); pointer-events: none; }

/* tables (admin) */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.table tr:hover td { background: var(--bg); }

/* admin layout */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.admin .side { background: var(--ink); color: var(--dk-ink-2); padding: var(--sp-6) var(--sp-4); display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; overflow: auto; }
.admin .side .brand { color: #fff; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); margin-bottom: var(--sp-5); }
.admin .side a { padding: 10px 12px; border-radius: 12px; font-size: var(--fs-sm); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.admin .side a.on { background: var(--dk-card-2); color: #fff; }
.admin .main { padding: var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-5); max-width: 1200px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); }
.kpi .n { font-size: var(--fs-2xl); font-weight: 800; font-family: var(--font-display); margin-top: 4px; }
@media (max-width: 899px) {
  .admin { grid-template-columns: 1fr; }
  .admin .side { position: fixed; bottom: 0; top: auto; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; width: 100%; z-index: 40; }
  .admin .side .brand { display: none; }
  .admin .side a { white-space: nowrap; }
  .admin .main { padding: var(--sp-4) var(--sp-4) 90px; }
}

/* live class (dark) */
.live { background: var(--dk-bg); color: var(--dk-ink); min-height: 100dvh; display: flex; flex-direction: column; }
.live .stage { position: relative; flex: 1; min-height: 0; display: grid; }
.live .tile { position: relative; background: #1A1715; border-radius: 18px; overflow: hidden; display: grid; place-items: center; }
.live .tile video { width: 100%; height: 100%; object-fit: cover; }
.live .tile .name { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.55); border-radius: var(--r-pill); padding: 5px 10px; font-size: var(--fs-xs); font-weight: 700; }
.live .tile.alert { outline: 3px solid var(--red); }
.live .tile.focus { outline: 3px solid var(--dk-accent); }
.live .pip { position: absolute; right: 12px; bottom: 12px; width: 96px; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; border: 2px solid #fff; background: #222; z-index: 2; }
.live .toolbar { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) calc(var(--sp-4) + var(--safe-b)); justify-content: center; flex-wrap: wrap; }
.live .ctl { width: 58px; height: 58px; border-radius: 50%; background: var(--dk-card-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--dk-ink-2); text-align: center; }
.live .ctl.on { background: var(--dk-accent); color: var(--ink); }
.live .ctl.end { background: var(--red); color: #fff; }
.live .panel { background: var(--dk-card); border: 1px solid var(--dk-line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); }
.live .tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.live .tools button { background: var(--dk-card); border: 1px solid var(--dk-line); border-radius: 14px; padding: 11px 6px; font-size: 12px; font-weight: 700; color: var(--dk-ink-2); }
.live .tools button.on { background: var(--dk-accent); color: var(--ink); border-color: var(--dk-accent); }
.beat { display: flex; gap: 6px; }
.beat i { width: 14px; height: 14px; border-radius: 50%; background: var(--dk-line); }
.beat i.on { background: var(--accent); }
.beat i.accent.on { background: var(--dk-accent); }

/* chord diagram */
.chord { display: inline-grid; grid-template-columns: repeat(6, 14px); grid-auto-rows: 14px; gap: 0; position: relative; padding: 18px 6px 6px; }
.chord svg { width: 110px; height: 130px; }

/* certificate */
.cert { background: #FFFDF8; border: 2px solid #E3C9B8; border-radius: 20px; padding: var(--sp-6); text-align: center; display: flex; flex-direction: column; gap: 6px; position: relative; }
.cert::before { content: ""; position: absolute; inset: 8px; border: 1px solid #E3C9B8; border-radius: 14px; pointer-events: none; }

/* misc */
.divider { display: flex; align-items: center; gap: var(--sp-3); color: var(--ink-3); font-size: var(--fs-sm); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(201,58,8,.45); } 60% { box-shadow: 0 0 0 14px rgba(201,58,8,0); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.install-prompt { position: fixed; left: var(--sp-4); right: var(--sp-4); bottom: calc(var(--nav-h) + var(--sp-4) + var(--safe-b)); z-index: 50; }

/* demo switcher (only while DEMO is on) */
.demo-bar { position: fixed; left: 12px; bottom: calc(var(--nav-h) + 12px + var(--safe-b)); z-index: 90; background: rgba(255,255,255,.94); border-radius: 10px; padding: 4px; box-shadow: var(--shadow-2); font-size: 12px; }
@media (min-width: 900px) { .demo-bar { bottom: 12px; } }
body:has(.landing) .demo-bar { bottom: 12px; }
