﻿/* ============================================
   Design System — Fintech Stock Prediction
   ============================================ */

/* --- Tokens --- */
:root {
  --color-bg: #0b0f1a;
  --color-surface: #121826;
  --color-surface-elevated: #1a2233;
  --color-surface-hover: #222c3f;
  --color-border: #1e293b;
  --color-border-focus: #6366f1;

  --color-primary: #6366f1;
  --color-primary-hover: #818cf8;
  --color-primary-pressed: #4f46e5;
  --color-accent: #f59e0b;
  --color-accent-soft: #f59e0b1a;
  --color-success: #10b981;
  --color-error: #ef4444;

  --color-text-primary: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-accent: #fbbf24;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --transition: 200ms ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Focus --- */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Logo / Hero Image --- */
.hero-media {
  text-align: center;
  margin-bottom: var(--space-6);
}

.hero-media img {
  width: 100%;
  max-width: 180px;
  height: auto;
  background: transparent !important;
  animation: float 3s ease-in-out infinite alternate;
}

@keyframes float {
  0% {
    transform: translateY(0);
    filter: drop-shadow(0 4px 12px var(--color-accent-soft));
  }
  100% {
    transform: translateY(-10px);
    filter: drop-shadow(0 10px 24px var(--color-accent-soft));
  }
}

/* --- Typography --- */
.title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
  color: var(--color-text-primary);
  text-align: left;
  width: 100%;
}

.subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: var(--space-6);
  color: var(--color-text-secondary);
  text-align: left;
  width: 100%;
}

/* --- Card --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  margin-bottom: var(--space-6);
  width: 100%;
  box-shadow: var(--shadow-md);
}

.accuracy {
  font-size: 1rem;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.accuracy .percent {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.35rem;
}

.desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.desc .highlight {
  color: var(--color-accent);
  font-weight: 600;
}

/* --- Input --- */
.input-group {
  width: 100%;
  margin-bottom: var(--space-4);
}

.input-group input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group input::placeholder {
  color: var(--color-text-muted);
}

.input-group input:hover {
  border-color: var(--color-text-muted);
}

.input-group input:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* --- Button --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  height: 48px;
  padding: 0 var(--space-6);
  border: none;
  border-radius: var(--radius-xl);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.3);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  background: var(--color-primary-pressed);
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
  transition-duration: 50ms;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled:hover {
  background: var(--color-primary);
}

.btn:disabled::after {
  display: none;
}

/* Pulse ring — subtle attention on primary CTA */
@keyframes btn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.35); }
  100% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
}

.btn--pulse {
  animation: btn-pulse 2.5s ease-out infinite;
}

/* --- Secondary Button (for chat CTA etc.) --- */
.btn--success {
  background: var(--color-success);
}

.btn--success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.3);
}

.btn--success:active {
  background: #047857;
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
  transition-duration: 50ms;
}

.btn--success::after {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18), transparent 60%);
}

/* --- Footer --- */
.footer {
  width: 100%;
  max-width: 420px;
  margin: var(--space-8) auto 0;
  padding: 0 var(--space-4) var(--space-6);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-border);
  transition: color var(--transition), text-decoration-color var(--transition);
}

.footer a:hover {
  color: var(--color-text-secondary);
  text-decoration-color: var(--color-text-secondary);
}

/* --- Modal Overlay --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-content: center;
  animation: fadeIn 200ms ease;
}

.modal-overlay.open {
  display: block;
}

/* --- Progress Modal --- */
.modal-card {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-5);
  max-width: 360px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 300ms ease;
}

.modal-card__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* --- Progress --- */
.progress-item {
  margin-bottom: var(--space-4);
}

.progress-item:last-child {
  margin-bottom: 0;
}

.progress-item__label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--color-surface);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--color-primary), #818cf8);
  transition: width 100ms linear;
  width: 0%;
}

/* --- Result Modal --- */
.result-card {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-5);
  max-width: 360px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 300ms ease;
}

.result-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.result-card__header svg {
  flex-shrink: 0;
}

.result-card__body {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.7;
}

.result-card__body svg {
  flex-shrink: 0;
  vertical-align: middle;
}

.result-card__body ul {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
}

.result-card__body li {
  padding: var(--space-1) 0;
}

.result-card__urgency {
  color: var(--color-accent);
  font-weight: 600;
}

.result-card__cta {
  margin-top: var(--space-5);
  width: 100%;
}

/* --- Utility --- */
.u-mt-2 { margin-top: var(--space-2); }
.u-mt-4 { margin-top: var(--space-4); }
.u-mb-4 { margin-bottom: var(--space-4); }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* --- Responsive --- */
@media (max-width: 480px) {
  .container {
    padding: var(--space-5) var(--space-3) 0;
  }

  .title {
    font-size: 1.75rem;
    text-align: center;
  }

  .subtitle {
    font-size: 1.1rem;
    text-align: center;
  }

  .hero-media img {
    width: 100%;
  }
}
