@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/SourceSansPro-Regular.ttf');
}

html,
body {
  width: 100%;
  height: 100%;
  font-family:
    Source Sans Pro,
    sans-serif;
}

body {
  background: linear-gradient(to top right, #18c9fa4d 30%, #f4f6fd 70%);
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Futuristic puzzle theme */
body.puzzle {
  background: radial-gradient(1200px 800px at 80% -10%, #0ff2 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, #0ff2 0%, transparent 55%),
    linear-gradient(180deg, #0b0f1a 0%, #0a0e18 100%);
  color: #d9e1ff;
}

.neon-frame {
  position: relative;
  border: 1px solid #1a2b4f;
  border-radius: 14px;
  background: linear-gradient(180deg, #0f1626 0%, #0b1322 100%);
  box-shadow:
    0 0 0 1px #0d1e3d inset,
    0 0 60px 0 #0ff1,
    0 0 120px 0 #5ef2ff12;
}

.scanline {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    #0ff1 3px
  );
  pointer-events: none;
  mix-blend-mode: screen;
}

.glow-text {
  color: #e6f0ff;
  text-shadow: 0 0 12px #34d6ff, 0 0 36px #34d6ff66;
}

.accent {
  color: #34d6ff;
}

.btn-primary {
  background: linear-gradient(90deg, #0d6efd 0%, #34d6ff 100%);
  color: #fff;
  border: 0;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px #0d6efd44, 0 0 0 1px #1a2b4f inset;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px #0d6efd55, 0 0 0 1px #24406f inset;
}

.input-control {
  width: 100%;
  padding: 12px 14px;
  background: #0a1222;
  border: 1px solid #1a2b4f;
  border-radius: 10px;
  color: #e6f0ff;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.input-control:focus {
  border-color: #34d6ff;
  box-shadow: 0 0 0 3px #34d6ff22, 0 0 0 1px #34d6ff inset;
}

.error {
  color: #ff6b8b;
}

.hint {
  color: #97a8c9;
  font-size: 13px;
}

.mail-card {
  border: 1px solid #1a2b4f;
  border-radius: 12px;
  background: #0c1426;
  padding: 16px;
}

.mail-meta {
  font-size: 12px;
  color: #97a8c9;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 12px;
}

.wrap {
  max-width: 920px;
  margin: 40px auto;
  padding: 0 16px;
}

a {
  color: #2bcbdf;
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-grow: 1;
}

main > section {
  display: flex;
  flex-direction: column;
  margin: auto;
  width: 940px;
  gap: 64px;
}

.title {
  color: #333;
  font-weight: 600;
  margin: 0;
  margin-block-start: 0;
  margin-block-end: 0;
}

h1 {
  font-size: 58px;
}

h2 {
  font-size: 20px;
}

.header-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1em;
  padding: 0 2em;
}

.header-container > img {
  height: 24px;
  width: auto;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(1, 1fr);
  gap: 32px;
  padding: 0 2em;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  background-color: white;
  border-radius: 8px;
  padding: 40px;
}

.card > .icon {
  width: 60px;
  height: 60px;
}

.card > .card-content {
  color: #666;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

footer {
  color: #1a1a1a;
  padding: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

@media screen and (max-width: 1024px) {
  main > section {
    width: 100%;
  }

  .card {
    flex-direction: row;
    height: fit-content;
  }

  .cards-container {
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  html, body {
    height: auto;
    width: 100%;
  }

  .header-container > img {
    height: auto;
    width: 100%;
  }

  main {
    padding-top: 2em;
  }

  .card {
    flex-direction: column;
  }
}

img {
  pointer-events: none;
}

/* Error animation for wrong answers */
.error-animation {
  animation: errorFlash 0.5s ease-in-out 3;
}

@keyframes errorFlash {
  0% {
    background: #0b1322;
    box-shadow: 0 0 0 1px #0d1e3d inset, 0 0 60px 0 #0ff1, 0 0 120px 0 #5ef2ff12;
  }
  25% {
    background: #1a0f0f; /* Softer red */
    box-shadow: 0 0 0 1px #ff4444 inset, 0 0 40px 0 #ff4444, 0 0 80px 0 #ff444420;
  }
  50% {
    background: #0f1a0f; /* Even softer red */
    box-shadow: 0 0 0 1px #ff6666 inset, 0 0 30px 0 #ff6666, 0 0 60px 0 #ff666615;
  }
  75% {
    background: #1a0f0f;
    box-shadow: 0 0 0 1px #ff4444 inset, 0 0 40px 0 #ff4444, 0 0 80px 0 #ff444420;
  }
  100% {
    background: #0b1322;
    box-shadow: 0 0 0 1px #0d1e3d inset, 0 0 60px 0 #0ff1, 0 0 120px 0 #5ef2ff12;
  }
}

.error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 68, 68, 0.1);
  pointer-events: none;
  z-index: 1000;
  animation: errorOverlay 0.5s ease-in-out 3;
  animation-fill-mode: forwards;
}

@keyframes errorOverlay {
  0% { opacity: 0; }
  25%, 75% { opacity: 1; }
  100% { opacity: 0; }
}

.screen-shake {
  animation: screenShake 0.5s ease-in-out 3;
}

@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Success animation for correct answers */
.success-animation {
  animation: successFlash 0.8s ease-in-out 2;
}

@keyframes successFlash {
  0% {
    background: #0b1322;
    box-shadow: 0 0 0 1px #0d1e3d inset, 0 0 60px 0 #0ff1, 0 0 120px 0 #5ef2ff12;
  }
  25% {
    background: #0f1a0f; /* Greenish */
    box-shadow: 0 0 0 1px #00ff88 inset, 0 0 50px 0 #00ff88, 0 0 100px 0 #00ff8820;
  }
  50% {
    background: #0a1a0f; /* Darker greenish */
    box-shadow: 0 0 0 1px #44ff88 inset, 0 0 40px 0 #44ff88, 0 0 80px 0 #44ff8815;
  }
  75% {
    background: #0f1a0f;
    box-shadow: 0 0 0 1px #00ff88 inset, 0 0 50px 0 #00ff88, 0 0 100px 0 #00ff8820;
  }
  100% {
    background: #0b1322;
    box-shadow: 0 0 0 1px #0d1e3d inset, 0 0 60px 0 #0ff1, 0 0 120px 0 #5ef2ff12;
  }
}

.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 255, 136, 0.1);
  pointer-events: none;
  z-index: 1000;
  animation: successOverlay 0.8s ease-in-out 2;
  animation-fill-mode: forwards;
}

@keyframes successOverlay {
  0% { opacity: 0; }
  25%, 75% { opacity: 1; }
  100% { opacity: 0; }
}

.success-pulse {
  animation: successPulse 0.8s ease-in-out 2;
}

@keyframes successPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* SMS/WhatsApp message styles */
.sms-container {
  background: #0a0e18;
  border-radius: 12px;
  padding: 16px;
  margin: 16px auto;
  border: 1px solid #1a2b4f;
  position: relative;
  max-width: 400px;
  width: 100%;
}

.sms-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #97a8c9;
}

.sms-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(45deg, #34d6ff, #0ff1);
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #0a0e18;
  font-size: 10px;
}

.sms-name {
  font-weight: 600;
  color: #34d6ff;
}

.sms-time {
  margin-left: auto;
  font-size: 10px;
  color: #97a8c9;
}

.sms-message {
  color: #e6f0ff;
  line-height: 1.4;
  font-size: 14px;
  margin: 0;
}

.sms-bubble {
  background: linear-gradient(135deg, #1a2b4f 0%, #0f1626 100%);
  border-radius: 8px;
  padding: 12px;
  position: relative;
  border: 1px solid #2a3f5f;
}

.sms-bubble::before {
  content: '';
  position: absolute;
  top: 8px;
  right: -6px;
  width: 0;
  height: 0;
  border-left: 6px solid #1a2b4f;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* Responsive adjustments for SMS */
@media screen and (max-width: 768px) {
  .sms-container {
    max-width: 100%;
    margin: 16px 0;
  }
}