/* =============================================
   App UI — authenticated and public service pages
   Extends theme.css design tokens.
   ============================================= */

/* ---- Nav ---- */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.app-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.app-logo:hover { color: var(--accent); }

.app-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-username {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ---- Main ---- */
.app-body { min-height: 100vh; }

.app-main {
  padding: 2.5rem 2rem;
}

/* ---- Page container ---- */
.page-container {
  max-width: 1000px;
  margin: 0 auto;
}

.page-container--narrow {
  max-width: 660px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

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

.breadcrumb {
  display: block;
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
}
.breadcrumb:hover { color: var(--fg); }

/* ---- Stats row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  padding: 1.4rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-card.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.stat-card-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-card.highlight .stat-card-number { color: var(--accent); }

.stat-card-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Package list ---- */
.package-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.package-card {
  padding: 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}

.package-card:hover { border-color: rgba(232,168,56,0.3); }

.package-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.package-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.package-price {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.package-desc {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.package-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.package-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ---- Badges ---- */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
}

.badge-published { background: rgba(52,211,153,0.15); color: #34d399; }
.badge-draft { background: rgba(138,138,154,0.15); color: var(--fg-muted); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:hover { opacity: 0.85; }

.btn-primary { background: var(--accent); color: #07070d; }
.btn-primary:hover { box-shadow: 0 0 16px var(--accent-glow); opacity: 1; }

.btn-accent { background: var(--accent); color: #07070d; }

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

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

.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

.btn-sm { font-size: 0.8rem; padding: 0.4rem 0.85rem; }
.btn-lg { font-size: 1rem; padding: 0.85rem 1.5rem; }
.btn-full { width: 100%; }

/* ---- Forms ---- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 1.5rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.form-label-note {
  font-weight: 400;
  color: var(--fg-muted);
}

.required { color: var(--accent); }

.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--fg-muted); }

.form-textarea { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 0.4rem;
}

.input-prefix-group {
  display: flex;
  align-items: center;
}

.input-prefix {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-right: none;
  padding: 0.65rem 0.8rem;
  border-radius: 8px 0 0 8px;
  color: var(--fg-muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.input-prefix + .form-input { border-radius: 0 8px 8px 0; }

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-actions-right { display: flex; gap: 0.6rem; }

/* ---- Package form ---- */
.package-form { }

.danger-zone {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px;
}

.danger-zone-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: #f87171;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Alerts ---- */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.alert-error { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.alert-success { background: rgba(52,211,153,0.1); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.25); }
.alert-info { background: rgba(96,165,250,0.1); color: #93c5fd; border: 1px solid rgba(96,165,250,0.25); }

/* ---- Auth ---- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }

.auth-container { width: 100%; max-width: 420px; }

.auth-logo { display: block; text-align: center; margin-bottom: 2rem; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 1.8rem;
  line-height: 1.6;
}

.auth-form .form-group { margin-bottom: 1.2rem; }

.auth-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 1.5rem;
}

.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }
.link-subtle { color: var(--fg-muted); text-decoration: none; font-size: 0.85rem; }
.link-subtle:hover { color: var(--fg); }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p { color: var(--fg-muted); font-size: 0.9rem; }

/* ---- Service page ---- */
.service-body { }

.publish-banner {
  background: rgba(232,168,56,0.12);
  border-bottom: 1px solid rgba(232,168,56,0.3);
  padding: 0.8rem 2rem;
  font-size: 0.9rem;
  color: var(--fg);
  display: flex;
  align-items: center;
}

.service-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.service-header {
  padding: 4rem 0 3rem;
  position: relative;
}

.service-header::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -30%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.service-header-inner { position: relative; z-index: 1; }

.service-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}

.service-price-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
}

.service-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.service-price-period { font-size: 0.9rem; color: var(--fg-muted); }

.service-body-inner { display: flex; flex-direction: column; gap: 2.5rem; }

.service-section {}

.service-section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
}

.service-desc {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--fg);
  white-space: pre-line;
}

.deliverables-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.deliverable-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.deliverable-check {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.service-cta-section {}

.service-cta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem;
}

.service-cta-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.service-cta-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 1.8rem;
  line-height: 1.6;
}

.intake-form .form-group { margin-bottom: 1.2rem; }

.intake-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 0.8rem;
}

.service-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ---- Success page ---- */
.success-card { text-align: center; }
.success-icon {
  width: 56px;
  height: 56px;
  background: rgba(52,211,153,0.15);
  color: #34d399;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
}
.pending-icon { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* ---- Inquiry list ---- */
.inquiry-list { display: flex; flex-direction: column; gap: 1rem; }

.inquiry-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.inquiry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.inquiry-email {
  display: block;
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  margin-top: 0.2rem;
}

.inquiry-message {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 0.6rem;
  font-style: italic;
}

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .app-main { padding: 1.5rem 1rem; }
  .app-nav { padding: 0 1rem; }
  .page-header { flex-direction: column; }
  .form-actions { flex-direction: column; }
  .form-actions-right { width: 100%; flex-direction: column; }
  .auth-card { padding: 1.8rem 1.5rem; }
  .service-cta-card { padding: 1.8rem 1.5rem; }
}

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