/* MotionForge — Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
  --bg: #ffffff;
  --surface: #f7f9fc;
  --surface2: #eef2f8;
  --border: #e2e8f0;
  --accent: #3b7ef6;
  --accent2: #6c47f5;
  --accent-glow: rgba(59,126,246,0.1);
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --gradient: linear-gradient(135deg, #4f8ef7, #7c5cfc);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(59,126,246,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,126,246,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}

.orb { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; }
.orb-1 { width: 400px; height: 400px; background: rgba(59,126,246,0.06); top: -100px; right: -100px; }
.orb-2 { width: 300px; height: 300px; background: rgba(108,71,245,0.05); bottom: 200px; left: -80px; }

.container { max-width: 860px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* Header */
header { padding: 32px 0 0; text-align: center; }

.logo-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(59,126,246,0.06); border: 1px solid rgba(59,126,246,0.18);
  border-radius: 100px; padding: 6px 16px; font-size: 12px; color: var(--accent);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; margin-bottom: 24px;
}
.logo-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }

h1 {
  font-family: 'Syne', sans-serif; font-size: clamp(28px,5vw,48px); font-weight: 800;
  line-height: 1.1; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0f172a 0%, #4f8ef7 50%, #7c5cfc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 12px;
}

.subtitle { color: var(--text-muted); font-size: 15px; max-width: 440px; margin: 0 auto 32px; font-weight: 300; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px; margin-bottom: 24px; position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,126,246,0.35), transparent);
}

.card-title {
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}
.card-title::before { content: ''; width: 3px; height: 14px; background: var(--gradient); border-radius: 2px; }

/* Form */
.input-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="file"], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(79,142,247,.5); box-shadow: 0 0 0 3px rgba(59,126,246,.06);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }

.input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }

/* Upload */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.upload-zone {
  background: var(--bg); border: 1.5px dashed var(--border); border-radius: 12px;
  padding: 28px 16px; text-align: center; cursor: pointer; position: relative;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover { border-color: rgba(59,126,246,.35); background: rgba(59,126,246,.04); }
.upload-zone.has-file { border-color: var(--accent); background: rgba(59,126,246,.04); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; padding: 0; border: none; background: none; }
.upload-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.upload-label { font-size: 13px; font-weight: 600; color: var(--text); display: block; margin-bottom: 4px; font-family: 'Syne', sans-serif; }
.upload-hint { font-size: 11px; color: var(--text-muted); }
.upload-preview { max-width: 100%; max-height: 120px; border-radius: 8px; margin-top: 10px; display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px; font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s; border: none; outline: none;
}
.btn-primary {
  background: var(--gradient); color: white; width: 100%; padding: 14px;
  font-size: 15px; font-weight: 600; border-radius: 12px; margin-top: 8px; letter-spacing: .01em;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(59,126,246,.2); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: rgba(59,126,246,.08); color: var(--accent); border: 1px solid rgba(59,126,246,.18);
  white-space: nowrap; font-size: 13px; padding: 12px 16px;
}
.btn-secondary:hover { background: rgba(59,126,246,.12); }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 8px 12px; font-size: 13px; }
.btn-ghost:hover { color: var(--accent); }

/* Alerts */
.alert {
  padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: rgba(22,163,74,.08); border: 1px solid rgba(22,163,74,.2); color: #166534; }
.alert-error   { background: rgba(220,38,38,.07);  border: 1px solid rgba(220,38,38,.2);  color: #991b1b; }
.alert-info    { background: rgba(59,126,246,.07);  border: 1px solid rgba(59,126,246,.2);  color: #1d4ed8; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 0 24px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; height: 56px;
}
.nav-brand {
  font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; text-decoration: none;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 13px; color: var(--text-muted); text-decoration: none; padding: 6px 12px;
  border-radius: 8px; transition: all .2s; font-weight: 500;
}
.nav-link:hover, .nav-link.active { color: var(--accent); background: rgba(59,126,246,.07); }
.nav-link.nav-btn {
  background: var(--gradient); color: white; padding: 7px 16px;
  -webkit-text-fill-color: white;
}
.nav-link.nav-btn:hover { opacity: .9; }

/* Status badge */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 100px; letter-spacing: .04em; text-transform: uppercase;
}
.badge-pending    { background: rgba(100,116,139,.1); color: #475569; }
.badge-generating { background: rgba(217,119,6,.1);   color: #92400e; }
.badge-done       { background: rgba(22,163,74,.1);   color: #166534; }
.badge-failed     { background: rgba(220,38,38,.1);   color: #991b1b; }

/* Spinner */
.spinner {
  width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-dim); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Link */
a.link { color: var(--accent); text-decoration: none; font-weight: 500; }
a.link:hover { text-decoration: underline; }

/* Auth footer text */
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }

footer {
  text-align: center; padding: 40px 0 32px; color: var(--text-dim); font-size: 12px;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* Fade in */
.fade-in { animation: fadeIn .5s ease both; }
@keyframes fadeIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
.fade-in:nth-child(2){animation-delay:.08s}
.fade-in:nth-child(3){animation-delay:.16s}
.fade-in:nth-child(4){animation-delay:.24s}

/* Video result */
.result-video { width: 100%; border-radius: 12px; margin-top: 12px; max-height: 400px; }
.result-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; text-align: center; margin-top: 16px;
}

/* History grid */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.history-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.history-card-media { background: #000; position: relative; aspect-ratio: 16/9; }
.history-card-media video, .history-card-media img { width:100%; height:100%; object-fit:cover; }
.history-card-body { padding: 14px 16px; }

@media(max-width:580px){
  .upload-grid{grid-template-columns:1fr}
  .history-grid{grid-template-columns:1fr}
}
