:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1d2733;
  --muted: #6b7684;
  --line: #e3e7ec;
  --brand: #1f6feb;
  --brand-dark: #1a5fd0;
  --premium: #b8860b;
  --danger: #d1434b;
  --ok: #1a9d54;
  --warn: #b5661a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

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

.site-header, .admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 8px;
}
/* transparent navbar on the top page so the seasonal rings show through */
.site-header.transparent { background: transparent; border-bottom-color: transparent; }
.brand { font-weight: 800; font-size: 20px; color: var(--ink); }
.brand span { color: var(--brand); }
.site-header nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

.container { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }

.site-footer { text-align: center; color: var(--muted); padding: 24px; font-size: 13px; }

/* ---- seasonal ambient rings (behind all content) ---- */
.decor { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.decor svg { position: absolute; opacity: .3; }
.admin-body .decor svg { opacity: .42; }
.site-header, .container, .site-footer, .admin-header, .admin-login { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .decor svg { opacity: .22; } }

/* ---- hero / gateways ---- */
.hero { text-align: center; padding: 40px 0 20px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 17px; }

/* ---- split hero: copy on the left, entry cards on the right ---- */
.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 44px;
  align-items: center;
  padding: 52px 0 36px;
}
.hero-copy h1 { font-size: 32px; line-height: 1.4; margin: 0 0 18px; }
.hero-copy .lead { line-height: 1.9; }

