/* ============================================
   Digitales Herbarium - Template Styles
   Aesthetic: Pressed herbarium journal, botanical warmth
   ============================================ */

/* --- Journal Opening Animation --- */
@keyframes herbarium-open {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Page Container --- */
.herbarium-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  position: relative;
  animation: herbarium-open 0.6s ease-out both;
}

.herbarium-page .herbarium-bed {
  opacity: 0;
  animation: herbarium-open 0.5s ease-out both;
}

.herbarium-page .herbarium-bed:nth-child(1) { animation-delay: 0.15s; }
.herbarium-page .herbarium-bed:nth-child(2) { animation-delay: 0.25s; }
.herbarium-page .herbarium-bed:nth-child(3) { animation-delay: 0.35s; }
.herbarium-page .herbarium-bed:nth-child(4) { animation-delay: 0.45s; }

/* --- Header --- */
.herbarium-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
}

/* Botanical divider line between header and beds */
.herbarium-header::after {
  content: '';
  display: block;
  width: 120px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 20%,
    rgba(0, 0, 0, 0.2) 80%,
    transparent 100%
  );
  margin: 2rem auto 0;
}

/* Small decorative diamond at center of divider */
.herbarium-header::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: rgba(0, 0, 0, 0.15);
  transform: rotate(45deg);
  margin: 0 auto;
  position: absolute;
  bottom: calc(2rem - 3px);
  left: 50%;
  margin-left: -3px;
  z-index: 2;
}

.herbarium-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.25rem;
  line-height: 1.1;
}

.herbarium-subtitle {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  opacity: 0.45;
  margin: 0 0 1.5rem;
  font-style: italic;
  letter-spacing: 0.02em;
}

.herbarium-welcome {
  font-family: var(--font-text);
  font-size: var(--text-md);
  font-style: italic;
  opacity: 0.65;
  margin: 0 0 0.25rem;
  line-height: 1.5;
}

.herbarium-season {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  opacity: 0.35;
  font-style: italic;
  margin: 0 0 1.5rem;
}

.herbarium-intro {
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto 2rem;
}

/* --- Overall Progress --- */
.herbarium-overall-progress {
  margin-bottom: 2rem;
}

.herbarium-progress-text {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  margin: 0 0 0.5rem;
}

.herbarium-progress-count {
  font-family: var(--font-numbers);
  font-size: var(--text-2xl);
  display: block;
  margin-bottom: 0.25rem;
}

.herbarium-progress-bar {
  width: 100%;
  max-width: 320px;
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}

