/* ============================================================
   InterSpace FanLink — Design System
   ============================================================ */

@font-face {
  font-family: 'MonaSans-Regular';
  src: url('/fm/assets/fantum/Mona-Sans.woff2') format('woff2 supports variations'),
       url('/fm/assets/fantum/Mona-Sans.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img { display: block; }

/* ---- Dark theme tokens (verbatim from tamagui.css t_dark block) ---- */
html, body {
  --background: #111111;
  --backgroundHover: #151515;
  --backgroundPress: rgba(10,10,10,0.75);
  --color1: #050505;
  --color2: #151515;
  --color3: #191919;
  --color4: #232323;
  --color5: #282828;
  --color6: #323232;
  --color7: #424242;
  --color8: #494949;
  --color9: #545454;
  --color10: #626262;
  --color11: #a5a5a5;
  --color12: #ffffff;
  --color: #ffffff;
  --colorHover: #a5a5a5;
  --borderColor: #232323;
  --borderColorHover: #282828;
  --borderColorPress: #191919;
  --placeholderColor: #545454;
  --shadowColor: rgba(0,0,0,0.3);
  /* brand accent */
  --txt: #ffffff;
  --txtSub: rgba(255,255,255,0.5);
  --txtSub10: rgba(255,255,255,0.1);
  --btns: rgba(255,255,255,0.1);
  --btnsIn: rgba(255,255,255,0.05);
  --promoBg: #ffffff;
  --promoTxt: #000000;
  --brand: #FEDA03;
  --delete: #F53D6B;
  --green: #2DCA72;
  /* Radius (--c-radius-* from tamagui.css) */
  --r1: 3px; --r2: 5px; --r3: 7px; --r4: 9px; --r5: 10px;
  --r6: 16px; --r7: 19px; --r8: 22px; --r12: 50px;
}

body {
  font-family: 'MonaSans-Regular', -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Hide scrollbar on mobile (matches global.css) */
@media (max-width: 768px) {
  * { -ms-overflow-style: none; scrollbar-width: none; }
  *::-webkit-scrollbar { display: none; }
}

/* ============================================================
   SPINNER
   ============================================================ */
.ftu-spinner-page {
  height: 100vh; width: 100%; display: flex;
  align-items: center; justify-content: center;
  background: var(--background);
}
.ftu-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(254,218,3,0.2);
  border-top-color: #FEDA03;
  border-radius: 50%;
  animation: ftu-spin 0.85s linear infinite;
}
@keyframes ftu-spin { to { transform: rotate(360deg); } }

/* ============================================================
   PROVIDER BUTTON — exact anatomy from page JS source:
   outer: br:16, bg:$btns=rgba(255,255,255,.1), padding:12, justify:space-between
   logo: 40×40, br:10
   pill: bg:$btnsIn=rgba(255,255,255,.05), px:18, h:30, fz:12, br:99
   ============================================================ */
.ftu-providers { display: flex; flex-direction: column; gap: 10px; width: 100%; }

.ftu-provider-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px;
  background: var(--btns);
  border-radius: 16px;
  border: none; cursor: pointer;
  transition: filter 120ms ease;
  gap: 10px; text-decoration: none; color: inherit;
}
.ftu-provider-btn:hover { filter: brightness(1.18); }

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

.ftu-provider-logo {
  width: 40px; height: 40px; border-radius: 10px;
  object-fit: contain; flex-shrink: 0;
}

.ftu-provider-name {
  font-size: 15px; font-weight: 500; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ftu-provider-cta {
  display: flex; align-items: center; justify-content: center;
  padding: 0 18px; height: 30px;
  background: var(--btnsIn);
  border-radius: 99px; flex-shrink: 0;
}
.ftu-provider-cta span { font-size: 12px; font-weight: 400; color: var(--txt); white-space: nowrap; }

/* ============================================================
   ARTWORK CARD
   ============================================================ */
.ftu-artwork {
  width: 260px; height: 260px;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55);
  flex-shrink: 0; background: var(--color4);
  display: flex; align-items: center; justify-content: center;
}
.ftu-artwork img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 768px) {
  .ftu-artwork { width: 210px; height: 210px; border-radius: 12px; }
}

/* ============================================================
   SMARTLINK PUBLIC PAGE
   ============================================================ */
