/* ===========================
   Privy Suite — LoKey Design System
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* Token Variables */
:root {
  /* Primary */
  --primary-500: #1766D6;
  --primary-600: #104EB8;
  --primary-hover: #104EB8;
  --primary-active: rgba(23, 102, 214, 0.9);
  --primary-disabled: rgba(23, 102, 214, 0.32);

  /* Neutral */
  --neutral-0: #FFFFFF;
  --neutral-10: #FAFAFB;
  --neutral-20: #F3F3F4;
  --neutral-50: #E7E8E9;
  --neutral-200: #7D8187;
  --neutral-500: #131A25;
  --neutral-900: #000000;

  /* Semantic */
  --success: #4CAF47;
  --info: #33AFCD;
  --warning: #ED8E00;
  --error: #E23318;

  /* Derived */
  --text-disabled: rgba(19, 26, 37, 0.4);
  --border-default: rgba(19, 26, 37, 0.2);
  --surface-hover: rgba(0, 0, 0, 0.04);

  /* Sidebar */
  --sidebar-bg: #1a2332;
  --sidebar-border: #2d3748;

  /* Spacing */
  --spacing-1: 8px;
  --spacing-2: 16px;
  --spacing-3: 24px;
  --spacing-4: 32px;
  --spacing-5: 40px;
  --spacing-6: 48px;
  --spacing-8: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
}

/* ===========================
   Reset & Base
   =========================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: var(--neutral-10);
  color: var(--neutral-500);
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  background: none;
}

/* ===========================
   Layout
   =========================== */

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 40px;
  background: var(--neutral-0);
  border-bottom: 1px solid var(--neutral-50);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-50);
  cursor: pointer;
  transition: background 0.2s;
}

.header-user:hover {
  background: var(--surface-hover);
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.header-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-user-avatar .avatar-initials {
  color: var(--neutral-0);
  font-size: 12px;
  font-weight: var(--fw-semibold);
}

.header-user-info {
  display: flex;
  flex-direction: column;
}

.header-user-name {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--neutral-500);
  line-height: 1.3;
}

.header-user-role {
  font-size: 11px;
  font-weight: var(--fw-medium);
  color: var(--neutral-200);
  line-height: 1.3;
}

.header-user-chevron {
  width: 16px;
  height: 16px;
  color: var(--neutral-200);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 40px 48px 60px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ===========================
   Welcome Section
   =========================== */

.welcome-section {
  margin-bottom: 40px;
}

.welcome-title {
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: var(--neutral-500);
  line-height: 1.3;
  margin-bottom: 6px;
}

.welcome-title .accent {
  color: var(--primary-500);
}

.welcome-subtitle {
  font-size: 14px;
  font-weight: var(--fw-regular);
  color: var(--neutral-200);
}

/* ===========================
   Back Button
   =========================== */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--primary-500);
  margin-bottom: 24px;
  padding: 6px 0;
  transition: opacity 0.2s;
}

.back-btn:hover {
  opacity: 0.8;
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

/* ===========================
   Section Label
   =========================== */

.section-label {
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 20px;
}

/* ===========================
   Main Tiles (Homepage)
   =========================== */

.main-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 8px;
}

.main-tile {
  background: var(--neutral-0);
  border: 1px solid var(--neutral-50);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.main-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(23, 102, 214, 0.03), rgba(23, 102, 214, 0));
  opacity: 0;
  transition: opacity 0.3s;
}

.main-tile:hover {
  border-color: var(--primary-500);
  box-shadow: 0 8px 32px rgba(23, 102, 214, 0.12);
  transform: translateY(-2px);
}

.main-tile:hover::before {
  opacity: 1;
}

.main-tile-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--neutral-500);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.main-tile-icon svg {
  width: 32px;
  height: 32px;
  color: var(--neutral-0);
}

.main-tile-title {
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--neutral-500);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.main-tile-desc {
  font-size: 13px;
  font-weight: var(--fw-regular);
  color: var(--neutral-200);
  line-height: 1.5;
  max-width: 320px;
  position: relative;
  z-index: 1;
}

/* ===========================
   Card Grid (Sub-pages)
   =========================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card-grid--three {
  grid-template-columns: repeat(3, 1fr);
}

/* Product Card */
.product-card {
  background: var(--neutral-0);
  border: 1px solid var(--neutral-50);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 180px;
}

.product-card--active {
  cursor: pointer;
}

.product-card--active:hover {
  border-color: var(--primary-500);
  box-shadow: 0 4px 20px rgba(23, 102, 214, 0.1);
  transform: translateY(-1px);
}

.product-card--coming-soon {
  opacity: 0.65;
  cursor: default;
}

.product-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.product-card-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  background: var(--neutral-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-card-icon svg {
  width: 20px;
  height: 20px;
  color: var(--neutral-0);
}

.product-card-title {
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--neutral-500);
  line-height: 1.3;
}

.product-card-desc {
  font-size: 12px;
  font-weight: var(--fw-regular);
  color: var(--neutral-200);
  line-height: 1.6;
  flex: 1;
}

/* Coming Soon Badge */
.badge-coming-soon {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  color: var(--neutral-200);
  background: var(--neutral-20);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* ===========================
   Footer
   =========================== */

.app-footer {
  background: var(--neutral-500);
  color: var(--neutral-0);
  padding: 48px 48px 0;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-logo {
  font-size: 32px;
  font-weight: var(--fw-bold);
  letter-spacing: 6px;
  color: var(--neutral-0);
}

.footer-tagline {
  font-size: 13px;
  font-weight: var(--fw-regular);
  color: var(--primary-500);
}

.footer-links-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-title {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--neutral-200);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-link {
  font-size: 13px;
  font-weight: var(--fw-regular);
  color: var(--neutral-0);
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--primary-500);
}

.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-bar span,
.footer-bar a {
  font-size: 12px;
  font-weight: var(--fw-regular);
  color: rgba(255, 255, 255, 0.5);
}

.footer-bar a {
  transition: color 0.2s;
}

.footer-bar a:hover {
  color: var(--neutral-0);
}

/* ===========================
   View Transitions
   =========================== */

.view {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .main-content {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .card-grid,
  .card-grid--three {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-tiles {
    grid-template-columns: 1fr;
  }
  .main-content {
    padding: 24px 20px;
  }
  .footer-content {
    flex-direction: column;
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .card-grid,
  .card-grid--three {
    grid-template-columns: 1fr;
  }
}