.herbarium-progress-fill {
  height: 100%;
  background: var(--color-green);
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Progress milestone color shifts */
.herbarium-progress-fill.milestone-25 { background: #6bc96b; }
.herbarium-progress-fill.milestone-50 { background: #4db84d; }
.herbarium-progress-fill.milestone-75 { background: #2ea82e; }
.herbarium-progress-fill.milestone-100 {
  background: var(--color-green);
  box-shadow: 0 0 8px rgba(0, 216, 106, 0.3);
}

.herbarium-page[data-milestone="75"] .herbarium-progress-count,
.herbarium-page[data-milestone="100"] .herbarium-progress-count {
  font-weight: 600;
}

.herbarium-page[data-milestone="100"] .herbarium-progress-count {
  color: var(--color-green);
}

/* --- Bed Overview Cards --- */
.herbarium-beds-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
  max-width: 500px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .herbarium-beds-overview {
    grid-template-columns: repeat(4, 1fr);
    max-width: 100%;
  }
}

.herbarium-bed-card {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, background 0.3s ease;
}

.herbarium-bed-card:hover {
  background: var(--bed-color);
  transform: translateY(-1px);
}

.herbarium-bed-card:active {
  transform: translateY(0);
}

.herbarium-bed-card.complete {
  background: var(--bed-color);
  border-color: rgba(0, 0, 0, 0.12);
}

.herbarium-bed-card-name {
  display: block;
  font-family: var(--font-text);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.herbarium-bed-card-progress {
  display: block;
  font-family: var(--font-numbers);
  font-size: var(--text-lg);
  margin-bottom: 0.5rem;
}

.herbarium-bed-card-bar {
  display: block;
  height: 2px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.herbarium-bed-card-bar span {
  display: block;
  height: 100%;
  background: var(--color-green);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Bed Sections --- */
.herbarium-bed {
  margin-bottom: 3rem;
  padding: 2rem 0;
  position: relative;
}

/* Botanical ornament divider between beds */
.herbarium-bed::before {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  margin: 0 auto 2rem;
}

/* Small leaf-shaped dot on the divider */
.herbarium-bed::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  transform: translateX(-50%);
}

/* First bed needs no top divider */
.herbarium-bed:first-of-type::before,
.herbarium-bed:first-of-type::after {
  display: none;
}

.herbarium-bed--complete {
  background: var(--bed-complete-color);
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 16px;
  overflow: hidden;
}

/* Bed completion ornament */
@keyframes herbarium-ornament-in {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  to {
    opacity: 0.06;
    transform: scale(1) rotate(0deg);
  }
}

.herbarium-bed--complete .herbarium-grid::before {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 140px;
  height: 220px;
  background: url('/assets/graphics/heilpflanzen/abstract-blossom.svg') no-repeat center;
  background-size: contain;
  opacity: 0.06;
  pointer-events: none;
  animation: herbarium-ornament-in 0.8s ease-out both;
}

.herbarium-bed--complete .herbarium-grid {
  position: relative;
}

.herbarium-bed-header {
  margin-bottom: 1.5rem;
}

.herbarium-bed-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.25rem;
}

.herbarium-bed-desc {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  opacity: 0.55;
  font-style: italic;
  margin: 0 0 0.5rem;
}

.herbarium-bed-count {
  font-family: var(--font-numbers);
  font-size: var(--text-sm);
  margin: 0;
  opacity: 0.35;
}


/* --- Plant Grid --- */
.herbarium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

@media (min-width: 480px) {
  .herbarium-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.25rem;
  }
}

/* --- Plant Cards (shared base) --- */
.herbarium-card {
  text-align: center;
}

.herbarium-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.herbarium-card-image {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.02);
}

.herbarium-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.herbarium-card-name {
  font-family: var(--font-text);
  font-size: var(--text-xs);
  line-height: 1.3;
}

.herbarium-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.03);
}

/* --- Collected Cards --- */
.herbarium-card.collected {
  transform: rotate(var(--press-rotation, 0deg));
  transition: transform 0.3s ease;
}

.herbarium-card.collected:hover {
  transform: rotate(var(--press-rotation, 0deg)) translateY(-4px);
  z-index: 1;
}