.ftu-sl-page {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; min-height: 100vh;
  background: var(--background);
  padding: 48px 20px 100px;
}
.ftu-sl-inner {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 460px; gap: 24px;
}
.ftu-song-meta { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.ftu-song-title { font-size: 22px; font-weight: 700; color: var(--txt); margin: 0; line-height: 1.1; }
.ftu-song-artist { font-size: 14px; font-weight: 400; color: var(--txtSub); margin: 0; }

/* ============================================================
   WATERMARK
   ============================================================ */
.ftu-watermark {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; align-items: center; gap: 6px;
  background: var(--promoBg); color: var(--promoTxt);
  padding: 6px 14px 6px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  z-index: 100; text-decoration: none;
}
.ftu-watermark img { height: 16px; width: auto; display: inline-block; }

/* ============================================================
   AUTH PAGES (login / signup)
   ============================================================ */
.ftu-auth-page {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh;
  background: #111111; padding: 20px; gap: 28px;
}
.ftu-auth-logo img { height: 26px; width: auto; filter: invert(1); display: block; }
.ftu-auth-card {
  display: flex; flex-direction: column; gap: 20px;
  width: 100%; max-width: 380px;
  padding: 32px 28px;
  background: var(--color2);
  border: 1px solid var(--borderColor);
  border-radius: 16px;
}
.ftu-auth-h1 { font-size: 22px; font-weight: 700; color: var(--txt); text-align: center; margin: 0; }
.ftu-auth-sub { font-size: 13px; font-weight: 300; color: var(--txtSub); text-align: center; margin: -8px 0 0; line-height: 1.4; }
.ftu-auth-fields { display: flex; flex-direction: column; gap: 14px; }
.ftu-field { display: flex; flex-direction: column; gap: 6px; }
.ftu-label { font-size: 12px; font-weight: 400; color: var(--txtSub); letter-spacing: 0.02em; }
.ftu-input {
  background: var(--color3); border: 1px solid var(--borderColor);
  border-radius: 9px; padding: 0 14px; height: 44px;
  font-size: 14px; font-weight: 400; color: var(--txt); width: 100%;
  transition: border-color 120ms ease; outline: none;
}
.ftu-input::placeholder { color: var(--placeholderColor); font-weight: 300; }
.ftu-input:focus { border-color: var(--brand); }
.ftu-error {
  font-size: 12px; color: var(--delete);
  padding: 10px 14px; background: rgba(245,61,107,0.08);
  border-radius: 7px; border: 1px solid rgba(245,61,107,0.2); margin: 0;
}
.ftu-btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; background: var(--brand); color: #000;
  border: none; border-radius: 9px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; width: 100%;
  transition: opacity 100ms ease;
}
.ftu-btn-primary:hover { opacity: 0.88; }
.ftu-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.ftu-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--txtSub); font-size: 12px;
}
.ftu-divider::before, .ftu-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--borderColor);
}
.ftu-auth-switch { font-size: 13px; color: var(--txtSub); text-align: center; margin: 0; }
.ftu-auth-switch a { color: var(--brand); font-weight: 600; }

/* ============================================================
   NAV BAR
   ============================================================ */
.ftu-nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 20px;
  background: var(--color1); border-bottom: 1px solid var(--borderColor);
  position: sticky; top: 0; z-index: 200;
  width: 100%; flex-shrink: 0;
}
.ftu-nav-logo img { height: 20px; width: auto; filter: invert(1); display: block; }
.ftu-nav-actions { display: flex; align-items: center; gap: 8px; }
.ftu-nav-user {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color4); border: none;
  font-size: 13px; font-weight: 700; color: var(--txt);
  text-transform: uppercase; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 100ms;
}
.ftu-nav-user:hover { background: var(--color5); }
.ftu-btn-ghost {
  display: flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px;
  background: var(--btns); border: none; border-radius: 9px;
  font-size: 13px; font-weight: 500; color: var(--txtSub);
  cursor: pointer; transition: color 100ms, background 100ms;
}
.ftu-btn-ghost:hover { color: var(--txt); background: var(--color4); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.ftu-dash-wrap { display: flex; flex-direction: column; height: 100vh; background: var(--background); }
.ftu-dash-body { display: flex; flex: 1; overflow: hidden; }
.ftu-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--color1); border-right: 1px solid var(--borderColor);
  display: flex; flex-direction: column;
  padding: 16px 10px; gap: 2px; overflow-y: auto;
}
.ftu-sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 7px;
  font-size: 14px; font-weight: 400; color: var(--txtSub);
  text-decoration: none; cursor: pointer;
  transition: background 100ms, color 100ms;
  border: none; background: transparent; width: 100%; text-align: left;
}
.ftu-sidebar-item:hover, .ftu-sidebar-item.active {
  background: var(--btns); color: var(--txt);
}
.ftu-sidebar-item.active { font-weight: 500; }
.ftu-sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.75; }
.ftu-sidebar-spacer { flex: 1; }
.ftu-dash-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.ftu-dash-content { padding: 28px 24px; display: flex; flex-direction: column; gap: 20px; max-width: 860px; width: 100%; }
.ftu-dash-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ftu-dash-title { font-size: 22px; font-weight: 700; color: var(--txt); margin: 0; }
.ftu-dash-sub { font-size: 13px; font-weight: 300; color: var(--txtSub); margin: 4px 0 0; }

