/* Official License section */
#license {
  position: relative;
  overflow: visible;
}

.license-card {
  position: relative;
  display: grid;
  gap: 2rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #0b1220 0%, #141d2e 100%);
  border-radius: 1.5rem;
  border: 1px solid rgba(201, 168, 76, 0.25);
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.25);
  overflow: hidden;
}

.license-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.license-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.license-preview-wrap {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.license-frame-shell {
  position: relative;
  padding: 0.75rem;
  background: linear-gradient(145deg, #f4f1ec, #e8e4dc);
  border-radius: 1rem;
  box-shadow:
    inset 0 0 0 2px rgba(201, 168, 76, 0.4),
    inset 0 0 0 6px rgba(11, 18, 32, 0.06),
    0 16px 40px rgba(0, 0, 0, 0.2);
}

.license-frame-shell::before,
.license-frame-shell::after {
  content: "";
  position: absolute;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid #c9a84c;
  pointer-events: none;
  z-index: 2;
}

.license-frame-shell::before {
  top: 0.5rem;
  left: 0.5rem;
  border-right: none;
  border-bottom: none;
}

.license-frame-shell::after {
  bottom: 0.5rem;
  right: 0.5rem;
  border-left: none;
  border-top: none;
}

.license-viewer {
  position: relative;
  min-height: 14rem;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
}

.license-viewer.has-canvas {
  min-height: 0;
  height: auto;
}

.license-canvas-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.75rem;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.license-canvas-link {
  display: block;
  width: 100%;
  line-height: 0;
  text-decoration: none;
  margin: 0 auto;
}

.license-canvas-link.hidden {
  display: none !important;
}

.license-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.35rem;
  opacity: 1;
  background: #fff;
}

.license-canvas.hidden {
  display: none !important;
}

.license-canvas.loaded {
  box-shadow: 0 2px 12px rgba(11, 18, 32, 0.08);
}

.license-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #0b1220;
  font-size: 0.875rem;
  font-weight: 500;
  background: #fff;
}

.license-loading.hidden {
  display: none;
}

.license-loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(201, 168, 76, 0.25);
  border-top-color: #c9a84c;
  border-radius: 50%;
  animation: licenseSpin 0.8s linear infinite;
}

@keyframes licenseSpin {
  to {
    transform: rotate(360deg);
  }
}

.license-fallback {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  width: 100%;
  min-height: 24rem;
  background: linear-gradient(160deg, #fff 0%, #f4f1ec 100%);
}

.license-fallback.hidden {
  display: none;
}

.license-fallback-logo {
  width: auto;
  height: 4.5rem;
  margin-bottom: 1rem;
}

.license-fallback-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c9a84c;
}

.license-fallback-title {
  margin-top: 0.5rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #0b1220;
}

.license-fallback-company {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0b1220;
}

.license-fallback-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: rgba(11, 18, 32, 0.55);
}

.license-fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.85rem 1.5rem;
  background: #c9a84c;
  color: #0b1220;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(201, 168, 76, 0.35);
}

.license-fallback-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.license-mobile-open {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #0b1220;
  color: #c9a84c;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.75rem;
  text-align: center;
}

.license-mobile-open svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.license-stamp {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border: 3px double #c9a84c;
  border-radius: 50%;
  background: rgba(11, 18, 32, 0.9);
  color: #c9a84c;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.25;
  transform: rotate(-12deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  animation: licenseStampPulse 3s ease-in-out infinite;
}

.license-stamp span {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.65rem;
  color: #dfc06a;
}

@keyframes licenseStampPulse {
  0%, 100% {
    transform: rotate(-12deg) scale(1);
  }
  50% {
    transform: rotate(-12deg) scale(1.05);
  }
}

.license-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: #dfc06a;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.license-title {
  margin-top: 1rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.license-title em {
  font-style: normal;
  background: linear-gradient(90deg, #c9a84c, #dfc06a, #c9a84c);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: licenseShimmer 5s linear infinite;
}

@keyframes licenseShimmer {
  to {
    background-position: 200% center;
  }
}

.license-desc {
  margin-top: 1rem;
  max-width: 32rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  font-size: 0.95rem;
}

.license-meta {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.license-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.license-meta-item svg {
  width: 1rem;
  height: 1rem;
  color: #c9a84c;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.license-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.license-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  background: #c9a84c;
  color: #0b1220;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.3);
  animation: licenseBtnGlow 2.5s ease-in-out infinite;
}

.license-btn-download:hover {
  background: #dfc06a;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(201, 168, 76, 0.45);
}

@keyframes licenseBtnGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(201, 168, 76, 0.3);
  }
  50% {
    box-shadow: 0 8px 32px rgba(201, 168, 76, 0.55);
  }
}

.license-btn-download svg {
  width: 1.125rem;
  height: 1.125rem;
}

.license-btn-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.5rem;
  background: transparent;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.license-btn-view:hover {
  border-color: #c9a84c;
  color: #c9a84c;
  transform: translateY(-2px);
}

.license-btn-view svg {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 1023px) {
  #license {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  #license .mb-12 {
    margin-bottom: 2rem;
  }

  .license-card {
    padding: 1rem;
    gap: 1.5rem;
  }

  .license-content {
    order: 1;
  }

  .license-preview-wrap {
    order: 2;
  }

  .license-viewer {
    min-height: 12rem;
  }

  .license-viewer.has-canvas {
    min-height: 0;
  }

  .license-canvas-wrap {
    padding: 0.5rem;
  }

  .license-stamp {
    top: 0.5rem;
    right: 0.5rem;
    width: 3.75rem;
    height: 3.75rem;
    font-size: 0.42rem;
  }

  .license-stamp span {
    font-size: 0.55rem;
  }

  .license-mobile-open {
    display: flex;
  }

  .license-fallback {
    min-height: 20rem;
    padding: 1.5rem 1rem;
  }

  .license-fallback-logo {
    height: 3.5rem;
  }

  .license-fallback-title {
    font-size: 1.35rem;
  }
}

@media (min-width: 640px) {
  .license-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .license-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .license-btn-download,
  .license-btn-view {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .license-card {
    grid-template-columns: 1.15fr 1fr;
    padding: 2.5rem;
    gap: 2.5rem;
  }

  .license-viewer:not(.has-canvas) {
    min-height: 16rem;
  }

  .license-mobile-open {
    display: none;
  }

  .license-stamp {
    width: 5.5rem;
    height: 5.5rem;
    font-size: 0.55rem;
  }

  .license-stamp span {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .license-stamp,
  .license-title em,
  .license-btn-download,
  .license-loading-spinner {
    animation: none !important;
  }
}
