:root {
  color-scheme: light;
  --ink: var(--puze-color-ink);
  --muted: var(--puze-color-muted);
  --line: var(--puze-color-line);
  --paper: var(--puze-color-paper);
  --panel: var(--puze-color-panel);
  --brand-primary: var(--puze-color-primary);
  --brand-accent: var(--puze-color-accent);
  --teal: var(--puze-color-accent);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31, 65, 143, 0.08), transparent 35%),
    linear-gradient(300deg, rgba(22, 158, 156, 0.12), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family: var(--puze-font-base);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.candidate-login {
  min-height: calc(100vh - 56px);
  display: grid;
  align-items: center;
}

.candidate-login-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 16px;
  border: 1px solid rgba(215, 224, 234, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
  box-shadow: 0 18px 55px rgba(32, 46, 66, 0.1);
}

.candidate-brand {
  min-height: var(--puze-login-brand-min-height);
  border: 1px solid #d7e7f4;
  border-radius: var(--puze-radius-panel);
  background:
    radial-gradient(circle at 86% 84%, rgba(22, 158, 156, 0.12), transparent 34%),
    radial-gradient(circle at 18% 16%, rgba(31, 65, 143, 0.12), transparent 28%),
    linear-gradient(145deg, #f8fbff 0%, #eef6fb 52%, #ffffff 100%);
  display: grid;
  grid-template-rows: var(--puze-login-brand-band-height) 1fr;
  position: relative;
  overflow: hidden;
}

.candidate-brand::after {
  content: "";
  position: absolute;
  width: 390px;
  height: 186px;
  right: 42px;
  top: 168px;
  background: linear-gradient(135deg, rgba(31, 65, 143, 0.18) 0%, rgba(22, 158, 156, 0.10) 100%);
  opacity: 0.42;
  transform: none;
  -webkit-mask: var(--puze-logo-auxiliary) center / contain no-repeat;
  mask: var(--puze-logo-auxiliary) center / contain no-repeat;
  pointer-events: none;
}

.candidate-brand-mark {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(31, 65, 143, 0.08);
  padding: 0 30px;
  background: linear-gradient(90deg, rgba(31, 65, 143, 0.11), rgba(22, 158, 156, 0.10));
}

.candidate-brand-mark span {
  display: grid;
  width: var(--puze-login-wordmark-width);
  height: var(--puze-login-wordmark-height);
  place-items: center;
  padding: var(--puze-login-wordmark-padding);
  background: #fff;
  border-radius: var(--puze-radius-panel);
  box-shadow: var(--puze-shadow-brand-logo);
}

.candidate-brand-mark img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.candidate-brand-content {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 28px 34px 40px;
}

.candidate-brand-content p,
.candidate-brand-content em {
  display: block;
  margin: 0;
  color: var(--muted);
  font-style: normal;
  line-height: 1.65;
}

.candidate-brand-content p {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 850;
}

.candidate-brand-content h1 {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.candidate-brand-content h1 span {
  color: var(--brand-primary);
  font-family: var(--puze-font-display);
  font-size: clamp(18px, 2.1vw, 24px);
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.candidate-brand-content h1 strong {
  color: var(--ink);
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 950;
  line-height: 1.12;
}

.candidate-login-box {
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  gap: 18px;
  align-content: center;
  padding: 30px;
}

.login-title span {
  display: inline-flex;
  margin-bottom: 12px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--brand-primary);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 900;
}

.login-title h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 950;
  line-height: 1.15;
}

.topbar,
.account-head,
.result-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar { margin-bottom: 24px; }

.brand-lockup {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(31, 65, 143, 0.08);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.candidate-aux-card {
  width: 248px;
  min-height: 92px;
  align-self: flex-start;
  border: 1px solid rgba(31, 65, 143, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(31, 65, 143, 0.06);
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px 18px;
}

.candidate-aux-card span,
.candidate-aux-card strong,
.candidate-aux-card p {
  position: relative;
  z-index: 1;
}

.candidate-aux-card span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.candidate-aux-card strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.candidate-aux-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
}

.topbar p,
.muted,
.status,
.account-head span,
.account-head p,
.result-card p {
  margin: 0;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 4vw, 42px);
  line-height: 1.12;
}

a,
button {
  min-height: 42px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  padding: 9px 16px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:not(.primary) {
  background: #fff;
  color: var(--teal);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 26px;
  box-shadow: 0 18px 55px rgba(32, 46, 66, 0.08);
}

.panel h2 { margin-bottom: 8px; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
}

input.is-invalid {
  border-color: #d92d20;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.14);
}

input.is-valid {
  border-color: #159947;
  box-shadow: 0 0 0 3px rgba(21, 153, 71, 0.14);
}

textarea {
  min-height: 74px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.captcha-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0;
  border: 1px solid #b7d9d4;
  border-radius: 8px;
  background: #eefaf7;
  padding: 12px 14px;
}

.captcha-row span {
  color: var(--muted);
  font-weight: 800;
}

.captcha-row strong {
  min-width: 112px;
  border: 1px solid #91c8c0;
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  padding: 8px 12px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 2px;
  text-align: center;
  user-select: all;
}

.captcha-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.captcha-row button {
  min-height: 42px;
  background: #fff;
  color: var(--teal);
  white-space: nowrap;
}

.account-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.account-head-spacer {
  min-width: 1px;
  min-height: 42px;
}

.results {
  display: grid;
  gap: 14px;
}

.test-panel {
  margin-bottom: 22px;
}

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

.section-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.history-title {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.test-card {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 24px;
  display: grid;
  gap: 14px;
  min-height: 270px;
}

.test-card.completed {
  border-color: rgba(22, 158, 156, 0.45);
  background: #f5fcf9;
}

.test-card span {
  width: fit-content;
  border-radius: 999px;
  background: #e6f4f1;
  color: var(--teal);
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 900;
}

.test-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.15;
}

.test-card p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.test-card a,
.test-card em {
  width: 100%;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand-primary);
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  padding: 14px 18px;
  font-size: 22px;
  font-weight: 900;
  font-style: normal;
  text-decoration: none;
}

.test-status {
  min-height: 110px;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.test-status strong {
  display: block;
  color: var(--brand-primary);
  font-size: 22px;
  line-height: 1.25;
}

.test-status p {
  margin: 6px 0 0;
  color: var(--ink);
  font-weight: 850;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.test-status small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.test-card.disabled {
  background: #f8fafc;
  color: #667085;
}

.test-card.disabled span {
  background: #e2e8f0;
  color: #667085;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 18px;
}

.result-card header { margin-bottom: 14px; }

.score-line {
  color: var(--teal);
  font-size: 32px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  user-select: text;
  max-width: min(48vw, 520px);
  overflow-wrap: normal;
}

.score-line.disc {
  font-size: clamp(28px, 2.8vw, 32px);
}

.copy-score-btn {
  width: fit-content;
  min-height: 38px;
  padding: 8px 12px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .candidate-login {
    min-height: auto;
  }

  .candidate-login-frame {
    grid-template-columns: 1fr;
  }

  .candidate-brand,
  .candidate-login-box {
    min-height: auto;
  }

  .candidate-brand {
    grid-template-rows: 104px 1fr;
  }

  .candidate-brand::after {
    width: 218px;
    height: 104px;
    right: 20px;
    top: 114px;
    opacity: 0.34;
  }

  .candidate-brand-mark {
    padding: 0 22px;
  }

  .candidate-brand-mark span {
    width: 180px;
    height: 54px;
  }

  .candidate-brand-content {
    padding: 22px;
  }

  .candidate-brand-content h1 span {
    font-size: 17px;
  }

  .candidate-brand-content h1 strong {
    font-size: 34px;
  }

  .test-grid { grid-template-columns: 1fr; }
  .captcha-row { grid-template-columns: 1fr; }
  .topbar,
  .account-head,
  .result-card header,
  .section-title {
    display: grid;
  }

  .candidate-aux-card {
    display: none;
  }

  .brand-lockup {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  h1 {
    font-size: 32px;
  }
}
