/* ==========================================================================
   LUN4R CTF 2026 - Minimal Certificate Generator
   Clean, focused, matching the cosmic CTF theme.
   ========================================================================== */

.cert-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cert-section {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  flex: 1;
  position: relative;
  z-index: 2;
}

/* Background Ambient Glows */
.cert-glow-left {
  position: absolute;
  top: 15%;
  left: -120px;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(118, 82, 184, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.cert-glow-right {
  position: absolute;
  top: 35%;
  right: -120px;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 167, 122, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Header */
.cert-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
}

.cert-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.cert-subtitle {
  color: var(--c-text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* Main Minimal Container */
.cert-container {
  max-width: 860px;
  margin: 0 auto;
}

/* Simple Input Card */
.cert-form-box {
  background: rgba(11, 18, 32, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.cert-input-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 640px) {
  .cert-input-row {
    flex-direction: column;
  }
}

.cert-input {
  flex: 1;
  background: rgba(7, 8, 11, 0.85);
  border: 1px solid rgba(232, 232, 230, 0.18);
  border-radius: 4px;
  padding: 14px 18px;
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: 1.05rem;
  transition: all var(--t-fast);
  outline: none;
}

.cert-input:focus {
  border-color: var(--c-gold);
  box-shadow: 0 0 14px rgba(185, 167, 122, 0.25);
  background: rgba(7, 8, 11, 0.95);
}

.cert-input::placeholder {
  color: rgba(232, 232, 230, 0.35);
}

.btn-download {
  background: linear-gradient(135deg, #E8D9A8 0%, #C9B57A 50%, #A8924E 100%);
  color: #07080B;
  font-family: var(--f-heading);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: all var(--t-base);
  box-shadow: 0 6px 20px rgba(185, 167, 122, 0.25);
}

.btn-download:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(185, 167, 122, 0.35);
}

/* Certificate Preview Frame */
.cert-preview-wrapper {
  position: relative;
  background: rgba(11, 18, 32, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.cert-canvas-frame {
  position: relative;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(185, 167, 122, 0.2);
  background: #0B1220;
}

#certificate-canvas {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Loading Overlay */
.cert-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 11, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 5;
  transition: opacity 0.3s ease;
}

.cert-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(185, 167, 122, 0.2);
  border-top-color: var(--c-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Minimal Toast */
.cert-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(11, 18, 32, 0.95);
  border: 1px solid var(--c-gold);
  color: var(--c-text);
  padding: 12px 18px;
  border-radius: 4px;
  font-size: 0.85rem;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all var(--t-base);
  pointer-events: none;
}

.cert-toast.show {
  transform: translateY(0);
  opacity: 1;
}
