/* ── DARK (padrão) ── */
:root, [data-theme="dark"] {
  --bg: #0f0e17;
  --surface: #1a1929;
  --surface-2: #221f35;
  --border: #302d49;
  --accent: #195596;
  --accent-2: #4a9eff;
  --chord-blue: #4a9eff;
  --text: #f4f1ff;
  --muted: #9b97ae;
  --nav-bg: rgba(15,14,23,.94);
  --hero-start: #05050b;
  --hero-glow1: rgba(25,85,150,.32);
  --hero-glow2: rgba(124,58,237,.28);
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
}

/* ── LIGHT ── */
[data-theme="light"] {
  --bg: #f4f2ff;
  --surface: #ffffff;
  --surface-2: #eceaff;
  --border: #d8d5f0;
  --accent: #195596;
  --accent-2: #195596;
  --chord-blue: #195596;
  --text: #1a1829;
  --muted: #6b6880;
  --nav-bg: rgba(244,242,255,.96);
  --hero-start: #e8e4ff;
  --hero-glow1: rgba(25,85,150,.12);
  --hero-glow2: rgba(124,58,237,.10);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
}

/* ── HEAVY DARK (cinematográfico) ── */
[data-theme="heavy-dark"] {
  --bg: #000;
  --surface: #07050f;
  --surface-2: #100d1e;
  --border: #1e1a36;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --chord-blue: #a78bfa;
  --text: #f8f6ff;
  --muted: #8b85a8;
  --nav-bg: rgba(0,0,0,.96);
  --hero-start: #000;
  --hero-glow1: rgba(124,58,237,.45);
  --hero-glow2: rgba(59,130,246,.30);
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
}

