/* ==================================================
   common.css
   Hotai Finance Installment Platform v2
   Apple / Notion inspired design system
================================================== */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --text: #172033;
  --muted: #667085;
  --line: #e5e7eb;

  --primary: #2556e8;
  --primary-hover: #1e49c9;
  --primary-soft: #eef4ff;

  --navy: #0f1f3d;
  --gold: #c89b3c;
  --gold-soft: #fff7e6;

  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --success: #16a34a;
  --success-soft: #ecfdf3;

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

  --shadow-sm: 0 8px 24px rgba(15, 31, 61, 0.06);
  --shadow-md: 0 18px 48px rgba(15, 31, 61, 0.08);
  --shadow-lg: 0 28px 80px rgba(15, 31, 61, 0.12);

  --page-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 86, 232, 0.08), transparent 32%),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--text);
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ================================
   Layout
================================ */

.hf-page {
  min-height: 100vh;
}

.hf-shell {
  width: min(var(--page-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hf-page-center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.hf-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.hf-card-pad {
  padding: 32px;
}

.hf-grid {
  display: grid;
  gap: 20px;
}

.hf-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hf-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ================================
   Header
================================ */

.hf-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.hf-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hf-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-weight: 950;
  font-size: 22px;
  letter-spacing: -0.06em;
}

.hf-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.hf-title {
  margin: 0;
  color: var(--navy);
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 950;
  letter-spacing: -0.06em;
  line-height: 1.08;
}

.hf-subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

/* ================================
   Buttons
================================ */

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

.hf-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  transition: 0.18s ease;
}

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

.hf-btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.hf-btn-secondary:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.hf-btn-danger {
  background: var(--danger);
  color: #fff;
}

.hf-btn-danger:hover {
  background: #b91c1c;
}

/* ================================
   Pills / Status
================================ */

.hf-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.hf-pill-gold {
  background: var(--gold-soft);
  color: #8a620f;
}

.hf-pill-dark {
  background: var(--navy);
  color: #fff;
}

/* ================================
   Forms
================================ */

.hf-field {
  margin-bottom: 18px;
}

.hf-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-weight: 900;
}

.hf-input,
.hf-select,
.hf-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: 0.16s ease;
}

.hf-input,
.hf-select {
  height: 52px;
  padding: 0 16px;
}

.hf-textarea {
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
}

.hf-input:focus,
.hf-select:focus,
.hf-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 86, 232, 0.08);
}

/* ================================
   Notice / Empty
================================ */

.hf-notice {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  line-height: 1.7;
}

.hf-empty {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

/* ================================
   Dashboard Cards
================================ */

.hf-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.hf-menu-card {
  display: block;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: 0.18s ease;
}

.hf-menu-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hf-menu-icon {
  font-size: 30px;
  margin-bottom: 14px;
}

.hf-menu-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.hf-menu-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

/* ================================
   Section
================================ */

.hf-section {
  margin-top: 22px;
  padding: 26px;
}

.hf-section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.hf-section-title {
  margin: 0;
  color: var(--navy);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.hf-list {
  display: grid;
  gap: 12px;
}

.hf-list-item {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid #edf0f5;
}

.hf-list-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
}

.hf-list-item span {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

/* ================================
   Footer
================================ */

.hf-footer {
  margin-top: 36px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ================================
   Responsive
================================ */

@media (max-width: 860px) {
  .hf-shell {
    width: min(100% - 24px, 720px);
    padding: 24px 0 40px;
  }

  .hf-topbar {
    display: block;
  }

  .hf-topbar .hf-actions {
    margin-top: 18px;
  }

  .hf-grid-2,
  .hf-grid-3,
  .hf-menu-grid {
    grid-template-columns: 1fr;
  }

  .hf-card-pad {
    padding: 24px;
  }

  .hf-page-center {
    padding: 20px;
  }
}