@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --primary: #a78bfa;
  --bg-dark: #070514;
  --card-bg: rgba(20, 18, 48, 0.4);
  --input-bg: rgba(20, 18, 48, 0.6);
  --border: rgba(167, 139, 250, 0.15);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --success: #10b981;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(167, 139, 250, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(167, 139, 250, 0.05) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.83v58.34h-58.34v-.83l56.68-56.68h.83v-1.66zm-52.96 0l-1.66 1.66v58.34h1.66v-60zm58.34 52.96l-1.66 1.66v-54.62l1.66-1.66v54.62z' fill='%23a78bfa' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

header {
  padding: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.header-logo {
  height: 32px;
}

.header-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  width: 100%;
}

.home-content, .verify-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 700;
  color: #fff;
}

.hero-title span {
  display: block;
}

.search-container {
  width: 100%;
  max-width: 600px;
  margin-bottom: 5rem;
}

.input-group {
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1.2rem;
  display: flex;
  align-items: center;
  color: var(--primary);
  opacity: 0.7;
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

.search-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.2rem 1.2rem 3rem;
  color: var(--text-main);
  font-family: 'Roboto Mono', monospace;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.1);
}

.search-input::placeholder {
  color: #6b7280;
}

.verify-btn {
  width: 100%;
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  padding: 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.verify-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.verify-btn:active {
  transform: translateY(1px);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1000px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(10px);
}

.feature-icon-wrapper {
  background: rgba(167, 139, 250, 0.1);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  border: 1px solid var(--border);
}

.feature-icon-wrapper svg {
  width: 20px;
  height: 20px;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer {
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Roboto Mono', monospace;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(167, 139, 250, 0); }
  100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
}

.verify-result {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem;
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  backdrop-filter: blur(10px);
}

.verify-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.back-action {
  width: 100%;
  max-width: 980px;
  margin-bottom: 2rem;
}

.back-action a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.back-action a:hover {
  color: var(--primary);
}

.verify-summary-title {
  font-size: 1.8rem;
}

.verify-summary-text {
  color: var(--text-muted);
}

.template-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1.4145;
  container-type: inline-size;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
}

.template-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}

.template-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay-text {
  position: absolute;
  color: #111827;
  font-family: 'Roboto', 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
}

.overlay-full-name {
  top: 42.2%;
  left: 50%;
  transform: translate(-50%, -100%);
  font-weight: 300;
  font-size: clamp(1.1rem, 4.1cqw, 3rem);
}

.overlay-member-id {
  top: 74.5%;
  left: 12.5%;
  transform: translate(-50%, -100%);
  font-weight: 700;
  font-size: clamp(0.52rem, 1.8cqw, 1.25rem);
}

.overlay-date-issued {
  top: 74.5%;
  left: 50%;
  transform: translate(-50%, -100%);
  font-weight: 700;
  font-size: clamp(0.52rem, 1.8cqw, 1.25rem);
}

.overlay-valid-through {
  top: 74.5%;
  left: 87.8%;
  transform: translate(-50%, -100%);
  font-weight: 700;
  font-size: clamp(0.52rem, 1.8cqw, 1.25rem);
}

.download-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  margin-top: 1rem;
  font-size: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s ease;
  align-self: flex-start;
  display: inline-block;
}

.download-btn:hover {
  opacity: 0.85;
}

.overlay-qr {
  position: absolute;
  top: 79%;
  left: 50%;
  transform: translate(-50%, 0);
  width: 8cqw;
  height: auto;
}

.template-missing-note {
  color: #fbbf24;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
}

.member-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 1.1rem;
  font-weight: 500;
}

.back-btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: flex-start;
  text-decoration: none;
  display: inline-block;
}

.back-btn:hover {
  background: rgba(167, 139, 250, 0.1);
}

.loading-spinner {
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

@media (max-width: 1100px) {
  .main-layout {
    padding: 0 1.25rem;
  }

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
  }

  .verify-result {
    padding: 2rem;
  }
}

@media (max-width: 900px) {
  .main-layout {
    padding: 0 1rem;
  }

  header {
    padding: 1.25rem 0;
    gap: 0.75rem;
  }

  .header-logo {
    height: 28px;
  }

  .header-title {
    font-size: 1.05rem;
  }

  .hero-title {
    font-size: clamp(2rem, 7vw, 2.8rem);
    margin-bottom: 2rem;
  }

  .search-container {
    margin-bottom: 2.5rem;
  }

  .verify-result {
    padding: 1.25rem;
    gap: 1rem;
  }

  .download-btn {
    width: 100%;
    text-align: center;
  }

  .member-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.25rem 0;
  }

  .overlay-full-name {
    top: 41.6%;
    font-size: clamp(1rem, 4.6cqw, 1.9rem);
  }

  .overlay-member-id,
  .overlay-date-issued,
  .overlay-valid-through {
    top: 74.5%;
    font-size: clamp(0.45rem, 2.2cqw, 0.85rem);
  }
}

@media (max-width: 680px) {
  .content-wrapper {
    padding: 1rem 0;
  }

  .input-group {
    margin-bottom: 1rem;
  }

  .search-input {
    padding: 1rem 1rem 1rem 2.8rem;
    font-size: 0.95rem;
  }

  .verify-btn {
    padding: 1rem;
    font-size: 1rem;
  }

  .feature-card {
    padding: 1.25rem;
  }

  .verify-summary-title {
    font-size: 1.45rem;
  }

  .back-action {
    margin-bottom: 1rem;
  }

  .overlay-full-name {
    top: 42.2%;
    font-size: clamp(0.88rem, 4.8cqw, 1.35rem);
  }

  .overlay-member-id,
  .overlay-date-issued,
  .overlay-valid-through {
    top: 74.7%;
    font-size: clamp(0.38rem, 2.35cqw, 0.68rem);
  }

  .overlay-qr {
    width: 9.3cqw;
  }
}

@media (max-width: 480px) {
  .main-layout {
    padding: 0 0.75rem;
  }

  header {
    padding: 1rem 0;
    gap: 0.5rem;
  }

  .header-logo {
    height: 24px;
  }

  .header-title {
    font-size: 0.98rem;
  }

  .hero-title {
    margin-bottom: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .verify-summary-text,
  .info-value {
    font-size: 0.95rem;
  }

  .overlay-member-id,
  .overlay-date-issued,
  .overlay-valid-through {
    font-size: clamp(0.34rem, 2.5cqw, 0.58rem);
  }

  .overlay-qr {
    width: 10.2cqw;
  }
}