/* ── HEAVY LIGHT (cinematográfico claro) ── */
[data-theme="heavy-light"] {
  --bg: #faf9ff;
  --surface: #ffffff;
  --surface-2: #f0edff;
  --border: #d4cff5;
  --accent: #7c3aed;
  --accent-2: #6d28d9;
  --chord-blue: #6d28d9;
  --text: #0d0b1a;
  --muted: #5b5678;
  --nav-bg: rgba(250,249,255,.96);
  --hero-start: #f0edff;
  --hero-glow1: rgba(124,58,237,.18);
  --hero-glow2: rgba(59,130,246,.14);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, system-ui, sans-serif; line-height: 1.55; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 22px; min-height: 88px; padding: 0 32px; border-bottom: 1px solid var(--border); background: var(--nav-bg); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand-logo { height: 56px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-links a { display: block; padding: 8px 14px; border-radius: 9px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.logout-form { display: inline-flex; margin: 0; }
.user-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.pending { display: inline-grid; min-width: 18px; height: 18px; place-items: center; padding: 0 5px; border-radius: 9px; color: #fff; background: #ef4444; font-size: .65rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; color: #fff; background: var(--accent); font-weight: 700; font-size: .84rem; text-decoration: none; cursor: pointer; }
.btn:hover { background: #124675; }
.btn.ghost { color: var(--muted); border-color: var(--border); background: transparent; }
.btn.ghost:hover { color: var(--accent-2); border-color: var(--accent); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.messages { width: min(1180px, calc(100% - 36px)); margin: 16px auto 0; }
.message { padding: 12px 15px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.message.success { color: var(--success); }
.message.error { color: var(--danger); }

.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-cinematic { min-height: clamp(560px, 74vh, 760px); display: grid; grid-template-columns: minmax(0, 680px) minmax(220px, 330px); align-items: center; gap: 56px; padding: clamp(54px, 6vw, 86px) clamp(28px, 7vw, 92px) clamp(42px, 6vw, 64px); background: var(--hero-start); }
.hero-bg { position: absolute; inset: 0; z-index: -3; background: linear-gradient(90deg, color-mix(in srgb, var(--hero-start) 96%, transparent) 0%, color-mix(in srgb, var(--hero-start) 76%, transparent) 34%, color-mix(in srgb, var(--hero-start) 20%, transparent) 70%), url("/static/img/azcifras-hero.73fc756e0599.png") center right / cover no-repeat; }
.hero-cinematic::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle at 20% 30%, var(--hero-glow1), transparent 32%), radial-gradient(circle at 70% 24%, var(--hero-glow2), transparent 30%), linear-gradient(180deg, transparent, var(--bg) 98%); }
.hero-cinematic::after { content: ""; position: absolute; inset: auto 0 0; z-index: -1; height: 26%; background: linear-gradient(180deg, transparent, var(--bg)); }
.hero-copy { max-width: 660px; }
.eyebrow { display: inline-block; margin-bottom: 22px; padding: 8px 16px; border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent); border-radius: 999px; color: var(--accent-2); background: color-mix(in srgb, var(--accent) 16%, transparent); font-size: .78rem; font-weight: 800; }
.hero h1 { max-width: 620px; margin: 0; font-size: clamp(3.1rem,6.6vw,6rem); letter-spacing: 0; line-height: .98; color: var(--text); }
.hero h1 span { color: var(--accent-2); white-space: nowrap; }
.hero p { max-width: 560px; margin: 22px 0 28px; color: var(--muted); font-size: clamp(1rem,1.5vw,1.18rem); }
.search { display: flex; width: min(100%, 620px); margin: 0; padding: 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: 0 18px 42px rgba(0,0,0,.18); backdrop-filter: blur(18px); }
.search input { min-width: 0; flex: 1; padding: 10px 18px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .95rem; }
.search button { min-width: 110px; border: 0; border-radius: 999px; }
.stats { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 24px; color: var(--muted); font-size: .84rem; }
.stats strong { color: var(--accent-2); font-size: 1.08rem; }
.hero-card { align-self: end; max-width: 310px; padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: 0 18px 48px rgba(0,0,0,.22); backdrop-filter: blur(18px); }
.hero-card strong { display: block; margin-bottom: 10px; font-size: 1rem; color: var(--text); }
.hero-card p { margin: 0 0 18px; color: var(--muted); font-size: .9rem; }
.hero-card a { color: var(--accent-2); font-weight: 800; text-decoration: none; }
.floating-chord { position: absolute; z-index: -1; color: color-mix(in srgb, var(--accent-2) 18%, transparent); font-weight: 900; line-height: 1; pointer-events: none; }
.chord-a { top: 24%; left: 46%; font-size: clamp(4rem, 8vw, 8rem); transform: rotate(-12deg); }
.chord-b { top: 15%; left: 58%; font-size: clamp(3.2rem, 5.2vw, 6.2rem); transform: rotate(-8deg); }
.chord-c { top: 33%; left: 64%; font-size: clamp(2.4rem, 4.2vw, 5rem); }
.chord-d { top: 21%; right: 9%; font-size: clamp(3rem, 5vw, 5.8rem); transform: rotate(14deg); }

.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.grid-main { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 28px; align-items: start; }
.surface { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.section-head h1, .section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; }
.muted { color: var(--muted); }

.home-page { width: min(1360px, calc(100% - 48px)); padding-top: 34px; }
.quick-tones { display: grid; grid-template-columns: repeat(8, minmax(82px, 1fr)); gap: 12px; margin: 0 0 46px; }
.quick-tones a { display: grid; gap: 4px; min-height: 74px; align-content: center; padding: 13px; border: 1px solid var(--border); border-radius: 12px; color: #9cc9ff; background: linear-gradient(180deg, rgba(34,31,53,.92), rgba(26,25,41,.9)); text-align: center; text-decoration: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); transition: .16s ease; }
.quick-tones a:hover { border-color: var(--accent); color: #fff; transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0,0,0,.24); }
.quick-tones strong { font-size: 1.24rem; line-height: 1; }
.quick-tones span { color: #9eb0d2; font-size: .72rem; }
.featured-section { margin-bottom: 34px; }
.section-link { text-decoration: none; font-weight: 800; }
.featured-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.feature-card { position: relative; display: grid; min-height: 214px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #12101d; text-decoration: none; transition: .18s ease; }
.feature-card:hover { border-color: rgba(138,191,255,.55); transform: translateY(-3px); box-shadow: 0 18px 38px rgba(0,0,0,.28); }
.feature-art { position: absolute; inset: 0; background: radial-gradient(circle at 38% 22%, rgba(138,191,255,.32), transparent 28%), linear-gradient(180deg, transparent 0%, rgba(8,7,13,.88) 72%), url("/static/img/azcifras-hero.73fc756e0599.png") center / cover no-repeat; filter: saturate(.9); opacity: .74; }
.feature-card:nth-child(2) .feature-art { background-position: 68% center; }
.feature-card:nth-child(3) .feature-art { background-position: 78% center; }
.feature-card:nth-child(4) .feature-art { background-position: 58% center; }
.feature-card:nth-child(5) .feature-art { background-position: 48% center; }
.feature-content { position: relative; z-index: 1; align-self: end; display: grid; gap: 4px; padding: 18px; }
.feature-content strong { color: #fff; font-size: .96rem; line-height: 1.25; }
.feature-content > span { color: #c3bfd4; font-size: .8rem; }
.feature-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: #9cc9ff !important; font-size: .72rem !important; }
.feature-meta span { padding: 3px 8px; border-radius: 999px; background: rgba(25,85,150,.24); }
.home-grid { grid-template-columns: 1.4fr .8fr; }
.home-cta { background: radial-gradient(circle at 90% 18%, rgba(25,85,150,.2), transparent 42%), var(--surface); }

.tabs { display: flex; gap: 3px; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 9px 13px; color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; }
.tabs a:hover, .tabs a.active { color: var(--accent-2); border-bottom-color: var(--accent); }
.cifra-list { display: grid; gap: 9px; }
.cifra-card { display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-decoration: none; transition: .16s ease; }
.cifra-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.cifra-info { min-width: 0; flex: 1; }
.cifra-info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cifra-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .72rem; }
.tom { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 9px; color: var(--accent-2); background: rgba(25,85,150,.13); font-weight: 800; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 6px; color: var(--accent-2); background: rgba(25,85,150,.13); font-size: .7rem; }

.sidebar { display: grid; gap: 16px; }
.widget { padding: 18px; }
.widget h3 { margin: 0 0 12px; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.category-list { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.category-list a { display: flex; justify-content: space-between; padding: 7px 9px; border-radius: 7px; text-decoration: none; font-size: .84rem; }
.category-list a:hover, .category-list a.active { color: var(--accent-2); background: rgba(25,85,150,.1); }

.filters { display: grid; gap: 16px; }
.filters label { display: grid; gap: 5px; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.filters select, .filters input, .form-field input, .form-field select, .form-field textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--bg); outline: 0; }
.filters select:focus, .filters input:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25,85,150,.18); }

.detail { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 26px; align-items: start; }
.detail-header, .cifra-sheet { padding: 24px; }
.detail-header h1 { margin: 0; font-size: 1.8rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.chip { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: .74rem; }
.license-chip { color: var(--success); border-color: rgba(74,222,128,.25); }
.source-link { display: inline-block; margin-top: 12px; color: var(--accent-2); font-size: .76rem; text-decoration: none; }
.cifra-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; padding: 9px 12px; color: var(--muted); font-size: .75rem; }
.cifra-toolbar button { min-width: 36px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: var(--surface-2); cursor: pointer; }
.cifra-toolbar button:hover { color: var(--accent-2); border-color: var(--accent); }
.cifra-sheet { position: relative; overflow: hidden; margin-top: 8px; border-color: #dde6f0; color: #14110a; background: #f8fafc; box-shadow: 0 12px 30px rgba(0,0,0,.24); }
.cifra-sheet::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: url("/static/img/azlogos.eb2887453321.png") center 52% / min(460px,70%) no-repeat; opacity: .065; }
.cifra-sheet > * { position: relative; z-index: 1; }
.sheet-head { margin-bottom: 24px; color: #14110a; font-family: Roboto, Arial, sans-serif; text-align: center; }
.sheet-head h2 { margin: 0; font-size: 16pt; line-height: 1.2; font-weight: 700; }
.sheet-head p { margin: 3px 0 0; font-size: 12pt; line-height: 1.25; }
.cifra-body { --cifra-font-size: 13pt; --chord-font-size: 13.5pt; overflow-x: auto; color: #14110a; white-space: pre-wrap; word-break: break-word; font: var(--cifra-font-size)/1.72 Roboto, Arial, sans-serif; }
.cifra-line { min-height: 1.72em; }
.chord { color: var(--chord-blue); font-size: var(--chord-font-size); font-weight: 700; }
.video-frame { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #05050a; aspect-ratio: 16 / 9; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.progress-actions { display: grid; gap: 7px; }
.progress-actions button { width: 100%; padding: 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--bg); cursor: pointer; }
.progress-actions button:hover, .progress-actions button.active { color: var(--accent-2); border-color: var(--accent); }

.form-page, .auth-page { width: min(800px, calc(100% - 32px)); margin: 44px auto 80px; }
.auth-page { max-width: 470px; }
.form-card { display: grid; gap: 18px; padding: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: grid; gap: 6px; }
.form-field label { color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--danger); font-size: .75rem; }
.notice { padding: 12px 14px; border: 1px solid rgba(25,85,150,.3); border-radius: 9px; color: var(--muted); background: rgba(25,85,150,.08); font-size: .8rem; }
.google { width: 100%; margin-top: 14px; }
.switch { color: var(--muted); text-align: center; font-size: .82rem; }
.switch a { color: var(--accent-2); }

.dashboard-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 24px; }
.stat { padding: 18px; }
.stat strong { display: block; color: var(--accent-2); font-size: 1.7rem; }
.dash-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.panel { padding: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 1rem; }
.item-list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 9px; text-decoration: none; }
.item-info { min-width: 0; flex: 1; }
.item-info strong, .item-info small { display: block; }
.item-info small { color: var(--muted); }
.status { padding: 3px 7px; border-radius: 6px; color: var(--warning); background: rgba(251,191,36,.1); font-size: .68rem; }
.status.live { color: var(--success); background: rgba(34,197,94,.1); }
.empty { padding: 36px 12px; color: var(--muted); text-align: center; }

.course-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.course-card { display: block; padding: 24px; text-decoration: none; transition: .18s ease; }
.course-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.course-card h2 { margin: 14px 0 8px; font-size: 1.2rem; }
.course-card p { min-height: 72px; color: var(--muted); }
.course-card > strong { color: var(--accent-2); font-size: .82rem; }
.course-meta { display: flex; gap: 14px; margin: 16px 0; color: var(--muted); font-size: .76rem; }
.course-hero { padding: 32px; background: radial-gradient(circle at 90% 10%,rgba(25,85,150,.2),transparent 38%),var(--surface); }
.course-hero h1 { margin: 16px 0 8px; }
.course-hero > p { max-width: 760px; color: var(--muted); }
.lesson-list { display: grid; gap: 16px; margin-top: 22px; }
.lesson { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 16px; padding: 24px; }
.lesson-number { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #fff; background: var(--accent); font-weight: 800; }
.lesson h2 { margin: 3px 0 4px; font-size: 1.1rem; }
.lesson-content { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); white-space: pre-wrap; color: #e8e4f4; font: .9rem/1.8 Consolas,monospace; }

.footer { display: flex; justify-content: space-between; gap: 16px; padding: 22px 28px; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface); font-size: .78rem; }
.footer a { color: var(--accent-2); text-decoration: none; }

@media (max-width: 1120px) {
  .hero-cinematic { grid-template-columns: 1fr; gap: 30px; min-height: auto; padding-top: 70px; }
  .hero-bg { background-position: 66% center; opacity: .78; }
  .hero-card { align-self: start; }
  .quick-tones { grid-template-columns: repeat(4, minmax(86px, 1fr)); }
  .featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .nav { min-height: 88px; flex-wrap: nowrap; gap: 12px; overflow: hidden; padding: 0 14px; }
  .brand { gap: 8px; font-size: 1.08rem; }
  .brand img { width: 52px; height: 52px; }
  .nav-links { width: auto; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 8px 10px; font-size: .88rem; }
  .user-label { max-width: 80px; }
  .grid-main, .detail, .dash-grid { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; }
  .hero-cinematic { padding: 44px 20px 34px; }
  .hero-bg { background-position: 74% center; opacity: .55; }
  .hero h1 { max-width: 520px; font-size: clamp(2.7rem, 13vw, 4.2rem); }
  .search { border-radius: 20px; }
  .search button { min-width: 92px; }
  .hero-card { display: none; }
  .floating-chord { display: none; }
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav-actions .ghost:not(.user-label) { display: none; }
  .home-page { width: min(100% - 28px, 1360px); }
  .hero-card { padding: 20px; }
  .search { display: grid; gap: 6px; padding: 8px; border-radius: 18px; }
  .search input { padding: 9px 12px; }
  .search button { width: 100%; }
  .stats { gap: 14px; }
  .quick-tones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .featured-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 190px; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
  .detail-header, .cifra-sheet { padding: 18px; }
}

@media print {
  body { color: #14110a; background: #fff; }
  .nav, .detail-header, .cifra-toolbar, .sidebar, .footer, .bpm-chip { display: none !important; }
  .page { width: 100%; margin: 0; padding: 0; }
  .detail { display: block; }
  .surface { border: 0; border-radius: 0; background: transparent; }
  .cifra-sheet { margin: 0; padding: 18mm 14mm; box-shadow: none; background: #fff; }
  .cifra-sheet::before { opacity: .07; }
  .cifra-body { overflow: visible; }
}