.herbarium-card.collected .herbarium-card-image {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.herbarium-card.collected:hover .herbarium-card-image {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.herbarium-card.collected .herbarium-card-image img {
  filter: saturate(0.55) sepia(0.25) contrast(0.95);
}

a.herbarium-card-link:hover .herbarium-card-image img {
  filter: saturate(0.85) sepia(0.05);
}

.herbarium-card.collected .herbarium-card-name {
  font-weight: 500;
}

/* --- Uncollected Cards --- */
.herbarium-card.undiscovered {
  cursor: default;
}

.herbarium-card.undiscovered .herbarium-card-image {
  border: 1.5px dashed rgba(0, 0, 0, 0.12);
  position: relative;
}

.herbarium-card.undiscovered .herbarium-card-image img {
  filter: grayscale(1) brightness(1.2) contrast(0.4);
  opacity: 0.3;
}

/* "Noch nicht gesammelt" indicator overlay */
.herbarium-card.undiscovered .herbarium-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Subtle crosshatch/scan hint via radial gradient */
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.04) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.herbarium-card.undiscovered .herbarium-card-name {
  opacity: 0.5;
  font-style: italic;
  font-size: calc(var(--text-xs) * 0.95);
}

/* Bed location hint on tap/hover for undiscovered cards */
.herbarium-card.undiscovered .herbarium-card-link {
  cursor: pointer;
}

.herbarium-card.undiscovered .herbarium-card-bed-hint {
  display: block;
  font-family: var(--font-text);
  font-size: 0.7rem;
  opacity: 0;
  color: var(--color-black);
  margin-top: 0.15rem;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.herbarium-card.undiscovered:hover .herbarium-card-bed-hint,
.herbarium-card.undiscovered:focus-within .herbarium-card-bed-hint {
  opacity: 0.45;
}

/* On mobile, bed hint visible by default at lower opacity */
@media (hover: none) {
  .herbarium-card.undiscovered .herbarium-card-bed-hint {
    opacity: 0.35;
  }
}

/* Not-collected status label */
.herbarium-card-status {
  display: inline-block;
  font-family: var(--font-text);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.35;
  margin-top: 0.15rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  line-height: 1.4;
}

/* --- Code Section --- */
.herbarium-code-section {
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
  position: relative;
}

/* Thin botanical divider */
.herbarium-code-section::before {
  content: '';
  display: block;
  width: 80px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.15) 30%,
    rgba(0, 0, 0, 0.15) 70%,
    transparent 100%
  );
  margin: 0 auto 2rem;
}

.herbarium-code-section h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.herbarium-code-display {
  font-family: var(--font-numbers);
  font-size: 2.5rem;
  letter-spacing: 0.1em;
  padding: 1rem 2rem;
  border: 2px solid var(--color-black);
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
}

.herbarium-code-hint {
  font-size: var(--text-sm);
  opacity: 0.45;
  margin: 0 0 1rem;
}

.herbarium-code-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.herbarium-copy-btn {
  padding: 0.5rem 1.5rem;
  background: var(--color-black);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-text);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.herbarium-copy-btn:hover {
  opacity: 0.85;
}

.herbarium-copy-btn:active {
  opacity: 0.7;
}

/* --- Email / Envelope Section --- */
.herbarium-email-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.herbarium-email-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  font-family: var(--font-text);
  font-size: var(--text-sm);
  color: var(--color-black);
  opacity: 0.6;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: opacity 0.15s ease;
}

.herbarium-email-toggle:hover {
  opacity: 0.85;
}

.herbarium-email-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.herbarium-email-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.herbarium-email-form {
  display: none;
  max-width: 360px;
  margin: 1rem auto 0;
}

.herbarium-email-form.is-open {
  display: block;
}

.herbarium-email-fields {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.herbarium-email-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-text);
  font-size: var(--text-sm);
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  min-width: 0;
}

.herbarium-email-input:focus {
  outline: 2px solid var(--color-green);
  outline-offset: 1px;
  border-color: transparent;
}

.herbarium-email-input::placeholder {
  opacity: 0.4;
}

