:root {
  --ink: #16121c;
  --ink-soft: #5a5266;
  --muted: #8a8296;
  --line: rgba(22, 18, 28, 0.1);
  --surface: #ffffff;
  --canvas: #f4f0ea;
  --accent: #7c3aed;
  --accent-ink: #5b21b6;
  --danger: #b42318;
  --ok: #0f766e;
  --font: "Instrument Sans", system-ui, sans-serif;
  --display: "Newsreader", Georgia, serif;
  --shadow: 0 24px 64px rgba(30, 16, 50, 0.14);
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 0% 0%, rgba(124, 58, 237, 0.1), transparent 55%),
    radial-gradient(700px 480px at 100% 10%, rgba(15, 118, 110, 0.08), transparent 50%),
    linear-gradient(145deg, #f7f3ed 0%, #efeaf7 50%, #e8eef5 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* —— Landing —— */
.home-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

@media (max-width: 980px) {
  .home-stage {
    grid-template-columns: 1fr;
  }
}

.home-aside {
  padding: 36px 32px 36px 48px;
  display: flex;
  align-items: flex-start;
  overflow-y: auto;
  max-height: 100vh;
}

.aside-stack {
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: auto 0;
  animation: rise 0.55s ease both;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(30, 16, 50, 0.06);
}

.brand-chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-chip span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.aside-copy h1 {
  margin: 14px 0 10px;
  font-family: var(--display);
  font-size: clamp(2.1rem, 3.4vw, 2.85rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--ink);
}

.aside-copy p {
  margin: 0;
  max-width: 46ch;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.aside-copy p strong {
  color: var(--accent-ink);
  font-weight: 650;
}

.product-board {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 10px;
  box-shadow: 0 18px 40px rgba(30, 16, 50, 0.06);
  backdrop-filter: blur(10px);
}

.product-board-label {
  margin: 6px 14px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid transparent;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  animation: rise 0.5s ease both;
  animation-delay: calc(0.04s * var(--i, 0));
}

.product-row:hover {
  border-color: rgba(124, 58, 237, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(30, 16, 50, 0.07);
}

.product-logo {
  width: 64px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 12px;
  background: #f7f4ef;
}

.product-logo img {
  max-width: 78%;
  max-height: 70%;
  object-fit: contain;
}

.product-logo.pair img {
  max-width: 42%;
  max-height: 68%;
}

.product-meta h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.product-meta p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-live {
  background: rgba(15, 118, 110, 0.1);
  color: var(--ok);
}

.pill-soon {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-ink);
}

/* —— Auth panel —— */
.home-form {
  display: grid;
  place-items: center;
  padding: 40px 32px;
  background:
    linear-gradient(180deg, rgba(28, 18, 48, 0.92), rgba(18, 12, 32, 0.96));
  position: relative;
  overflow: hidden;
}

.home-form::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -120px;
  top: -80px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.35), transparent 65%);
  pointer-events: none;
}

.home-form::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  left: -100px;
  bottom: -100px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.18), transparent 65%);
  pointer-events: none;
}

@media (max-width: 980px) {
  .home-aside { padding: 28px 18px 12px; }
  .home-form {
    padding: 12px 18px 36px;
    background: transparent;
  }
  .home-form::before,
  .home-form::after { display: none; }
  .auth-card {
    box-shadow: var(--shadow);
  }
  .product-row {
    grid-template-columns: 64px 1fr;
  }
  .pill { display: none; }
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: 28px;
  padding: 32px 28px 26px;
  box-shadow: var(--shadow);
  animation: rise 0.6s ease both 0.08s;
}

.prodegy-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.prodegy-mark img {
  width: min(180px, 68%);
  height: auto;
  display: block;
}

.auth-card h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.lead {
  margin: 0 0 22px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  margin: 0 0 6px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #faf8f5;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: var(--ink);
  margin-bottom: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder { color: #9a93a5; }

input:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.5);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn:active { transform: scale(0.985); }

.btn-primary {
  margin-top: 4px;
  background: linear-gradient(135deg, #8b5cf6 0%, #5b21b6 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(91, 33, 182, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9d74ff 0%, #6d28d9 100%);
}

.btn-ghost {
  width: auto;
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 10px;
}

.btn-ghost:hover { color: var(--ink); }

.meta {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.meta a {
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.meta a:hover { text-decoration: underline; }

.hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: -4px 0 14px;
}

.error, .success {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.86rem;
  margin-bottom: 14px;
}

.error {
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.16);
}

.success {
  background: rgba(124, 58, 237, 0.08);
  color: var(--accent-ink);
  border: 1px solid rgba(124, 58, 237, 0.16);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* —— Dashboard —— */
.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.panel {
  width: min(980px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  animation: rise 0.45s ease both;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-brand img {
  height: 44px;
  width: auto;
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
}

.app-tile {
  text-align: left;
  border: 1px solid var(--line);
  background: #faf8f5;
  border-radius: 18px;
  padding: 18px 16px 16px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  font: inherit;
  color: inherit;
}

.app-tile:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 14px 30px rgba(30, 16, 50, 0.08);
}

.app-tile:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.app-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(145deg, #8b5cf6, #5b21b6);
}

.app-icon.fig { background: linear-gradient(145deg, #0f766e, #14b8a6); }
.app-icon.doc { background: linear-gradient(145deg, #8a6230, #c08a4a); }

.app-tile h3 { margin: 0 0 6px; font-size: 1.05rem; }
.app-tile p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; line-height: 1.4; }

.badge {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a6a18;
}

.badge.live { color: var(--ok); }

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #16121c;
}

.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.workspace-bar strong {
  font-family: var(--display);
  font-size: 1.1rem;
}

.canvas-mock {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 400px at 20% 20%, rgba(124, 58, 237, 0.2), transparent 55%),
    #16121c;
}

.canvas-frame {
  width: min(920px, 100%);
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(255,255,255,0.04) 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px, rgba(255,255,255,0.04) 24px),
    #1c1824;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.artboard {
  position: absolute;
  left: 14%;
  top: 16%;
  width: 52%;
  height: 62%;
  background: #fbf8ff;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  padding: 22px;
  color: #1c1228;
}

.artboard h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.4rem;
}

.artboard p {
  margin: 0;
  color: #5e5470;
  font-size: 0.9rem;
}

.toolbar {
  position: absolute;
  left: 18px;
  top: 18px;
  display: grid;
  gap: 8px;
}

.tool {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
}

.note {
  margin: 16px auto 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
  max-width: 520px;
}
