/* PropertyManager design system — CSS variables + vanilla dark/light theming.
   No build step, no framework: keeps the Docker image and dev loop fast. */

:root {
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.6);
  --text: #12131a;
  --text-muted: #5b5f73;
  --border: rgba(18, 19, 26, 0.08);
  --brand-1: #4f46e5;
  --brand-2: #06b6d4;
  --brand-3: #a855f7;
  --accent-text: #ffffff;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 8px 30px rgba(18, 19, 26, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0a0b12;
  --bg-elevated: #12131e;
  --bg-glass: rgba(18, 19, 30, 0.55);
  --text: #eef0fa;
  --text-muted: #9297b3;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b12;
    --bg-elevated: #12131e;
    --bg-glass: rgba(18, 19, 30, 0.55);
    --text: #eef0fa;
    --text-muted: #9297b3;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2) 60%, var(--brand-3));
  box-shadow: 0 0 22px rgba(79, 70, 229, 0.5);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.nav-links a:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--border);
  background: transparent;
}

.btn-ghost:hover { background: var(--border); }

.btn-block { width: 100%; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  color: var(--text);
}

/* Hero */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2) 50%, var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 34px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 72px;
}

.stat-card {
  text-align: center;
  padding: 22px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Feature grid */
.section {
  padding: 80px 0;
}

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-head p { color: var(--text-muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(6, 182, 212, 0.15));
}

.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Auth / centered card pages */
.center-page {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.5rem;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.auth-card .sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 26px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.94rem;
  font-family: inherit;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.field-errors {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 6px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.auth-foot {
  text-align: center;
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-foot a { color: var(--brand-1); font-weight: 600; }

/* Language select */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.lang-option {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.lang-option:hover {
  border-color: var(--brand-1);
  transform: translateY(-2px);
}

.lang-option .flag { font-size: 1.8rem; margin-bottom: 10px; display: block; }
.lang-option .name { font-weight: 700; font-size: 1.05rem; }
.lang-option .native { color: var(--text-muted); font-size: 0.85rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Dashboard placeholder */
.dashboard-shell {
  padding: 48px 0 80px;
}

.dashboard-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 40px;
  text-align: center;
}

.lang-switch select {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

/* AI portfolio assistant chat */
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.94rem;
  font-family: inherit;
  resize: vertical;
}

.field textarea:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.assistant-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 32px 0;
}

.assistant-bubble {
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 85%;
}

.assistant-bubble p { margin: 0; white-space: pre-line; }

.assistant-bubble-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.assistant-bubble-user {
  align-self: flex-end;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.assistant-bubble-assistant {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(6, 182, 212, 0.08));
  border-color: rgba(79, 70, 229, 0.25);
}

.assistant-form {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* Floating AI assistant widget ("Portfolio Guide") */
.assistant-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
}

.assistant-fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2) 60%, var(--brand-3));
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.assistant-fab:hover { transform: scale(1.06); }

.assistant-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: min(560px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.assistant-panel[hidden] { display: none; }

.assistant-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.assistant-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.assistant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2) 60%, var(--brand-3));
  flex-shrink: 0;
}

.assistant-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assistant-panel-body .assistant-bubble { max-width: 92%; }
.assistant-panel-body .assistant-bubble p { margin: 0; white-space: pre-line; font-size: 0.9rem; }

.assistant-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.assistant-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.assistant-quick-btn:hover {
  border-color: var(--brand-1);
  transform: translateY(-1px);
}

.assistant-thinking {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.assistant-thinking span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-2);
  animation: assistant-thinking-bounce 1.1s infinite ease-in-out;
}

.assistant-thinking span:nth-child(2) { animation-delay: 0.15s; }
.assistant-thinking span:nth-child(3) { animation-delay: 0.3s; }

@keyframes assistant-thinking-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.assistant-panel-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.assistant-panel-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
}

.assistant-panel-form input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.assistant-send-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  display: flex;
  align-items: center;
  justify-content: center;
}

.assistant-send-btn:disabled { opacity: 0.6; cursor: default; }

.assistant-panel-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .assistant-bubble { max-width: 100%; }

  .assistant-widget { right: 16px; bottom: 16px; }

  .assistant-panel {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: 88px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 120px);
  }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }

  .nav-inner { flex-wrap: wrap; row-gap: 8px; }
  .nav-actions { flex-wrap: wrap; justify-content: flex-end; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 24px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 0;
  }

  .nav-links.is-open {
    max-height: 340px;
    opacity: 1;
  }

  .hero { padding: 56px 0 48px; }
  .section { padding: 48px 0; }
  .auth-card { padding: 28px 20px; }
  .center-page { padding: 32px 16px; }
}
