/* Certificate of Authenticity — printable sheet (VETOBEN design base) */
:root {
  --cert-ink: #1a1714;
  --cert-ink-70: rgba(26, 23, 20, 0.7);
  --cert-ink-45: rgba(26, 23, 20, 0.45);
  --cert-gold: #b08d4f;
  --cert-gold-light: #d8bd85;
  --cert-paper: #f7f3ea;
  --cert-line: rgba(26, 23, 20, 0.14);
}

.cert-sheet {
  --cert-w: 8.5in;
  --cert-h: 11in;
  width: var(--cert-w);
  min-height: var(--cert-h);
  background: var(--cert-paper);
  color: var(--cert-ink);
  font-family: "Inter", system-ui, sans-serif;
  position: relative;
  box-sizing: border-box;
  padding: 0.28in;
  -webkit-font-smoothing: antialiased;
}

.cert-sheet[data-size="letter"] {
  --cert-w: 8.5in;
  --cert-h: 11in;
}
.cert-sheet[data-size="letter-landscape"] {
  --cert-w: 11in;
  --cert-h: 8.5in;
}
.cert-sheet[data-size="a4"] {
  --cert-w: 210mm;
  --cert-h: 297mm;
}
.cert-sheet[data-size="a4-landscape"] {
  --cert-w: 297mm;
  --cert-h: 210mm;
}
.cert-sheet[data-size="a5"] {
  --cert-w: 148mm;
  --cert-h: 210mm;
}
.cert-sheet[data-size="half-letter"] {
  --cert-w: 5.5in;
  --cert-h: 8.5in;
}
.cert-sheet[data-size="5x7"] {
  --cert-w: 5in;
  --cert-h: 7in;
}

.cert-sheet::before {
  content: "";
  position: absolute;
  inset: 0.28in;
  background-image:
    repeating-linear-gradient(
      115deg,
      rgba(176, 141, 79, 0.05) 0px,
      rgba(176, 141, 79, 0.05) 1px,
      transparent 1px,
      transparent 14px
    ),
    repeating-linear-gradient(
      65deg,
      rgba(176, 141, 79, 0.05) 0px,
      rgba(176, 141, 79, 0.05) 1px,
      transparent 1px,
      transparent 14px
    );
  pointer-events: none;
  z-index: 0;
}

.cert-frame {
  position: relative;
  z-index: 1;
  border: 2px solid var(--cert-gold);
  padding: 3px;
  min-height: calc(var(--cert-h) - 0.56in);
  height: 100%;
  box-sizing: border-box;
}

.cert-frame-inner {
  border: 1px solid var(--cert-gold);
  padding: clamp(18px, 3.8%, 44px) clamp(16px, 4.8%, 56px) clamp(14px, 3.2%, 40px);
  position: relative;
  min-height: calc(100% - 6px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.cert-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  opacity: 0.85;
  pointer-events: none;
}
.cert-corner svg {
  width: 100%;
  height: 100%;
}
.cert-corner.tl {
  top: -2px;
  left: -2px;
}
.cert-corner.tr {
  top: -2px;
  right: -2px;
  transform: scaleX(-1);
}
.cert-corner.bl {
  bottom: -2px;
  left: -2px;
  transform: scaleY(-1);
}
.cert-corner.br {
  bottom: -2px;
  right: -2px;
  transform: scale(-1, -1);
}

.cert-header {
  text-align: center;
  position: relative;
  z-index: 1;
}
.cert-header__logo {
  height: clamp(28px, 3.6vw, 40px);
  width: auto;
  margin-bottom: 6px;
  object-fit: contain;
}
.cert-header__word {
  font-size: clamp(10px, 1.15vw, 13px);
  letter-spacing: 0.42em;
  font-weight: 600;
  color: var(--cert-ink);
  margin-bottom: 12px;
}
.cert-title {
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(22px, 3.1vw, 34px);
  color: var(--cert-ink);
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.cert-subtitle {
  font-size: clamp(8px, 0.95vw, 10.5px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cert-gold);
  font-weight: 700;
  margin-top: 6px;
}
.cert-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 14px auto 0;
  max-width: 260px;
}
.cert-rule::before,
.cert-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--cert-gold);
  opacity: 0.5;
}
.cert-rule span {
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: var(--cert-gold);
  flex-shrink: 0;
}

.cert-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  font-size: clamp(8px, 0.95vw, 10.5px);
  color: var(--cert-ink-45);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.cert-meta b {
  color: var(--cert-ink-70);
  font-weight: 600;
}

