:root {
  --primary: #06b6d4; /* Cyan */
  --primary-hover: #0891b2;
  --secondary: #8b5cf6; /* Violet */
  --accent: #f43f5e; /* Coral pink */
  
  --bg-color: #0ea5e9; 
  --text: #ffffff;
  
  --card-bg: rgba(255, 255, 255, 0.15); 
  --card-border: rgba(255, 255, 255, 0.3);
  --card-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.4);
  --glass-blur: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

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

html, body {
  /* Prevent scrollbars from appearing when perfectly fit inside embed */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
::-webkit-scrollbar {
  display: none;
}

body {
  font-family: 'Manrope', sans-serif;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

/* Background Gradients (Glows) */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
}
.glow-1 {
  top: -10%; left: -5%;
  width: 60vw; height: 60vw;
  background: rgba(244, 63, 94, 0.35); /* Coral glow */
}
.glow-2 {
  bottom: -10%; right: -10%;
  width: 50vw; height: 50vw;
  background: rgba(167, 139, 250, 0.35); /* Lavender glow */
}
.glow-3 {
  top: 30%; left: 40%;
  width: 70vw; height: 70vw;
  background: rgba(14, 165, 233, 0.35); /* Electric blue glow */
}

/* Layout */
.layout-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 5;
}

/* Main Content Column */
.main-content {
  width: 100%;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Base Glass Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  box-shadow: var(--card-shadow);
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

/* Modal specific styles */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
div.modal.hidden {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 95vh;
  overflow-y: auto;
  z-index: 10000;
}
/* Larger card for modal so test is more prominent */
.large-card {
  padding: 48px 40px;
  background: rgba(14, 165, 233, 0.3);
}

.close-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
  background: rgba(0,0,0,0.2);
  border: none;
  color: white;
  border-radius: 50%;
  padding: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
}
.close-modal:hover {
  background: rgba(0,0,0,0.4);
}

/* Quiz UI */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.btn-icon {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s;
  padding: 8px 12px;
  margin-left: -12px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}
.btn-icon:hover {
  color: white;
}

.progress-indicator {
  background: rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.question-text {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 32px;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.answers-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.answer-btn {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 16px;
  padding: 20px 24px;
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  font-weight: 600;
  color: white;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  line-height: 1.4;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  backdrop-filter: blur(8px);
  min-height: 72px;
  display: flex;
  align-items: center;
}
.answer-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Form UI */
.form-card {
  text-align: center;
}
.form-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.form-desc {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.95);
  line-height: 1.6;
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 20px;
  text-align: left;
}
.form-group label {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #fff;
}
.form-group input {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.2);
  color: white;
  font-size: 1.15rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
}
.form-group input::placeholder {
  color: rgba(255,255,255,0.5);
}
.form-group input:focus {
  border-color: var(--primary);
  background: rgba(0,0,0,0.3);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3);
}
.form-submit-btn {
  width: 100%;
  margin-top: 12px;
  font-size: 1.15rem;
  padding: 16px;
}
.form-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Result UI */
.result-card {
  text-align: center;
}

.result-image-wrapper {
  width: 100%;
  max-width: 220px;
  margin: 0 auto 24px auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0,0,0,0.4);
  border: 2px solid rgba(255,255,255,0.4);
}
#result-image {
  width: 100%;
  display: block;
  aspect-ratio: 4/5;
  object-fit: cover;
}

#result-title {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff, #cffafe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.result-desc-panel {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}
#result-desc {
  font-size: 1.4rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.6;
  margin: 0;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}
.result-actions button {
  width: 100%;
  max-width: 320px;
}

/* Buttons */
.btn-primary, .btn-secondary {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-height: 52px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 25px rgba(0,0,0,0.3);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.6);
}

/* Utilities */
.hidden { display: none !important; }

.error-banner {
  background: rgba(239, 68, 68, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 14px 20px;
  text-align: center;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .large-card {
    padding: 32px 20px;
  }
}

@media (max-width: 600px) {
  .result-actions { flex-direction: column; width: 100%; }
  .btn-primary, .btn-secondary { width: 100%; }
  
  .layout-wrapper {
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  }
}

/* Submit loading state element */
.loading-state {
  text-align: center;
  padding: 24px 16px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

#wbx-powered-by-slot {
  margin-top: 24px;
  width: 100%;
}
