@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap');

:root {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --border: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
  --destructive: 0 62.8% 30.6%;
  --radius: 0.5rem;
}

html,
body {
  min-height: 100%;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  margin: 0;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.text-muted-custom {
  color: hsl(var(--muted-foreground));
}

.hover-white:hover {
  color: #fff !important;
}

.bg-muted-alpha {
  background-color: hsl(240 3.7% 15.9% / 30%);
}

.border-custom {
  border: 1px solid hsl(var(--border));
}

.glass-card {
  background: hsl(var(--card) / 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.card-dark {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.badge-gold {
  background: hsl(240 3.7% 15.9% / 30%);
  color: #ffd700;
  border: 1px solid hsl(var(--border));
}

.section-pad {
  padding: 6rem 0;
}

.tracking-tighter {
  letter-spacing: -0.05em;
}

.tracking-widest {
  letter-spacing: 0.1em;
}

.hero-nav {
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid hsl(var(--border));
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary-custom {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary-custom:hover {
  opacity: 0.92;
  color: hsl(var(--primary-foreground));
}

.badge-glass-custom {
  display: inline-block;
  background: linear-gradient(to right, hsl(var(--primary) / 0.1), hsl(var(--primary) / 0.05));
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--primary) / 0.2);
  color: hsl(var(--foreground));
  font-size: 0.8rem;
  font-weight: 500;
}

.hero-btn-primary,
.hero-btn-secondary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-btn-primary {
  background-color: #fff;
  color: #000;
  font-weight: 700;
  padding: 1.25rem 2.5rem;
  border-radius: 9999px;
  border: none;
  transition: all 0.2s ease;
}

.hero-btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 20px -5px rgba(255, 255, 255, 0.3);
  color: #000;
}

.hero-btn-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 700;
  padding: 1.25rem 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.hero-section {
  padding-top: 6rem !important;
  padding-bottom: 4rem;
}

.shape-future-card {
  background: linear-gradient(to right, hsl(var(--secondary) / 0.2), transparent);
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 12px;
  padding: 1.25rem 2rem;
  max-width: 850px;
  margin: 1.5rem auto 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.innovation-section {
  position: relative;
  overflow: hidden;
}

.decorative-side-img {
  position: absolute;
  top: 50%;
  width: 400px;
  height: 500px;
  object-fit: cover;
  opacity: 0.1;
  filter: blur(20px) grayscale(100%);
  pointer-events: none;
  z-index: 0;
}

.decorative-side-img.left {
  left: -150px;
  transform: translateY(-50%) rotate(-15deg);
}

.decorative-side-img.right {
  right: -150px;
  transform: translateY(-50%) rotate(15deg);
}

.icon-box {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  margin-bottom: 1.5rem;
  color: #fff;
}

.feature-card {
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  height: 100%;
  position: relative;
  z-index: 1;
}

.feature-card:hover {
  border-color: hsl(var(--border));
  background-color: hsl(var(--secondary) / 0.1);
}

.scan-card {
  position: relative;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 2rem;
  overflow: hidden;
  height: 520px;
}

.scan-card.short {
  height: 180px;
}

.scan-card .image-wrapper {
  position: absolute;
  inset: 0;
}

.scan-card .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.scan-card .content-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

.scan-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #fff;
}

.marquee-container {
  overflow: hidden;
  width: 100%;
}

.marquee-content {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: scroll 40s linear infinite;
}

.testimonial-card {
  width: 350px;
  background-color: hsl(240 3.7% 15.9% / 15%);
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 1.5rem;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cursive-name {
  font-family: 'Dancing Script', cursive, serif;
  font-size: 1.2rem;
  color: hsl(var(--foreground));
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background: radial-gradient(800px 600px at 50% 10%, hsl(var(--secondary) / 0.35), transparent 60%), radial-gradient(700px 500px at 20% 60%, hsl(var(--secondary) / 0.2), transparent 60%), hsl(var(--background));
}

.auth-card {
  width: min(520px, 100%);
  padding: 2.25rem 2.25rem 2rem;
  border-radius: 18px;
  background: hsl(var(--card) / 0.75);
  border: 1px solid hsl(var(--border));
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 2.1rem;
  font-weight: 800;
}

.auth-subtitle {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.95rem;
}

.auth-label {
  color: hsl(var(--muted-foreground));
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.auth-input {
  background: hsl(var(--secondary) / 0.35) !important;
  border: 1px solid hsl(var(--border)) !important;
  color: hsl(var(--foreground)) !important;
  padding: 0.9rem 1rem !important;
  border-radius: 12px !important;
}

.auth-input:focus {
  border-color: hsl(var(--ring)) !important;
  box-shadow: 0 0 0 4px hsl(var(--ring) / 0.15) !important;
}

.auth-primary-btn {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.95rem 1rem !important;
  border-radius: 12px !important;
  border: none !important;
  background: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
  font-weight: 800 !important;
}

.auth-error {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.2);
  color: hsl(var(--foreground));
  font-size: 0.85rem;
}

.app-placeholder {
  min-height: 100vh;
  padding: 6rem 1rem 3rem;
}

.app-placeholder-card {
  max-width: 780px;
  margin: 0 auto;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 24px;
  padding: 2rem;
}

.app-layout {
  min-height: 100vh;
  display: flex;
  background: #000;
  color: #fff;
}

.app-sidebar {
  width: 260px;
  min-width: 260px;
  background: #111;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-sidebar-brand {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
}

.admin-nav-item:hover,
.admin-nav-item.is-active {
  background: hsl(var(--secondary) / 0.45);
  border-color: hsl(var(--border));
  color: #fff;
}

.app-sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

.app-account-dropdown {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.app-user-chip-toggle {
  width: 100%;
  text-align: left;
  border: 1px solid hsl(var(--border));
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.app-user-chip-toggle:hover {
  background: hsl(var(--secondary) / 0.34);
  border-color: rgba(255, 255, 255, 0.14);
}

.app-user-chip-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.2);
  outline-offset: 2px;
}

.app-user-chip {
  position: relative;
}

.app-user-chip-caret {
  margin-left: auto;
  color: hsl(var(--muted-foreground));
  font-size: 0.78rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.app-account-dropdown.is-open .app-user-chip-caret {
  transform: rotate(180deg);
  color: #fff;
}

.app-account-dropdown-panel {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.app-account-dropdown.is-open .app-account-dropdown-panel {
  display: flex;
}

.app-account-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.9rem 0.95rem;
  border-radius: 14px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary) / 0.18);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.app-account-card:hover,
.app-account-card.is-active {
  background: hsl(var(--secondary) / 0.32);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.app-account-card-icon {
  color: #f4f4f5;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
}

.app-account-card-body {
  min-width: 0;
}

.app-account-card-title {
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
}

.app-account-card-copy {
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  line-height: 1.3;
  margin-top: 0.18rem;
}

.app-account-card-badge {
  min-width: 38px;
  height: 30px;
  padding: 0 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 203, 70, 0.6);
  color: #f6c84c;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(246, 200, 76, 0.08);
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-main-body {
  padding: 1.5rem;
}

.app-main-body-chat {
  padding: 0;
}

.app-user-chip {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: hsl(var(--secondary) / 0.2);
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.app-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: hsl(var(--secondary));
}

.dashboard-card {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.dashboard-empty {
  background: #202020;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.macro-box {
  min-width: 120px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-task-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-task-item:last-child {
  border-bottom: 0;
}

.dashboard-check {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
}

.dashboard-check.is-done {
  background: #198754;
}

.coach-chat-shell {
  min-height: calc(100vh - 73px);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background:
    radial-gradient(circle at top right, rgba(19, 95, 211, 0.12), transparent 30%),
    linear-gradient(180deg, #0a0a0d 0%, #050507 100%);
}

.coach-chat-sidebar-panel {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(10, 10, 13, 0.88);
}

.coach-chat-panel-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.coach-chat-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #111827;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.coach-chat-brand-title {
  font-weight: 800;
  font-size: 1rem;
}

.coach-chat-brand-copy {
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
}

.coach-chat-new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #17171c;
  color: #fff;
  font-weight: 700;
}

.coach-chat-new-btn:hover {
  background: #1e1f26;
}

.coach-chat-section-head {
  padding-top: 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.9rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coach-thread-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 180px;
  flex: 1;
}

.coach-thread-item {
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #141419;
  color: #fff;
}

.coach-thread-item:hover,
.coach-thread-item.is-active {
  background: #1c1d25;
  border-color: rgba(255, 255, 255, 0.08);
}

.coach-thread-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.92rem;
  font-weight: 600;
}

.coach-thread-empty {
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: hsl(var(--muted-foreground));
  font-size: 0.88rem;
}

.coach-profile-cta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  background: #0f1117;
  color: #fff;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.coach-chat-main-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1rem;
  gap: 1rem;
}

.coach-chat-hero {
  margin: auto;
  max-width: 620px;
  text-align: center;
  color: #fff;
  padding: 2rem;
}

.coach-chat-hero.is-hidden {
  display: none;
}

.coach-chat-empty-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #16181f;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.coach-chat-hero h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.coach-chat-hero p {
  color: hsl(var(--muted-foreground));
  margin: 0;
  line-height: 1.7;
}

.coach-chat-messages {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0.75rem 0 0.75rem;
}

.coach-chat-messages.is-visible {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.coach-message {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.coach-message-user {
  align-items: flex-end;
}

.coach-message-assistant {
  align-items: flex-start;
}

.coach-message-card {
  max-width: min(840px, 84%);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  line-height: 1.65;
  white-space: normal;
}

.coach-message-user .coach-message-card {
  background: #f8f7f5;
  color: #111827;
  border-top-right-radius: 6px;
}

.coach-message-assistant .coach-message-card {
  background: #1a1a1f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: 6px;
}

.coach-message-meta {
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  padding: 0 0.35rem;
}

.coach-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 0.8rem;
  align-items: end;
  padding-top: 0.5rem;
}

.coach-chat-input {
  min-height: 52px;
  max-height: 180px;
  resize: none;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #17171c;
  color: #fff;
  padding: 0.95rem 1rem;
  outline: none;
}

.coach-chat-input:focus {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.coach-chat-send {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 0;
  background: #f3f4f6;
  color: #111827;
  font-size: 1rem;
}

.coach-chat-send:disabled {
  opacity: 0.5;
}

@media (max-width: 900px) {
  .app-layout {
    flex-direction: row;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 80vw;
    max-width: 320px;
    min-width: 0;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 16px rgba(0,0,0,0.18);
    border-right: 1px solid rgba(255,255,255,0.08);
    border-bottom: 0;
    background: #111;
  }
  .app-sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    z-index: 1199;
    transition: opacity 0.3s cubic-bezier(.4,0,.2,1);
    opacity: 0;
  }
  .sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
  }
  .app-main {
    width: 100vw;
    margin-left: 0;
  }
  .app-main-body {
    padding: 1rem;
  }
  .app-main-body-chat {
    padding: 0;
  }
  .coach-chat-shell {
    grid-template-columns: 1fr;
  }
  .coach-chat-sidebar-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .coach-message-card {
    max-width: 100%;
  }
  .sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    margin-right: 1rem;
    cursor: pointer;
    z-index: 1300;
  }
}
/* Always hide sidebar toggle on desktop */
.sidebar-toggle-btn {
  display: none;
}
@media (max-width: 900px) {
  .sidebar-toggle-btn {
    display: inline-flex;
  }
}
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 576px) {
  .hero-btn-primary,
  .hero-btn-secondary {
    width: 100%;
  }

  .testimonial-card {
    width: 300px;
  }

  .shape-future-card {
    flex-direction: column;
    align-items: flex-start;
  }
}