/* ticket.tryswift.jp 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
 * so it works on the Cloudflare Pages deployment without cross-site assets. */

:root {
  --navy: #00203f;
  --navy-hover: #001831;
  --fg: #122033;
  --muted: #6c757d;
  --border: rgba(0, 0, 0, 0.125);
  --danger: #b42318;
  --radius: 0.375rem;
  --max-content: 720px;
  --page-gutter: 16px;
}

* {
  box-sizing: border-box;
}

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

a {
  text-decoration: none;
}

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

.site-header {
  padding: 14px 16px;
  background: var(--navy);
}

.brand {
  font-weight: 700;
  color: #fff;
}

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

h1 {
  font-size: 2rem;
  margin: 0 0 1rem;
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.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); hover/focus states are shared across variants
 * via filter/box-shadow rather than repeated per-variant. ---- */
button,
.cta {
  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: 600;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

/* Bare buttons are neutral; .primary / .cta are the navy call to action. */
button {
  background: #fff;
  color: var(--navy);
  border-color: rgba(0, 32, 63, 0.2);
}

button.primary,
.cta {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 700;
}

.cta {
  margin-top: 1rem;
}

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

button:hover,
.cta:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

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

/* ---- Forms ---- */
.form-field {
  display: block;
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-field input {
  width: 100%;
}

input[type="text"],
input[type="email"],
select {
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: var(--radius);
  font: inherit;
  color: var(--fg);
  background: #fff;
}

/* ---- Cards (products, orders) ---- */
#products {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin: 24px 0;
}

#orders {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.product-card,
.order-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: 20px;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-actions label {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---- Tickets within an order ---- */
.ticket-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.ticket-row .assignee {
  margin: 0;
  flex: 1;
}

.assign-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ---- Badges ---- */
.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;
}

.bg-secondary {
  background: #eef2f6;
  color: #495057;
}

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

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

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

/* ---- Consent gate (Code of Conduct + refund terms) ---- */
.consent {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 20px;
}

.consent label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.95rem;
}

.terms-links {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.terms-links a {
  color: var(--navy);
}

/* Disabled buy buttons read as unavailable, not as a rendering glitch. */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Utilities ---- */
.field-error {
  color: var(--danger);
  font-size: 0.9rem;
  width: 100%;
  margin: 4px 0 0;
}

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

  h1 {
    font-size: 1.65rem;
  }
}
