@import url('/css/mobile-base.css');

:root {
  color-scheme: light;
  --page-bg: #f4f6fb;
  --surface: #ffffff;
  --surface-alt: #f0f4ff;
  --text-main: #111827;
  --text-muted: #5f6a86;
  --border: rgba(15, 23, 42, 0.08);
  --accent: #2152ff;
  --accent-dark: #1438b8;
  --danger: #d64550;
  --warning: #f7b731;
  --success: #1f9d55;
  --radius: 16px;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(33, 82, 255, 0.08), rgba(5, 12, 30, 0.06)), var(--page-bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.free-tools-page {
  background: radial-gradient(circle at top, rgba(83, 117, 255, 0.35), transparent 55%),
    radial-gradient(circle at bottom, rgba(15, 185, 177, 0.28), transparent 60%),
    linear-gradient(160deg, #050a19, #0f172a);
  color: #f8fbff;
}

.free-tools-page .page-content {
  gap: 32px;
}

.free-tools-page .card {
  background: rgba(10, 18, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.6);
  color: #e2e8f0;
}

.free-tools-page .card .lead,
.free-tools-page .responsive-meta,
.free-tools-page label,
.free-tools-page .muted,
.free-tools-page p {
  color: rgba(226, 232, 240, 0.88);
}

.free-tools-page .tool-grid .tool {
  background: rgba(12, 21, 45, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.28);
  backdrop-filter: blur(16px);
}

.free-tools-page input,
.free-tools-page select,
.free-tools-page textarea {
  background: rgba(4, 9, 25, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  border-radius: 12px;
}

.free-tools-page input:focus,
.free-tools-page select:focus,
.free-tools-page textarea:focus {
  outline: 2px solid rgba(82, 124, 255, 0.7);
  outline-offset: 2px;
}

.free-tools-page .generator-output {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(33, 82, 255, 0.12);
  color: #f8fbff;
}

.free-tools-page .btn-primary {
  background: linear-gradient(135deg, #2152ff, #5f7bff);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.free-tools-page .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.free-tools-page .btn {
  background: rgba(33, 82, 255, 0.18);
  color: #f8fbff;
  border: 1px solid rgba(33, 82, 255, 0.4);
}

.free-tools-page .timer-display,
.free-tools-page .tempo-value {
  color: #f8fbff;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.simple-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 28px;
  background: #050b1c;
  color: #f5f7ff;
  box-shadow: 0 10px 30px rgba(5, 11, 28, 0.4);
}

.brand-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.simple-nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:focus-visible,
.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: flex-end;
}

.nav-links a {
  color: rgba(244, 247, 255, 0.9);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
  transition: background 0.18s ease, transform 0.18s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.page-content {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 40px) clamp(18px, 6vw, 32px) 60px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-content h1 {
  margin: 0 0 4px;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
}

.page-content p.lead {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: clamp(20px, 3vw, 28px);
}

.card + .card {
  margin-top: 8px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.tools-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  padding: 32px;
  background: rgba(6, 11, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 35px 70px rgba(3, 8, 24, 0.55);
  backdrop-filter: blur(16px);
}

.hero-intro h1 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 4vw, 3rem);
}

.hero-lead {
  color: rgba(226, 232, 240, 0.9);
  margin-bottom: 18px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.72);
  margin-bottom: 12px;
}

.hero-pill--soft {
  background: rgba(33, 82, 255, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.cta-group .btn,
.cta-group .btn-primary,
.cta-group .btn-secondary {
  min-width: 200px;
}

.hero-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: rgba(226, 232, 240, 0.78);
}

.hero-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.hero-list li::before {
  content: '▹';
  margin-right: 10px;
  color: #5f7bff;
  flex-shrink: 0;
}

.hero-card {
  background: rgba(13, 23, 49, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(3, 8, 24, 0.5);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.65);
  margin: 0 0 6px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.tools-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-margin-top: 80px;
}

.section-head h2 {
  margin: 6px 0;
  font-size: clamp(2rem, 3vw, 2.4rem);
}

.section-lead {
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
  max-width: 640px;
}

.cta-panel {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
}

.cta-panel .cta-group {
  margin: 0;
}

.tone-buttons {
  flex-wrap: wrap;
}

.precision-tuner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tuner-display {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 640px) {
  .tuner-display {
    flex-direction: row;
    align-items: center;
  }
}

.tuner-needle {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(7, 16, 36, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.tuner-needle__indicator {
  width: 4px;
  height: 70px;
  border-radius: 999px;
  background: #5f7bff;
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.5);
  transform-origin: center bottom;
  transform: rotate(var(--needle-rotation, 0deg));
  transition: transform 80ms ease-out;
}

.tuner-scale {
  position: absolute;
  bottom: 12px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.65);
}

.tuner-readout {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tuner-note {
  font-size: clamp(2.2rem, 5vw, 2.8rem);
  font-weight: 700;
}

.tuner-frequency {
  font-size: 1.1rem;
  color: rgba(226, 232, 240, 0.78);
}

.tuner-cents {
  font-size: 1rem;
}

.tool-head h2 {
  margin-bottom: 4px;
}

.metronome-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
}

.beat-display {
  display: inline-flex;
  gap: 6px;
}

.beat-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
}

.beat-dot.active {
  background: #2152ff;
  transform: scale(1.2);
}

.tempo-value {
  font-size: 2rem;
  font-weight: 600;
}

.timer-display {
  font-size: 3rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.tap-tempo-display {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin: 12px 0;
}

.generator-output {
  border-radius: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.2);
  padding: 16px;
  background: rgba(33, 82, 255, 0.05);
  min-height: 80px;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.log-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-entry {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface-alt);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(33, 82, 255, 0.12);
}

.stat-card span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 6px;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.responsive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.responsive-table thead th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

table.responsive-table tbody td {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

table.responsive-table tbody tr:hover {
  background: rgba(33, 82, 255, 0.04);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.list-item .meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(33, 82, 255, 0.12);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.success {
  background: rgba(31, 157, 85, 0.15);
  color: var(--success);
}

.badge.warning {
  background: rgba(247, 183, 49, 0.2);
  color: #92400e;
}

.badge.danger {
  background: rgba(214, 69, 80, 0.18);
  color: var(--danger);
}

.idea-entry {
  flex-direction: column;
}

.idea-entry__meta strong {
  font-size: 1.05rem;
}

.idea-entry__summary,
.idea-entry__impact {
  margin-top: 6px;
}

.idea-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn {
  background: rgba(33, 82, 255, 0.12);
  color: var(--accent);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #3c6dff);
  color: #fff;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-main);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #dc3545);
  color: #fff;
}

.btn-link {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  padding: 0;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

form .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-main);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(33, 82, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(33, 82, 255, 0.12);
}

textarea {
  resize: vertical;
  min-height: 160px;
}

.notice {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 0.95rem;
}

.notice.success {
  border-color: rgba(31, 157, 85, 0.25);
  background: rgba(31, 157, 85, 0.08);
  color: var(--success);
}

.notice.danger {
  border-color: rgba(214, 69, 80, 0.25);
  background: rgba(214, 69, 80, 0.08);
  color: var(--danger);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.checklist li {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.subscription-panel {
  background: var(--surface-alt);
  border: 1px solid rgba(33, 82, 255, 0.18);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.responsive-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .simple-nav {
    padding: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    display: none;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-links.nav-links--open {
    display: flex;
  }

  .page-content {
    padding: 24px 18px 48px;
  }

  .tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tools-hero {
    padding: 24px;
  }

  .cta-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-group .btn,
  .cta-group .btn-primary,
  .cta-group .btn-secondary {
    width: 100%;
    min-width: 0;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions-row,
  .nav-links,
  .stat-grid {
    flex-direction: column;
  }

  table.responsive-table {
    font-size: 0.9rem;
  }

  input,
  select,
  textarea,
  button {
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  .simple-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links a {
    width: 100%;
    text-align: left;
  }

  .card {
    padding: 18px;
  }
}

/* Status page */
.status-page .status-hero {
  background: linear-gradient(135deg, #101a3c, #1c2f77);
  color: #f5f7ff;
}

.status-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.status-dot {
  display: inline-flex;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 10px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.status-dot.ok {
  background: #16a34a;
}

.status-dot.alert {
  background: #dc2626;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.status-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 16px;
  background: var(--surface-alt, #f4f6ff);
}

.status-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.status-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-item {
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.status-item__title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #0f172a;
}

.status-item__badge {
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.status-item__message {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: #b91c1c;
}

.status-item.status-failed {
  border-color: rgba(220, 38, 38, 0.3);
  background: #fef2f2;
}

.status-item.status-failed .status-item__badge {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.updates-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.update-entry {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  position: relative;
}

.update-entry__head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.update-entry__body {
  margin: 12px 0 0;
  color: var(--text-main);
  line-height: 1.6;
}

.update-entry__pin {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.75rem;
  color: #f59e0b;
}