/* right side: tabbed sign-up / application, form shown inline */
.hero-entries { align-self: start; }
.auth-tabs { display: flex; gap: 4px; }
.auth-tab {
  flex: 1;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-bottom: none;
  background: #eef1f5;
  border-radius: 10px 10px 0 0;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active { background: var(--card); color: var(--ink); }
.auth-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 22px 24px;
  box-shadow: 0 6px 20px rgba(20, 40, 80, .06);
}
.auth-panel h2 { margin: 0 0 6px; font-size: 20px; }
.auth-panel > p { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.auth-panel .btn.primary { display: block; width: 100%; text-align: center; }
.auth-panel[data-panel="freelancer"] .btn.primary { background: var(--ok); border-color: var(--ok); }
.auth-panel[data-panel="freelancer"] .btn.primary:hover { background: #17864a; }
.otp-actions { display: flex; gap: 16px; margin-top: 12px; }
.otp-actions form { display: inline; }
.otp-actions .link { font-size: 13px; }
.otp-dev {
  font-size: 12px;
  color: var(--warn);
  background: #fff7e6;
  border: 1px dashed #e0b46a;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 0 0 14px;
}

@media (max-width: 820px) {
  .hero-split { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 24px; }
  .hero-copy h1 { font-size: 27px; }
}

.gateways { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.gateway {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.gateway:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 26px rgba(20,40,80,.10); }
.gateway h2 { margin-top: 0; font-size: 20px; }
.gateway .cta { display: inline-block; margin-top: 12px; font-weight: 700; color: var(--brand); }
.gateway.alt .cta { color: var(--ok); }
.already { text-align: center; margin-top: 28px; color: var(--muted); }

@media (max-width: 720px) { .gateways { grid-template-columns: 1fr; } }

/* ---- cards / forms ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card.center { text-align: center; }
.card h1 { margin-top: 0; }

/* frosted-glass card: whitish translucent panel that blurs the seasonal rings behind it */
.card.glass {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 8px 30px rgba(20, 40, 80, 0.08);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card.glass { background: rgba(255, 255, 255, 0.9); }
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label, .inline-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
legend { font-weight: 700; padding: 0 6px; }

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { text-decoration: none; background: #f0f3f7; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 6px 10px; font-size: 13px; }
button.link { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.inline { display: inline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---- flash / badges ---- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash.success { background: #e5f6ec; color: #14713e; border: 1px solid #b7e2c6; }
.flash.error { background: #fdeaea; color: #a02b32; border: 1px solid #f3c6c8; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.review, .badge.pending { background: #fff3df; color: var(--warn); }
.badge.approved { background: #e5f6ec; color: var(--ok); }
.badge.rejected { background: #fdeaea; color: var(--danger); }

/* ---- quota meter ---- */
.quota { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.meter { height: 10px; background: #eef1f4; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; background: var(--brand); }
.warn { color: var(--warn); font-weight: 600; }
.pro-tag { color: var(--premium); font-weight: 700; }

/* ---- freelancer grid ---- */
.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.fl-card { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fff; color: var(--ink); }
.fl-card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(20,40,80,.08); }
.fl-card h3 { margin: 0 0 6px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 14px; }
.chips, .skill-list { margin-top: 10px; }
.chip { display: inline-block; background: #eef2f7; border-radius: 999px; padding: 3px 9px; font-size: 12px; margin: 0 6px 6px 0; }

.profile-grid { display: grid; grid-template-columns: 340px 1fr; gap: 28px; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }
.skill-list { list-style: none; padding: 0; }
.skill-list li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.prewrap { white-space: pre-wrap; }
.muted { color: var(--muted); }
.back { display: inline-block; margin-bottom: 10px; font-size: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- radar ---- */
.radar { width: 100%; max-width: 340px; height: auto; }
.radar-ring { fill: none; stroke: #dde3ea; stroke-width: 1; }
.radar-axis { stroke: #dde3ea; stroke-width: 1; }
.radar-area { fill: rgba(31,111,235,.22); stroke: var(--brand); stroke-width: 2; }
.radar-label { font-size: 11px; fill: var(--muted); }

/* ---- skill rows ---- */
.skill-row { display: flex; gap: 10px; margin-bottom: 10px; }
.skill-row select { flex: 1; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- messages ---- */
.conv-list { list-style: none; padding: 0; }
.conv-list li { border-bottom: 1px solid var(--line); }
.conv-list a { display: flex; gap: 10px; align-items: center; padding: 14px 4px; color: var(--ink); }
.conv-list a:hover { text-decoration: none; background: #fafbfc; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e7eefc; color: var(--brand); }
.tag.premium { background: #fbf0d7; color: var(--premium); }
.tag.seeking { background: #e5f6ec; color: var(--ok); }
.tag.idle { background: #eef1f5; color: var(--muted); }

/* freelancer in-page tab bar */
.subtabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.subtabs a {
  padding: 10px 16px;
  color: var(--muted);
  font-weight: 700;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
}
.subtabs a:hover { text-decoration: none; background: #f0f3f7; }
.subtabs a.active { color: var(--ink); background: var(--card); border-color: var(--line); }
.badge-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}
label.radio { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.radio input { width: auto; }

.danger-zone { border: 1px solid #f0c9cc; background: #fdf3f3; border-radius: 10px; padding: 16px; }
.danger-zone h3 { margin-top: 0; color: var(--danger); }

.thread { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; max-height: 60vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.msg.mine { align-self: flex-end; background: #e7eefc; border-color: #cfe0fb; }
.msg.theirs { align-self: flex-start; }
.msg time { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg .attach { display: inline-block; margin-top: 6px; font-size: 13px; }
.msg-form { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.msg-form-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---- plan box ---- */
.plan-box { border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-top: 14px; background: #fbfcfd; }
.price { font-size: 34px; font-weight: 800; }
.price span { font-size: 20px; }
.price small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.plan-box ul { margin: 14px 0; padding-left: 20px; }

/* ---- admin ---- */
.admin-body { background: #0f1720; color: #e8edf3; }
.admin-body .container { background: transparent; }
.admin-header { background: #16212d; border-bottom: 1px solid #26333f; }
.admin-header strong { color: #e8edf3; }
.admin-login { max-width: 380px; margin: 12vh auto; background: #16212d; border: 1px solid #26333f; border-radius: 12px; padding: 28px; }
.admin-login h1 { margin-top: 0; }
.admin-body .btn { background: #1f2c3a; border-color: #2c3c4c; color: #e8edf3; }
.admin-body .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.admin-body input { background: #0f1720; border-color: #2c3c4c; color: #e8edf3; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 8px 8px 0 0; background: #16212d; color: #aeb9c4; }
.tabs a.active { background: #1f6feb; color: #fff; }
.tbl { width: 100%; border-collapse: collapse; background: #16212d; border-radius: 10px; overflow: hidden; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #26333f; font-size: 14px; }
.tbl th { background: #1b2733; }
.tbl .ops { display: flex; gap: 6px; }
.oplog-title { margin: 28px 0 10px; font-size: 16px; color: #aeb9c4; }
.oplog td:first-child { white-space: nowrap; color: #8b97a3; }
