@import url("https://fonts.googleapis.com/css2?family=Pacifico&display=swap");

:root {
  color-scheme: light;
  --bg: #fff8fd;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-strong: rgba(255, 255, 255, 0.74);
  --line: rgba(63, 70, 92, 0.18);
  --text: #1d2433;
  --muted: #5f6675;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #15803d;
  --shadow: 0 18px 45px rgba(23, 32, 52, 0.12);
  font-family: Pacifico, "Comic Sans MS", "Segoe UI", cursive;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(
    120deg,
    #fff1f8,
    #fff7d6,
    #e7fff3,
    #e9f3ff,
    #f6ebff,
    #fff1f8
  );
  background-size: 500% 500%;
  animation: rainbowShift 18s ease-in-out infinite;
  color: var(--text);
}

@keyframes rainbowShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(215, 222, 234, 0.8);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
}

.brand-button,
.admin-button,
.ghost-button,
.primary-button,
.secondary-button,
.tab-button {
  border: 0;
  border-radius: 8px;
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.16rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  letter-spacing: 0;
}

.admin-button,
.ghost-button,
.secondary-button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
}

.primary-button {
  padding: 11px 16px;
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.full {
  width: 100%;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero-screen {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 140px);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-grid {
  display: grid;
  gap: 14px;
}

.role-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 116px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(23, 32, 52, 0.08);
  color: var(--text);
  text-align: left;
}

.role-card:hover,
.group-card:hover {
  border-color: #9bb5f7;
  transform: translateY(-1px);
}

.role-icon,
.folder-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--blue);
}

.role-card strong,
.group-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.role-card small,
.group-card small,
.generated-code small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.workspace {
  padding-top: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: 0;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.group-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px rgba(23, 32, 52, 0.08);
  color: var(--text);
  text-align: left;
}

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-button {
  padding: 10px 13px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

.tab-button.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.tool-panel,
.admin-login,
.admin-dashboard {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.tool-panel h3 {
  margin: 0 0 18px;
  font-size: 1.35rem;
}

.camera-box {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 260px;
  border: 1px dashed #aab6cc;
  border-radius: 8px;
  background: #f8fafc;
}

#scannerVideo {
  display: none;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.camera-placeholder {
  color: var(--muted);
  text-align: center;
}

.inline-actions,
.coach-actions,
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.status-line {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--green);
}

.generated-code {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.8);
  text-align: center;
}

.generated-code img {
  width: min(220px, 70vw);
  height: min(220px, 70vw);
  border: 10px solid #fff;
}

.generated-code strong {
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.download-tools {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: end;
  width: 100%;
  max-width: 420px;
}

.compact-field {
  text-align: left;
}

.record-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.record-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 255, 0.82);
}

.record-item strong {
  font-size: 1.05rem;
}

.record-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .app-header {
    height: 64px;
    padding: 0 16px;
  }

  .hero-screen {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy h1 {
    font-size: 3.25rem;
  }

  .section-title,
  .admin-login,
  .download-tools {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .role-card,
  .group-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .role-icon,
  .folder-icon {
    width: 48px;
    height: 48px;
  }
}
