/* ==========================================================================
   HAIPI APP TECHNOLOGY CO., LTD — Corporate website styles
   Design system: deep teal primary, amber (Popotaxi) + emerald (Haipiapp) accents
   Mobile-first, responsive, no external dependencies.
   ========================================================================== */

:root {
  --ink: #0a1f2b;
  --ink-soft: #25404d;
  --primary: #0e4c5c;
  --primary-dark: #09333f;
  --primary-tint: #eaf2f4;

  --popotaxi: #e8930c;
  --popotaxi-tint: #fdf2dd;
  --haipiapp: #0fa97e;
  --haipiapp-tint: #e3f6ef;

  --bg: #f7f9fa;
  --surface: #ffffff;
  --muted: #5b6b73;
  --line: #e3e9ec;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(10, 31, 43, 0.05), 0 8px 24px rgba(10, 31, 43, 0.06);
  --shadow-lg: 0 12px 40px rgba(10, 31, 43, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;

  --header-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

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

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 0.95rem; letter-spacing: 0.02em; }
.brand-text em { font-style: normal; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 10px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle .bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-link:hover { background: var(--primary-tint); color: var(--primary); text-decoration: none; }
.nav-link.is-active { color: var(--primary); background: var(--primary-tint); font-weight: 600; }

.nav-cta { margin-left: 8px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); }

.btn-popotaxi { background: var(--popotaxi); color: #1c1300; box-shadow: var(--shadow); }
.btn-popotaxi:hover { background: #c97c07; }

.btn-haipiapp { background: var(--haipiapp); color: #03251a; box-shadow: var(--shadow); }
.btn-haipiapp:hover { background: #0b8f69; }

.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-tint); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface); border-color: #c9d4d9; }

.btn-sm { padding: 8px 15px; font-size: 0.88rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  background: radial-gradient(1200px 500px at 80% -10%, rgba(15, 169, 126, 0.14), transparent 60%),
              radial-gradient(1000px 500px at 10% 0%, rgba(232, 147, 12, 0.12), transparent 55%),
              linear-gradient(160deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 72px 0 80px;
  overflow: hidden;
}

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

.hero .kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  max-width: 16ch;
  margin-bottom: 18px;
}

.hero p.lead {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: 64px 0; }
.section--alt { background: var(--surface); }
.section--tint { background: var(--primary-tint); }

.section-head { max-width: 62ch; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

/* Cards grid */

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); margin-bottom: 0; }

.card-accent {
  border-top: 4px solid var(--primary);
}

.card-popotaxi { border-top: 4px solid var(--popotaxi); }
.card-haipiapp { border-top: 4px solid var(--haipiapp); }

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 16px;
}
.brand-icon--popotaxi { background: var(--popotaxi-tint); color: #8a5200; }
.brand-icon--haipiapp { background: var(--haipiapp-tint); color: #05644a; }

/* Steps */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.step-num {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.steps li p { margin: 0; }

/* --------------------------------------------------------------------------
   Badges (placeholders / status)
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 3px 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.badge-pending {
  color: #7a4d00;
  background: #fff3d6;
  border: 1px solid #efd48a;
}

.badge-draft {
  color: #7a1f1f;
  background: #fdeaea;
  border: 1px solid #f0b9b9;
}

.badge-ok {
  color: #05644a;
  background: var(--haipiapp-tint);
  border: 1px solid #a9dfcb;
}

/* --------------------------------------------------------------------------
   Notice / callout
   -------------------------------------------------------------------------- */

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--ink-soft);
  margin: 20px 0;
}
.notice--warn { border-left-color: var(--popotaxi); }
.notice p { margin: 0; }
.notice strong { color: var(--ink); }

/* --------------------------------------------------------------------------
   Fact table (About)
   -------------------------------------------------------------------------- */

.fact-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.fact-table th, .fact-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.fact-table tr:last-child th, .fact-table tr:last-child td { border-bottom: none; }
.fact-table th {
  width: 220px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--primary-tint);
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq { display: grid; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.faq-item h3 { font-size: 1rem; margin-bottom: 6px; }
.faq-item p { color: var(--muted); margin: 0; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #c9d4d9;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 76, 92, 0.15);
}
.field .error { color: #b3261e; font-size: 0.82rem; margin-top: 4px; display: none; }
.field.has-error input, .field.has-error textarea { border-color: #b3261e; }
.field.has-error .error { display: block; }

.form-status {
  display: none;
  margin-top: 16px;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.92rem;
}
.form-status.is-visible { display: block; }
.form-status--info { background: var(--primary-tint); border: 1px solid #b9d5dc; color: var(--primary-dark); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: #cfe0e7;
  padding: 56px 0 28px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  margin-bottom: 40px;
}
.footer-brand .brand-text strong { color: #fff; }
.footer-brand .brand-text em { color: #9fb6c0; }
.footer-brand p { margin-top: 12px; color: #9fb6c0; max-width: 34ch; }

.footer-col h3 {
  color: #fff;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: #9fb6c0;
  padding: 4px 0;
  font-size: 0.94rem;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  color: #8aa3ae;
  font-size: 0.85rem;
}
.footer-bottom p { margin: 0; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }

.center { text-align: center; }

.placeholder-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px dashed #c9d4d9;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-lg);
  }
  .site-nav.is-open { display: flex; }
  .nav-link { padding: 12px 14px; font-size: 1rem; }
  .nav-cta { margin-left: 0; margin-top: 8px; }

  .hero { padding: 52px 0 60px; }
  .section { padding: 48px 0; }
  .fact-table th { width: 130px; }
}
