* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0b1220;
  color: #0f172a;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/images/backgrounds/reg-bg.jpg?v=2') center / cover no-repeat;
  filter: saturate(1.05) contrast(1.05);
  z-index: -2;
  transform: scale(1.04) translateX(var(--dash-px, 0px)) translateY(var(--dash-py, 0px));
  will-change: transform;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(900px 520px at 20% 15%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(900px 520px at 80% 10%, rgba(20, 184, 166, 0.10), transparent 62%),
    linear-gradient(180deg, rgba(11, 18, 32, 0.76), rgba(11, 18, 32, 0.90));
  z-index: -1;
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.reg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.reg-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reg-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  border: 1px solid #e2e8f0;
}

.reg-head h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.3px;
}

.reg-head p {
  margin: 10px 0 0;
  color: #0f172a;
  font-weight: 700;
}

@media (max-width: 520px) {
  .reg-head p {
    color: #fff;
  }
}

.reg-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-decoration: none;
  color: #0f172a;
  white-space: nowrap;
}

.reg-home:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.reg-hero {
  margin-top: 14px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(20, 184, 166, 0.08));
  display: grid;
  place-items: center;
  padding: 0 12px;
}

.reg-hero-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0;
}

.reg-hero-logo {
  display: block;
  width: 240px;
  height: 240px;
  border-radius: 18px;
  object-fit: contain;
  background: #fff;
  padding: 10px;
  border: 1px solid #e2e8f0;
}

.reg-thumbs {
  display: none;
}

.reg-thumbs img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  margin-top: 16px;
}

.tab {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}

.tab.active {
  border-color: #3b82f6;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.row + .row {
  margin-top: 14px;
}

.row > * {
  min-width: 0;
}

.row.single {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .reg-thumbs img {
    height: 120px;
  }
}

@media (max-width: 720px) {
  .reg-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .row {
    grid-template-columns: 1fr;
  }
  .reg-thumbs {
    grid-template-columns: 1fr;
  }
  .reg-thumbs img {
    height: 180px;
  }
}

label {
  display: block;
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 6px;
}

@media (max-width: 520px) {
  label {
    color: #fff;
  }
}

input,
select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

input.field-error,
select.field-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: #991b1b;
}

button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
}

.primary[type='submit'] {
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 800;
}

.form-actions {
  margin-top: 16px;
  padding-top: 10px;
}

.primary {
  background: #3b82f6;
  color: #fff;
}

.msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  display: none;
}

.msg.ok {
  background: #dcfce7;
  color: #166534;
}

.msg.err {
  background: #fee2e2;
  color: #991b1b;
}

.dash-stack {
  display: grid;
  gap: 16px;
}

.badge-a6 {
  width: min(520px, 100%);
  margin: 0 auto;
  aspect-ratio: 105 / 148;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
}

.badge-inner {
  height: 100%;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
}

.badge-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  min-height: 190px;
}

.badge-top > * {
  justify-self: stretch;
}

.badge-title {
  text-align: center;
  padding-top: 18px;
}

.badge-title-sub {
  margin-top: 0;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.1;
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

.badge-top-box {
  width: 100%;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.badge-top-logo {
  width: clamp(60px, 10vw, 88px);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.05);
  display: grid;
  place-items: center;
  padding: 6px;
  overflow: hidden;
}

.badge-top-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
}

.badge-main-sponsor {
  width: 100%;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.badge-sponsor-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.badge-sponsor-logo {
  width: clamp(60px, 10vw, 88px);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.05);
  display: grid;
  place-items: center;
  padding: 6px;
  overflow: hidden;
}

.badge-sponsor-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
}

.badge-person {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 12px;
  text-align: center;
}

.badge-name,
.badge-email {
  font-weight: 950;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.badge-name {
  font-size: 22px;
}

.badge-email {
  margin-top: 4px;
  font-size: 12px;
}

.badge-qr {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.badge-qr-img {
  width: 136px;
  height: 136px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: #fff;
  padding: 8px;
}

.badge-ref {
  display: grid;
  gap: 6px;
  align-content: center;
}

.badge-ref-cat {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.1;
}

.badge-ref-code {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.1;
}

.badge-sponsors {
  border-top: 1px solid rgba(15, 23, 42, 0.10);
  padding-top: 8px;
  display: grid;
  gap: 8px;
}

.badge-sponsors-label {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.badge-sponsor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.badge-sponsor-pill {
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 10px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: rgba(15, 23, 42, 0.03);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.45);
  font-size: 10px;
  overflow: hidden;
}

.badge-sponsor-pill img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  margin: auto;
}

.dash-table {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
}

.dash-table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dash-table-title {
  font-size: 16px;
  font-weight: 900;
}

.dash-table-sub {
  font-size: 12px;
  color: #64748b;
}

.dash-table-wrap {
  margin-top: 12px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.dash-att-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dash-att-table th,
.dash-att-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.dash-att-table th {
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  position: sticky;
  top: 0;
}

.dash-att-table .td-hours {
  white-space: nowrap;
}

.dash-att-table .td-title {
  font-weight: 700;
  color: #0f172a;
}

.dash-att-table .td-empty {
  color: #64748b;
  text-align: center;
}

.dash-total {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.dash-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#logout {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  transition: background 0.15s, color 0.15s;
}

#logout:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fff;
}

.btn {
  padding: 11px 22px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.btn:active {
  transform: translateY(0);
}

@media (max-width: 520px) {
  .shell {
    padding: 0;
  }
  .card {
    border-radius: 0;
    padding: 12px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .badge-a6 {
    aspect-ratio: auto;
  }
  .badge-inner {
    height: auto;
    grid-template-rows: none;
    gap: 8px;
  }
  .badge-top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 0;
  }
  .badge-title {
    padding-top: 10px;
  }
  .badge-title-sub {
    font-size: 13px;
    line-height: 1.15;
  }
  .badge-qr-img {
    width: 110px;
    height: 110px;
  }
  .badge-sponsor-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 380px) {
  .badge-title-sub {
    font-size: 13px;
  }
}

@media print {
  body::before,
  body::after,
  header {
    display: none !important;
  }
  .shell {
    padding: 0;
    max-width: none;
  }
  .card {
    border-radius: 0;
    padding: 0;
    background: transparent;
  }
  .badge-a6 {
    width: 105mm;
    height: 148mm;
    aspect-ratio: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0;
  }
  #logout,
  #message,
  .dash-table {
    display: none !important;
  }
}
