/* Sponsor portal styles, aligned with the try! Swift Tokyo CfP design
 * system (Web/Public/styles/app.css): navy + Swift purple, pill buttons,
 * white cards, purple focus rings, navy top bar and footer.
 *
 * Self-contained on purpose: the sponsor portal is served both from Fly.io
 * (Vapor SSR, Server/Public) and Cloudflare Pages (WebSponsorBuilder), and
 * those deployments don't share an asset path for the CfP stylesheet, so we
 * mirror the design tokens here instead of @import-ing app.css. This file is
 * duplicated at Web/Public/sponsor/sponsor.css and
 * Server/Public/sponsor/sponsor.css; keep both copies byte-identical. */
:root {
  --navy: #00203f;
  --navy-hover: #001831;
  --purple: #7952b3;
  --purple-dark: #5e3d8f;
  --text: #122033;
  --muted: #6c757d;
  --light: #f8f9fa;
  --border: rgba(0, 0, 0, 0.125);
  --radius: 0.375rem;
  --page-max-width: 860px;
  --page-gutter: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Segoe UI",
    sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}

a {
  text-decoration: none;
}

/* ---- Shell ---- */
.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 16px;
  background: var(--navy);
}

.portal-nav a {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}

.portal-nav a:hover {
  color: #fff;
}

.portal-nav a:first-child {
  color: #fff;
  font-weight: 700;
  margin-right: 8px;
}

.portal-nav form {
  margin-left: auto;
}

.portal-nav button {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.portal-nav button:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: none;
}

.portal-nav .language-switch {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.portal-nav .language-switch-icon { font-size: 0.95rem; line-height: 1; }
.portal-nav .lang-link {
  font-size: 0.85rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius);
  color: var(--muted);
}
.portal-nav .lang-link.active {
  color: var(--text);
  font-weight: 600;
  background: var(--border);
}

.portal-main {
  width: min(var(--page-max-width), calc(100% - (var(--page-gutter) * 2)));
  margin: 40px auto 56px;
  flex: 1;
}

.portal-main h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 16px;
}

.footer {
  background: var(--navy);
  color: #fff;
  text-align: center;
  padding: 48px 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.footer a {
  color: #fff;
}

.footer a:hover {
  color: rgba(255, 255, 255, 0.82);
}

.copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
}

/* ---- Buttons (pill kit) ---- */
button,
.button,
.apply-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease,
    box-shadow 160ms ease, transform 160ms ease;
}

button,
.button.primary,
.apply-button {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

button:hover,
.button.primary:hover,
.apply-button:hover {
  background: var(--navy-hover);
  border-color: var(--navy-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0.4rem 1rem rgba(0, 32, 63, 0.18);
}

.button.neutral {
  background: #fff;
  color: var(--navy);
  border-color: rgba(0, 32, 63, 0.2);
}

.button.neutral:hover {
  background: rgba(0, 32, 63, 0.06);
  border-color: rgba(0, 32, 63, 0.28);
  transform: translateY(-1px);
}

.button.light {
  background: rgba(0, 32, 63, 0.06);
  color: var(--navy);
  border-color: rgba(0, 32, 63, 0.12);
}

.button.light:hover {
  background: rgba(0, 32, 63, 0.1);
  transform: translateY(-1px);
}

button.danger,
.button.danger {
  background: #fff5f5;
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.2);
}

button.danger:hover,
.button.danger:hover {
  background: #feeceb;
  color: #912018;
  border-color: rgba(180, 35, 24, 0.3);
  transform: translateY(-1px);
}

button:focus-visible,
.button:focus-visible,
.apply-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(121, 82, 179, 0.18);
}

/* ---- Alerts ---- */
.flash {
  width: min(var(--page-max-width), calc(100% - (var(--page-gutter) * 2)));
  margin: 20px auto 0;
  padding: 12px 16px;
  border: 1px solid rgba(121, 82, 179, 0.25);
  background: rgba(121, 82, 179, 0.06);
  color: var(--purple-dark);
  border-radius: var(--radius);
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 16px 0;
}

.toast-info {
  background: rgba(121, 82, 179, 0.08);
  border-color: rgba(121, 82, 179, 0.25);
  color: var(--purple-dark);
}

.toast-error {
  background: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.25);
  color: #b02a37;
}

.toast-success {
  background: rgba(25, 135, 84, 0.08);
  border-color: rgba(25, 135, 84, 0.25);
  color: #146c43;
}

/* ---- Forms ---- */
.form-field {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field > label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: var(--radius);
  font: inherit;
  color: var(--text);
  background: #fff;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(121, 82, 179, 0.5);
  box-shadow: 0 0 0 0.25rem rgba(121, 82, 179, 0.15);
}

/* Checkboxes/radios sit inline next to their label text. */
.form-field input[type="checkbox"],
.form-field input[type="radio"] {
  width: auto;
  margin-right: 8px;
}

/* ---- Cards ---- */
.plan-list {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}

.plan-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 24px;
}

.plan-card h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  font-weight: 700;
}

.plan-card p {
  margin: 0 0 8px;
}

.plan-card ul {
  margin: 12px 0;
  padding-left: 20px;
}

.plan-card li {
  margin-bottom: 6px;
}

.plan-card .apply-button {
  margin-top: 12px;
}

/* ---- Status badges (semantic pills) ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #eef2f6;
  color: #495057;
}

.status-submitted {
  background: rgba(255, 193, 7, 0.16);
  color: #997404;
}

.status-under_review {
  background: rgba(121, 82, 179, 0.12);
  color: var(--purple-dark);
}

.status-approved {
  background: rgba(25, 135, 84, 0.14);
  color: #146c43;
}

.status-rejected {
  background: rgba(220, 53, 69, 0.12);
  color: #b02a37;
}

.status-withdrawn {
  background: #eef2f6;
  color: var(--muted);
}

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--light);
}

@media (max-width: 640px) {
  .portal-main {
    margin: 28px auto 44px;
  }

  .portal-main h1 {
    font-size: 1.65rem;
  }
}