.herbarium-email-send {
  flex: 0 0 auto;
  padding: 0.6rem 1.25rem;
  background: var(--color-black);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-text);
  font-size: var(--text-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.herbarium-email-send:hover {
  opacity: 0.85;
}

.herbarium-email-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.herbarium-email-privacy {
  font-family: var(--font-text);
  font-size: 0.7rem;
  opacity: 0.4;
  line-height: 1.4;
  margin: 0;
}

.herbarium-email-success {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  color: var(--color-green);
  margin: 0.5rem 0 0;
  font-weight: 500;
}

.herbarium-email-error {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  color: #c00;
  margin: 0.5rem 0 0;
}

/* Mobile: bottom-sheet feel for email form */
@media (max-width: 480px) {
  .herbarium-email-fields {
    flex-direction: column;
  }

  .herbarium-email-send {
    width: 100%;
  }
}

/* Desktop: inline beside copy button */
@media (min-width: 600px) {
  .herbarium-email-section {
    border-top: none;
    padding-top: 0;
    margin-top: 0.75rem;
  }
}

/* --- Share Section --- */
.herbarium-share-section {
  text-align: center;
  padding: 1.5rem 0 3rem;
}

.herbarium-share-btn {
  padding: 0.75rem 2rem;
  background: none;
  color: var(--color-black);
  border: 1.5px solid var(--color-black);
  border-radius: 24px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.herbarium-share-btn:hover {
  background: var(--color-black);
  color: #fff;
}

.herbarium-share-btn:active {
  transform: scale(0.97);
}

/* --- Shared CTA --- */
.herbarium-shared-cta {
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
  position: relative;
}

.herbarium-shared-cta::before {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  margin: 0 auto 2rem;
}

.herbarium-shared-cta h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.herbarium-shared-cta p {
  font-size: var(--text-sm);
  opacity: 0.6;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.herbarium-shared-cta-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: #C5FD79;
  color: var(--color-black);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.herbarium-shared-cta-btn:hover {
  opacity: 0.9;
}

.herbarium-shared-cta-btn:active {
  transform: scale(0.97);
}

/* --- Bookplate (63/63 completion) --- */
@keyframes bookplate-reveal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.herbarium-bookplate {
  text-align: center;
  padding: 3rem 1rem;
  margin-top: 3rem;
}

.herbarium-bookplate-inner {
  display: inline-block;
  position: relative;
  padding: 2.5rem 3rem;
  border: 2px solid var(--color-black);
  background: #fffcf5;
  max-width: 400px;
  animation: bookplate-reveal 0.8s ease-out 0.3s both;
}

/* Double-rule frame */
.herbarium-bookplate-inner::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* Top border gap ornament */
.herbarium-bookplate-inner::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: #fffcf5;
}

.herbarium-bookplate-label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.4;
  margin-bottom: 1rem;
}

.herbarium-bookplate-label:last-child {
  margin-bottom: 0;
  margin-top: 1rem;
}

.herbarium-bookplate-flourish {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--color-black);
  margin: 1rem auto;
  opacity: 0.3;
}

.herbarium-bookplate-count {
  display: block;
  font-family: var(--font-numbers);
  font-size: var(--text-3xl);
  font-style: italic;
  letter-spacing: 0.05em;
  margin: 1rem 0;
  line-height: 1;
}

.herbarium-bookplate-text {
  font-family: var(--font-numbers);
  font-size: var(--text-md);
  font-style: italic;
  margin: 0;
  line-height: 1.8;
}

/* --- Code Entry (no pass) --- */
.herbarium-enter {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.herbarium-enter h2 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.herbarium-enter-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.herbarium-code-field {
  width: 100%;
  display: flex;
  align-items: center;
  border: 2px solid var(--color-black);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  overflow: hidden;
  min-width: 0;
}

.herbarium-code-field:focus-within {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}

.herbarium-code-prefix {
  font-family: var(--font-numbers);
  font-size: var(--text-lg);
  letter-spacing: 0.05em;
  padding: 0.75rem 0 0.75rem 1rem;
  opacity: 0.45;
  user-select: none;
  flex: 0 0 auto;
}

.herbarium-code-input {
  flex: 1;
  padding: 0.75rem 1rem 0.75rem 0;
  font-family: var(--font-numbers);
  font-size: var(--text-lg);
  letter-spacing: 0.05em;
  border: none;
  background: transparent;
  min-width: 0;
}

.herbarium-code-input:focus {
  outline: none;
}

.herbarium-enter-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--color-black);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-text);
  font-size: var(--text-base);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.herbarium-enter-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.herbarium-enter-btn:active:not(:disabled) {
  opacity: 0.7;
}

.herbarium-enter-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.herbarium-or {
  position: relative;
  margin: 1.5rem 0;
}

.herbarium-or span {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  opacity: 0.4;
}

.herbarium-no-code {
  font-family: var(--font-text);
  font-size: var(--text-sm);
}

.herbarium-no-code p {
  opacity: 0.6;
  margin: 0 0 0.5rem;
}

