/* ===== NAVIGATION ===== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-brand:hover { color: var(--accent); }

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

.nav-link {
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--fg); }

/* Push hero content below fixed nav */
.hero {
  padding-top: 140px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}

.btn-primary:hover {
  background: #dbb95a;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.15);
}

.btn-sm { font-size: 0.82rem; padding: 7px 14px; }
.btn-xs { font-size: 0.75rem; padding: 4px 10px; }
.btn-lg { font-size: 1rem; padding: 14px 28px; }
.btn-full { width: 100%; justify-content: center; }

.btn-danger { color: #e05555 !important; }
.btn-danger:hover { border-color: #e05555 !important; }

.btn-icon { font-size: 1.1rem; line-height: 1; }

/* ===== HERO CTA ===== */
.hero-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
}

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.alert-error {
  background: rgba(224, 85, 85, 0.12);
  border: 1px solid rgba(224, 85, 85, 0.3);
  color: #e07070;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
}

.auth-header {
  margin-bottom: 32px;
}

.auth-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--fg);
}

.auth-header p {
  font-size: 0.95rem;
  color: var(--fg-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

/* ===== FORM ELEMENTS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.optional-tag {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.form-group input,
.form-group textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  transition: border-color 0.2s;
  width: 100%;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--fg-muted);
  opacity: 0.6;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(201, 168, 76, 0.5);
}

/* ===== APP PAGES (drafts, wizard, etc.) ===== */
.app-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 100px 24px 80px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 48px;
  gap: 20px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 6px;
}

.page-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.95rem;
  color: var(--fg-muted);
  max-width: 400px;
  margin: 0 auto 28px;
}

/* ===== DRAFTS GRID ===== */
.drafts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.draft-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: border-color 0.2s;
}

.draft-card:hover {
  border-color: rgba(201, 168, 76, 0.2);
}

.draft-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.draft-status {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}

.status-draft {
  background: rgba(138, 138, 149, 0.15);
  color: var(--fg-muted);
  border: 1px solid rgba(138, 138, 149, 0.2);
}

.status-generating {
  background: rgba(201, 168, 76, 0.12);
  color: var(--accent);
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.status-generated {
  background: rgba(80, 200, 120, 0.12);
  color: #60c880;
  border: 1px solid rgba(80, 200, 120, 0.2);
}

.status-error {
  background: rgba(224, 85, 85, 0.12);
  color: #e07070;
  border: 1px solid rgba(224, 85, 85, 0.2);
}

.draft-date {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.draft-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
  line-height: 1.4;
}

.draft-excerpt {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.draft-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== WIZARD ===== */
.wizard-container {
  max-width: 680px;
  margin: 0 auto;
}

.wizard-progress {
  margin-bottom: 48px;
}

.wizard-steps-bar {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.wizard-step-dot {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--fg-muted);
  transition: all 0.3s;
}

.wizard-step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0f;
}

.wizard-step-dot.done {
  background: rgba(80, 200, 120, 0.15);
  border-color: rgba(80, 200, 120, 0.4);
  color: #60c880;
}

.wizard-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.wizard-step-line.done {
  background: rgba(80, 200, 120, 0.3);
}

.wizard-progress-text {
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.wizard-progress-text strong {
  color: var(--fg);
}

.wizard-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
}

/* ===== GENERATE PAGE ===== */
.generate-container {
  max-width: 720px;
  margin: 0 auto;
}

.generate-header {
  margin-bottom: 40px;
}

.generate-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.review-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.review-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.review-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.review-step-num {
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: 100px;
}

.review-section-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
}

.review-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-answer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-label {
  font-size: 0.78rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-value {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.6;
  white-space: pre-wrap;
}

.generate-cta {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
}

.generate-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.generate-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.info-icon {
  color: var(--accent);
  font-size: 0.85rem;
}

.btn-generate {
  min-width: 260px;
}

.generate-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* ===== GENERATING (loading) PAGE ===== */
.generating-container {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 60px 0;
}

.generating-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  opacity: 0;
  animation: pulse-out 2s ease-out infinite;
}

.pulse-ring-2 {
  animation-delay: 1s;
}

.pulse-core {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid rgba(201, 168, 76, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent);
  z-index: 1;
}

@keyframes pulse-out {
  0%   { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.generating-container h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.generating-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.generating-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.gen-step {
  font-size: 0.88rem;
  color: var(--fg-muted);
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  opacity: 0.4;
  transition: opacity 0.5s, border-color 0.5s;
}

.gen-step.active {
  opacity: 1;
  border-color: rgba(201, 168, 76, 0.3);
  color: var(--fg);
}

/* ===== DRAFT VIEW PAGE ===== */
.draft-view-container {
  max-width: 800px;
  margin: 0 auto;
}

.draft-view-header {
  margin-bottom: 32px;
}

.draft-view-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.back-link {
  font-size: 0.88rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: var(--fg); }

.draft-view-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.draft-view-date {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.draft-view-actions {
  display: flex;
  gap: 10px;
}

.disclaimer-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 32px;
}

.disclaimer-icon {
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.disclaimer-banner p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

.patent-document {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 40px;
}

.doc-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  transition: border-color 0.2s;
}

.doc-section:hover {
  border-color: rgba(201, 168, 76, 0.15);
}

.doc-section-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.doc-section-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--fg);
  white-space: pre-wrap;
}

.claims-body {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 0.9rem;
}

.draft-view-footer {
  text-align: center;
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-nav { padding: 0 16px; }
  .nav-actions { gap: 10px; }

  .auth-card { padding: 32px 24px; }

  .app-page { padding: 88px 16px 60px; }

  .page-header {
    flex-direction: column;
    gap: 16px;
  }

  .drafts-grid { grid-template-columns: 1fr; }

  .wizard-nav { flex-direction: column-reverse; gap: 12px; }
  .wizard-nav .btn { width: 100%; justify-content: center; }

  .generate-cta { padding: 24px 20px; }

  .draft-view-actions { flex-wrap: wrap; }

  .hero-cta { flex-direction: column; }
  .hero-cta .btn { text-align: center; justify-content: center; }

  .review-section-header { flex-wrap: wrap; }
}