.cert-photos {
  display: flex;
  gap: clamp(8px, 1.2%, 14px);
  margin: clamp(16px, 2.6%, 30px) 0 clamp(14px, 2.4%, 28px);
  position: relative;
  z-index: 1;
}
.cert-photo {
  flex: 1;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: linear-gradient(135deg, #e7ddc9, #cdbb93);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(26, 23, 20, 0.15);
}
.cert-photo.main {
  flex: 1.35;
}
.cert-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cert-photo .tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 2;
  font-size: clamp(7px, 0.75vw, 8.5px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26, 23, 20, 0.55);
  background: rgba(247, 243, 234, 0.78);
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 700;
}
.cert-photo .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(10px, 1.1vw, 12px);
  color: rgba(26, 23, 20, 0.38);
  z-index: 1;
}
.cert-photo.has-image .ph {
  display: none;
}

.cert-product {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(16px, 3%, 40px);
  position: relative;
  z-index: 1;
  margin-bottom: clamp(14px, 2.2%, 26px);
}
.cert-product-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(18px, 2.45vw, 27px);
  color: var(--cert-ink);
  margin-bottom: 12px;
  line-height: 1.2;
}
.cert-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px clamp(16px, 3%, 34px);
  font-size: clamp(10px, 1.1vw, 12px);
  margin: 0;
}
.cert-specs dt {
  color: var(--cert-ink-45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(8px, 0.85vw, 9.5px);
  margin-bottom: 2px;
}
.cert-specs dd {
  color: var(--cert-ink);
  font-weight: 600;
  margin: 0;
}

.cert-value {
  text-align: right;
  flex-shrink: 0;
  padding-left: 16px;
  border-left: 1px solid var(--cert-line);
  min-width: 7.5em;
}
.cert-value__label {
  font-size: clamp(8px, 0.85vw, 9.5px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cert-ink-45);
  margin-bottom: 4px;
}
.cert-value__amt {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(24px, 2.9vw, 32px);
  color: var(--cert-ink);
  line-height: 1.1;
}
.cert-value__note {
  font-size: clamp(8px, 0.85vw, 9.5px);
  color: var(--cert-ink-45);
  margin-top: 4px;
}

.cert-statement {
  font-family: "EB Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(11px, 1.2vw, 13px);
  line-height: 1.75;
  color: var(--cert-ink-70);
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(16px, 2.6%, 30px);
  position: relative;
  z-index: 1;
}
.cert-statement b {
  font-style: normal;
  color: var(--cert-ink);
  font-weight: 600;
}

.cert-sign-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 8px;
}
.cert-sign-col {
  width: clamp(120px, 22%, 230px);
}
.cert-sig-line {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(16px, 2vw, 22px);
  color: var(--cert-ink);
  border-bottom: 1px solid var(--cert-ink);
  padding-bottom: 4px;
  margin-bottom: 4px;
  min-height: 1.4em;
}
.cert-sign-col .role {
  font-size: clamp(8px, 0.85vw, 9.5px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cert-ink-45);
}

.cert-seal {
  width: clamp(72px, 9.5vw, 104px);
  height: clamp(72px, 9.5vw, 104px);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 35% 30%, #2a2521, var(--cert-ink) 70%);
  box-shadow:
    0 10px 22px rgba(26, 23, 20, 0.3),
    inset 0 0 0 1px rgba(216, 189, 133, 0.15);
}
.cert-seal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.4px solid var(--cert-gold);
}
.cert-seal img {
  height: clamp(18px, 2.4vw, 26px);
  width: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.cert-verify {
  width: clamp(120px, 22%, 230px);
  text-align: right;
}
.cert-verify__qr {
  width: clamp(44px, 5vw, 56px);
  height: clamp(44px, 5vw, 56px);
  margin-left: auto;
  margin-bottom: 6px;
  background: #fff;
  padding: 2px;
  box-sizing: border-box;
}
.cert-verify__qr canvas,
.cert-verify__qr img {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.cert-verify__txt {
  font-size: clamp(7.5px, 0.8vw, 9px);
  color: var(--cert-ink-45);
  letter-spacing: 0.04em;
  line-height: 1.5;
  word-break: break-all;
}

.cert-footer {
  text-align: center;
  margin-top: clamp(16px, 2.8%, 32px);
  padding-top: 12px;
  border-top: 1px solid var(--cert-line);
  font-size: clamp(7.5px, 0.8vw, 9px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cert-ink-45);
  position: relative;
  z-index: 1;
}

/* Compact sizes */
.cert-sheet[data-size="a5"] .cert-photos,
.cert-sheet[data-size="5x7"] .cert-photos,
.cert-sheet[data-size="half-letter"] .cert-photos {
  margin: 12px 0 14px;
}
.cert-sheet[data-size="a5"] .cert-statement,
.cert-sheet[data-size="5x7"] .cert-statement,
.cert-sheet[data-size="half-letter"] .cert-statement {
  font-size: 10.5px;
  margin-bottom: 14px;
}
.cert-sheet[data-size="5x7"] .cert-specs {
  grid-template-columns: 1fr;
  gap: 6px;
}

@media print {
  .cert-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