.herbarium-no-code a {
  color: var(--color-black);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  transition: border-color 0.15s ease;
}

.herbarium-no-code a:hover {
  border-color: var(--color-black);
}

.herbarium-error {
  text-align: center;
  padding: 1rem;
  margin: 0 auto 2rem;
  max-width: 400px;
  background: #fdf0ef;
  border-radius: 8px;
  color: #c00;
  font-size: var(--text-sm);
}

.herbarium-error p {
  margin: 0;
}

/* --- Decorative Botanical Background Elements --- */

/* Large botanical illustration: bottom-left of page */
.herbarium-page .herbarium-bed:nth-of-type(2) {
  position: relative;
}

.herbarium-page .herbarium-bed:nth-of-type(2)::before {
  /* Reuse this pseudo for the ornament divider - skip botanical here */
}

/* We use a dedicated decoration container approach via nth-of-type positioning.
   Botanical SVGs positioned as low-opacity background flourishes. */

/* Decorative element on the second bed section */
.herbarium-bed:nth-of-type(3) {
  position: relative;
}

/* Subtle botanical decoration near middle of the page */
.herbarium-bed[data-bed="hildegard-beet"] {
  position: relative;
}

.herbarium-bed[data-bed="hildegard-beet"] .herbarium-grid::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 200px;
  height: 200px;
  background: url('/assets/graphics/heilpflanzen/abstract-flower.svg') no-repeat center / contain;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
  transform: rotate(-20deg);
}

/* Decorative element near the rote-liste bed */
.herbarium-bed[data-bed="rote-liste-beet"] {
  position: relative;
}

.herbarium-bed[data-bed="rote-liste-beet"] .herbarium-grid::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 180px;
  height: 180px;
  background: url('/assets/graphics/heilpflanzen/abstract-blossom.svg') no-repeat center / contain;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  transform: rotate(30deg) scaleX(-1);
}

/* Ensure grids with decorations have positioning context */
.herbarium-bed[data-bed="hildegard-beet"] .herbarium-grid,
.herbarium-bed[data-bed="rote-liste-beet"] .herbarium-grid {
  position: relative;
}

/* --- Responsive Adjustments --- */

@media (min-width: 600px) {
  .herbarium-page {
    padding: 3rem 2rem 5rem;
  }

  .herbarium-title {
    font-size: var(--text-4xl);
    letter-spacing: 0.1em;
  }

  .herbarium-code-display {
    font-size: 3rem;
  }

  .herbarium-bookplate-inner {
    padding: 2.5rem 4rem;
  }
}

@media (min-width: 800px) {
  .herbarium-grid {
    gap: 1.5rem;
  }
}