/* FAB / primary action button */
.ftu-fab {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px;
  background: var(--brand); color: #000;
  border: none; border-radius: 9px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: opacity 100ms; flex-shrink: 0;
  text-decoration: none;
}
.ftu-fab:hover { opacity: 0.88; }
.ftu-fab:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   SONG / LINK CARD (dashboard list)
   ============================================================ */
.ftu-links-list { display: flex; flex-direction: column; gap: 10px; }

.ftu-link-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--color2); border: 1px solid var(--borderColor);
  border-radius: 9px; text-decoration: none; color: inherit;
  transition: background 100ms, border-color 100ms;
}
.ftu-link-card:hover { background: var(--color3); border-color: var(--borderColorHover); }

.ftu-link-art {
  width: 52px; height: 52px; border-radius: 5px;
  overflow: hidden; flex-shrink: 0;
  background: var(--color4);
  display: flex; align-items: center; justify-content: center;
}
.ftu-link-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ftu-link-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ftu-link-title {
  font-size: 14px; font-weight: 600; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0;
}
.ftu-link-artist {
  font-size: 12px; font-weight: 300; color: var(--txtSub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0;
}
.ftu-link-slug { font-size: 11px; color: var(--txtSub); margin: 0; opacity: 0.7; }

.ftu-link-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.ftu-badge {
  font-size: 11px; font-weight: 400; color: var(--txtSub);
  background: var(--btnsIn); padding: 3px 8px; border-radius: 99px;
  white-space: nowrap;
}
.ftu-badge.live { color: var(--green); background: rgba(45,202,114,0.1); }
.ftu-badge.draft { color: var(--txtSub); background: var(--btnsIn); }

.ftu-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent; border: none; border-radius: 7px;
  color: var(--txtSub); cursor: pointer;
  transition: background 100ms, color 100ms; padding: 0;
}
.ftu-icon-btn:hover { background: var(--btns); color: var(--txt); }
.ftu-icon-btn.danger:hover { background: rgba(245,61,107,0.1); color: var(--delete); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.ftu-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  padding: 60px 20px; text-align: center;
}
.ftu-empty-icon { font-size: 40px; opacity: 0.3; }
.ftu-empty-title { font-size: 16px; font-weight: 600; color: var(--txt); margin: 0; }
.ftu-empty-sub { font-size: 13px; font-weight: 300; color: var(--txtSub); margin: 0; max-width: 260px; line-height: 1.5; }

/* ============================================================
   SMARTLINK BUILDER
   ============================================================ */
.ftu-builder-wrap {
  display: flex; gap: 0; min-height: calc(100vh - 56px);
  background: var(--background);
}
/* Form side */
.ftu-builder-form {
  flex: 1; overflow-y: auto; padding: 28px 24px;
  display: flex; flex-direction: column; gap: 20px;
  max-width: 540px; border-right: 1px solid var(--borderColor);
}
/* Preview side */
.ftu-builder-preview {
  width: 380px; flex-shrink: 0; position: sticky; top: 0;
  height: calc(100vh - 56px); overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; gap: 20px;
  background: var(--color1);
}
.ftu-builder-preview-label {
  font-size: 11px; font-weight: 600; color: var(--txtSub);
  letter-spacing: 0.1em; text-transform: uppercase; margin: 0;
}

/* Form section */
.ftu-form-section { display: flex; flex-direction: column; gap: 14px; }
.ftu-section-title {
  font-size: 12px; font-weight: 600; color: var(--txtSub);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 8px 0 0;
}
.ftu-field-row { display: flex; gap: 12px; }
.ftu-field-row .ftu-field { flex: 1; }

/* Textarea */
.ftu-textarea {
  background: var(--color3); border: 1px solid var(--borderColor);
  border-radius: 9px; padding: 10px 14px;
  font-size: 14px; color: var(--txt); width: 100%;
  resize: vertical; min-height: 80px; outline: none;
  transition: border-color 120ms ease;
}
.ftu-textarea:focus { border-color: var(--brand); }

