/* main.css —— BuildMatchAU H5 基础样式
 * mobile-first；适配 WeChat/Weixin 内置浏览器
 */

:root {
  --bg: #f7f4ef;
  --bg-card: #ffffff;
  --text: #2a2a2a;
  --text-muted: #6b6b6b;
  --text-faint: #9b9b9b;
  --accent: #c4654a;       /* 主色：澳洲砖红 */
  --accent-soft: #f3d7c8;
  --border: #e6e1d8;
  --danger: #c0392b;
  --success: #2e7d32;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --radius: 12px;
  --max-width: 640px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
    "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}

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

button {
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 96px;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============ View header ============ */
.view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.view-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.back-link {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: var(--shadow);
}

/* ============ Hero (home) ============ */
.hero {
  text-align: center;
  padding: 32px 0 16px;
}

.hero-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 8px 0 4px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-meta {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.8rem;
}

/* ============ Main nav cards (home) ============ */
.main-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.nav-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease;
}

.nav-card:active {
  transform: scale(0.98);
}

.nav-card.primary {
  background: var(--accent);
  color: #fff;
}

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

.nav-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.nav-card-desc {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ============ Home footer ============ */
.home-footer {
  margin-top: 32px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--accent);
}

/* ============ Filter chips ============ */
.filter-bar {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============ Job card ============ */
.job-list-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}

.job-card.is-expired {
  opacity: 0.6;
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.job-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.expired {
  background: var(--accent-soft);
  color: var(--accent);
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.job-salary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

/* ============ Detail page ============ */
.job-detail-content {
  padding-bottom: 32px;
}

.expired-banner {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.details-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row .label {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.contact-value {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
  text-align: right;
}

.description {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}

.action-bar {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.primary-btn {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
}

.primary-btn:active {
  opacity: 0.85;
}

.primary-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn.block {
  display: block;
  width: 100%;
}

.secondary-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius);
}

.secondary-btn.block {
  display: block;
  width: 100%;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  padding: 0;
}

/* ============ FAB ============ */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(196, 101, 74, 0.35);
  z-index: 20;
}

/* ============ Form ============ */
.form {
  padding: 8px 0 32px;
}

.form-row {
  margin-bottom: 16px;
}

.form-row .label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-row .req {
  color: var(--danger);
}

.input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus {
  border-color: var(--accent);
}

textarea.input {
  resize: vertical;
  min-height: 96px;
  font-family: inherit;
}

.inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.flex-1 {
  flex: 1;
}

.error-text {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
}

.hint-text {
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-top: 4px;
}

.hint-text.center {
  text-align: center;
}

/* ============ Postcode matches ============ */
.postcode-matches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.match-chip {
  background: var(--accent-soft);
  color: var(--accent);
  border: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ State text ============ */
.state-text {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
}

.state-text.error {
  color: var(--danger);
}

/* ============ Login ============ */
.login-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
}

.login-status {
  background: var(--bg-card);
  padding: 24px 16px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  margin-top: 16px;
}

.login-mock {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 0.85rem;
  margin: 8px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============ Legal pages ============ */
.legal {
  padding: 16px 0 32px;
}

.legal .title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.legal .updated {
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.legal-section {
  margin-bottom: 18px;
}

.legal-section .h {
  font-weight: 600;
  margin-bottom: 6px;
}

.legal-section .p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 6px;
}