/* Small screens */
@media (max-width: 375px) {
  .herbarium-page {
    padding: 1.5rem 0.75rem 3rem;
  }

  .herbarium-title {
    font-size: var(--text-2xl);
  }

  .herbarium-code-display {
    font-size: 2rem;
    padding: 0.75rem 1.25rem;
    letter-spacing: 0.08em;
  }

  .herbarium-bookplate-inner {
    padding: 1.5rem 1.5rem;
  }

  .herbarium-bed--complete {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .herbarium-page,
  .herbarium-page .herbarium-bed,
  .herbarium-bookplate-inner,
  .herbarium-bed--complete .herbarium-grid::before {
    animation: none !important;
    opacity: 1;
  }

  .herbarium-progress-fill,
  .herbarium-bed-card-bar span {
    transition: none !important;
  }

  .herbarium-card.collected {
    transition: none !important;
    animation: none !important;
  }

  .herbarium-bed-card,
  .herbarium-share-btn,
  .herbarium-shared-cta-btn,
  .herbarium-copy-btn,
  .herbarium-enter-btn,
  .herbarium-email-send,
  .herbarium-scan-btn,
  .herbarium-card-image img,
  .herbarium-card.collected .herbarium-card-image {
    transition: none !important;
  }

  .herbarium-scanner-result {
    transition: none !important;
  }

  .herbarium-card.undiscovered .herbarium-card-bed-hint {
    transition: none !important;
  }
}

/* --- Scientific Name --- */
.herbarium-card-scientific {
  display: block;
  font-family: var(--font-text);
  font-size: 0.7rem;
  font-style: italic;
  opacity: 0.45;
  margin-top: 0.1rem;
  line-height: 1.2;
}

/* --- Undiscovered hint text --- */
.herbarium-card-hint {
  display: block;
  font-family: var(--font-text);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.35;
  margin-top: 0.2rem;
  transition: opacity 0.2s ease;
}

.herbarium-card-hint.active {
  opacity: 0.6;
  color: var(--color-green);
}

/* --- Botanical Quote (empty state) --- */
.herbarium-quote {
  max-width: 400px;
  margin: 2rem auto 2.5rem;
  padding: 0;
  border: none;
  text-align: center;
}

.herbarium-quote p {
  font-family: var(--font-numbers);
  font-style: italic;
  font-size: var(--text-md);
  line-height: 1.6;
  margin: 0 0 0.5rem;
  opacity: 0.45;
}

.herbarium-quote cite {
  font-family: var(--font-text);
  font-size: var(--text-xs);
  font-style: normal;
  opacity: 0.3;
  letter-spacing: 0.05em;
}

/* --- Scan Button --- */
.herbarium-scan-btn {
  display: none;
}

@media (hover: none) {
.herbarium-scan-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem auto 0;
  padding: 0.75rem 2rem;
  background: #C5FD79;
  color: #000;
  border: none;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.herbarium-scan-btn:hover {
  opacity: 0.9;
}

.herbarium-scan-btn:active {
  transform: scale(0.97);
}
} /* end @media (hover: none) */

/* --- QR Scanner Overlay --- */
.herbarium-scanner {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: #000;
  display: flex;
  flex-direction: column;
}

.herbarium-scanner video {
  flex: 1;
  object-fit: cover;
  width: 100%;
}

.herbarium-scanner canvas {
  display: none;
}

.herbarium-scanner-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border: 2px solid rgba(197, 253, 121, 0.5);
  border-radius: 16px;
  pointer-events: none;
}

/* Corner accents */
.herbarium-scanner-guide::before,
.herbarium-scanner-guide::after {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: #C5FD79;
  border-style: solid;
  border-width: 0;
}

.herbarium-scanner-guide::before {
  top: -1px;
  left: -1px;
  border-top-width: 3px;
  border-left-width: 3px;
  border-top-left-radius: 16px;
}

.herbarium-scanner-guide::after {
  top: -1px;
  right: -1px;
  border-top-width: 3px;
  border-right-width: 3px;
  border-top-right-radius: 16px;
}

.herbarium-scanner-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
  text-align: center;
  font-family: var(--font-text);
  font-size: 0.85rem;
  pointer-events: none;
}

.herbarium-scanner-result {
  position: absolute;
  bottom: 5rem;
  left: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border-left: 4px solid #C5FD79;
  font-family: var(--font-text);
  font-size: 0.9rem;
  transform: translateY(120%);
  transition: transform 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.herbarium-scanner-result.visible {
  transform: translateY(0);
}

.herbarium-scanner-result.already {
  border-left-color: #888;
}

.herbarium-scanner-close {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: 1rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.herbarium-scanner-close:active {
  background: rgba(0, 0, 0, 0.7);
}

/* --- Print Styles --- */
@media print {
  .herbarium-page {
    background: white;
    padding: 1rem;
  }

  .herbarium-share-section,
  .herbarium-email-section,
  .herbarium-code-section .herbarium-copy-btn,
  .herbarium-scan-btn {
    display: none;
  }

  .herbarium-card.undiscovered .herbarium-card-image img {
    filter: grayscale(1);
    opacity: 0.2;
  }

  .herbarium-card.collected .herbarium-card-image img {
    filter: none;
  }
}