/* Cover upload */
.ftu-cover-upload {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; background: var(--color3);
  border: 1px dashed var(--borderColor); border-radius: 9px;
  cursor: pointer; transition: border-color 120ms;
}
.ftu-cover-upload:hover { border-color: var(--brand); }
.ftu-cover-preview {
  width: 60px; height: 60px; border-radius: 7px;
  overflow: hidden; background: var(--color4); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ftu-cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.ftu-cover-info { flex: 1; }
.ftu-cover-info p { font-size: 13px; font-weight: 500; color: var(--txt); margin: 0 0 2px; }
.ftu-cover-info span { font-size: 11px; color: var(--txtSub); }

/* Platform rows in builder */
.ftu-platform-rows { display: flex; flex-direction: column; gap: 8px; }
.ftu-platform-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--btnsIn); border: 1px solid var(--borderColor);
  border-radius: 9px;
}
.ftu-platform-row-logo {
  width: 30px; height: 30px; border-radius: 7px;
  object-fit: contain; flex-shrink: 0;
}
.ftu-platform-row-name {
  font-size: 13px; font-weight: 500; color: var(--txt);
  flex: 0 0 100px; white-space: nowrap;
}
.ftu-platform-row-input {
  flex: 1; background: var(--color3); border: 1px solid var(--borderColor);
  border-radius: 7px; padding: 0 10px; height: 34px;
  font-size: 12px; color: var(--txt); min-width: 0;
  outline: none; transition: border-color 120ms;
}
.ftu-platform-row-input:focus { border-color: var(--brand); }
.ftu-platform-row-input::placeholder { color: var(--placeholderColor); }

/* Slug field + preview */
.ftu-slug-wrap { position: relative; }
.ftu-slug-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--txtSub); pointer-events: none;
  white-space: nowrap;
}
.ftu-slug-input { padding-left: calc(14px + var(--slug-prefix-w, 7ch)); }

/* Builder action bar */
.ftu-builder-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--borderColor);
  background: var(--color1); position: sticky; bottom: 0;
}

/* ============================================================
   TOAST
   ============================================================ */
.ftu-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--color5); color: var(--txt);
  padding: 12px 20px; border-radius: 9px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 9999; white-space: nowrap;
  animation: ftu-toast-in 200ms ease;
  pointer-events: none;
}
@keyframes ftu-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   COPY LINK CHIP
   ============================================================ */
.ftu-copy-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 4px 4px 10px; background: var(--btnsIn);
  border-radius: 99px; font-size: 11px; color: var(--txtSub);
  border: none; cursor: pointer; transition: background 100ms;
  white-space: nowrap;
}
.ftu-copy-chip:hover { background: var(--btns); }
.ftu-copy-chip-icon {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; background: var(--btns); border-radius: 50%;
}

/* ============================================================
   PROFILE PAGE (public)
   ============================================================ */
.ftu-profile-page { display: flex; flex-direction: column; align-items: center; min-height: 100vh; background: var(--background); }
.ftu-creator-header { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px 28px; text-align: center; }
.ftu-creator-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  overflow: hidden; background: var(--color4);
  border: 2px solid var(--borderColor); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: var(--txt); text-transform: uppercase;
}
.ftu-creator-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ftu-creator-name { font-size: 20px; font-weight: 700; color: var(--txt); margin: 0; }
.ftu-creator-handle { font-size: 13px; color: var(--txtSub); margin: 0; }
.ftu-profile-links { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 460px; padding: 0 20px 80px; }

/* ============================================================
   SELECT / RADIO TOGGLE
   ============================================================ */
.ftu-toggle-group { display: flex; gap: 6px; }
.ftu-toggle-btn {
  flex: 1; height: 38px; border: 1px solid var(--borderColor);
  border-radius: 7px; background: transparent;
  font-size: 13px; font-weight: 400; color: var(--txtSub);
  cursor: pointer; transition: all 100ms;
}
.ftu-toggle-btn.active, .ftu-toggle-btn:hover {
  background: var(--btns); color: var(--txt); border-color: var(--borderColorHover);
}
.ftu-toggle-btn.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* ============================================================
   MODAL (for confirmations)
   ============================================================ */
.ftu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 20px; backdrop-filter: blur(4px);
}
.ftu-modal {
  background: var(--color2); border: 1px solid var(--borderColor);
  border-radius: 16px; width: 100%; max-width: 360px;
  padding: 28px 24px; display: flex; flex-direction: column; gap: 16px;
}
.ftu-modal-title { font-size: 17px; font-weight: 700; color: var(--txt); margin: 0; }
.ftu-modal-body { font-size: 14px; font-weight: 300; color: var(--txtSub); line-height: 1.5; margin: 0; }
.ftu-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.ftu-btn-danger {
  height: 38px; padding: 0 18px; background: var(--delete);
  color: #fff; border: none; border-radius: 9px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity 100ms;
}
.ftu-btn-danger:hover { opacity: 0.85; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .ftu-sidebar { display: none; }
  .ftu-dash-body { flex-direction: column; }
  .ftu-dash-content { padding: 20px 16px; }
  .ftu-sl-page { padding: 36px 16px 80px; }
  .ftu-builder-preview { display: none; }
  .ftu-builder-form { max-width: 100%; border-right: none; }
  .ftu-auth-card { padding: 24px 20px; }
  .ftu-profile-links { padding: 0 16px 80px; }
}
