:root {
  color-scheme: light;
  --green: #30492e;
  --background: #f8f7f2;
  --border: #dedacf;
  --text: #252a24;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system,
               BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

.gift-shell {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.languages {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.languages button {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  color: var(--green);
  cursor: pointer;
  border-radius: 8px;
}

.languages button[aria-pressed="true"] {
  background: #e6eadb;
  font-weight: 700;
}

header {
  text-align: center;
  padding: 36px 0 24px;
}

.brand {
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .15em;
  color: var(--green);
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 12px 0;
  line-height: 1.2;
}

.gift-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: clamp(16px, 4vw, 32px);
  text-align: center;
}

#gift-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 24px;
  border-radius: 12px;
}

.primary,
.secondary {
  font: inherit;
  font-weight: 650;
  padding: 14px 24px;
  border-radius: 10px;
  cursor: pointer;
}

.primary {
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
  width: 100%;
}

.secondary {
  background: white;
  color: var(--green);
  border: 1px solid var(--border);
}

button:disabled {
  opacity: .6;
  cursor: wait;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #799359;
  outline-offset: 3px;
}

#status[data-error="true"] {
  color: #a02e2e;
}

#instructions {
  margin-top: 20px;
  font-size: .95rem;
}

#security-info {
  color: #62685e;
  font-size: .85rem;
}

footer {
  text-align: center;
  padding: 24px 0;
}

footer a {
  color: var(--green);
  font-weight: 650;
}

footer p {
  color: #74796f;
  font-size: .85rem;
}

@media (max-width: 480px) {
  .gift-shell {
    padding: 14px;
  }

  header {
    padding-top: 24px;
  }
}


/* R1.5E.2A.1 */

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

#action-status:empty {
  display: none;
}

#action-status {
  font-size: .9rem;
}

@media (max-width: 480px) {
  .secondary-actions {
    grid-template-columns: 1fr;
  }
}

@page {
  size: A4 portrait;
  margin: 15mm;
}

@media print {

  html,
  body {
    margin: 0;
    padding: 0;
    background: white !important;
  }

  .languages,
  header,
  footer,
  #status,
  #gift-actions,
  #retry,
  #instructions,
  #action-status {
    display: none !important;
  }

  .gift-shell,
  .gift-panel {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #gift-image:not([hidden]) {
    display: block;
    width: 160mm;
    max-width: 100%;
    height: auto;
    margin: 10mm auto 0;
    border-radius: 0;
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
