:root {
  color-scheme: light;
  --primary: #7b73d5;
  --text-dark: #37335c;
  --text-mid: #888888;
  --text-body: #333333;
  --surface: #f3f4f8;
  --panel: #ffffff;
  --certificate-width: 1200px;
  --certificate-height: 783px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--surface);
  color: #121212;
}

.page {
  width: 100%;
  margin: 0;
  padding: 24px;
  overflow-x: auto;
}

.certificate-shell {
  width: fit-content;
  margin: 0 auto;
  border-radius: 24px;
  padding: 14px;
  background: linear-gradient(145deg, #ece8ff 0%, #f8f9ff 45%, #f4f6ff 100%);
  box-shadow: 0 16px 44px rgba(51, 51, 80, 0.16);
}

.certificate {
  width: var(--certificate-width);
  min-width: var(--certificate-width);
  max-width: var(--certificate-width);
  height: var(--certificate-height);
  min-height: var(--certificate-height);
  max-height: var(--certificate-height);
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  background:
    url("/curriculum-certificate/assets/hp_certificate.png") center / cover no-repeat,
    radial-gradient(circle at 12% 15%, rgba(123, 115, 213, 0.2), transparent 45%),
    radial-gradient(circle at 92% 18%, rgba(247, 178, 103, 0.25), transparent 34%),
    radial-gradient(circle at 82% 84%, rgba(90, 91, 159, 0.15), transparent 30%),
    var(--panel);
  border: 1px solid #e8eaf3;
  border-radius: 20px;
  padding: 30px 48px;
}

.certificate-header {
  text-align: center;
}

.logo-image {
  width: 150px !important;
  max-width: 150px !important;
  height: auto;
  display: block;
  margin: 0 auto;
}

.title {
  margin: 34px 0 0;
  color: var(--primary);
  font-size: 62px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.subtitle-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.subtitle {
  margin: 0;
  color: var(--text-dark);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 30px;
}

.divider {
  width: 96px;
  height: 2px;
  background: var(--primary);
}

.certificate-body {
  margin-top: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.copy-muted {
  margin: 0;
  color: var(--text-mid);
  font-size: 26px;
}

.recipient-name {
  margin: 20px 0;
  width: 100%;
  min-width: 0;
  max-width: 920px;
  color: #5a5b9f;
  font-size: 60px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recipient-name.is-long {
  max-width: 620px;
  font-size: 44px;
}

.course-name {
  margin: 24px 0 0;
  width: 100%;
  min-width: 0;
  max-width: 860px;
  color: var(--text-dark);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
}

.course-name.is-long {
  max-width: 560px;
  font-size: 26px;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.certificate-stats {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  min-width: 0;
}

.stat-divider {
  width: 2px;
  align-self: stretch;
  background: #dddddd;
  opacity: 0.9;
}

.stat-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 100%;
  height: 100%;
  fill: #f7b267;
}

.stat-label {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
}

.stat-value {
  margin: 10px 0 0;
  color: var(--text-body);
  font-size: 14px;
  max-width: 200px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.certificate-footer {
  margin-top: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 220px;
}

.qr-code {
  width: 116px;
  height: 116px;
  border: 1px solid #ececec;
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}
