/* Main Shared Styles - Card, Background, Content */

:root {
  --bg: #020617;
  --bg-secondary: #0b1120;
  --accent: #22d3ee;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-strong: #22c55e;
  --danger: #fb7185;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(30, 64, 175, 0.9);
  --shadow-deep: 0 26px 70px rgba(15, 23, 42, 0.95);
  --shadow-card: 0 8px 32px rgba(15, 23, 42, 0.6);
}

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

html {
  height: 100%;
  background: #020617;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: #020617;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
  overflow-x: hidden;
}

.grid-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.16;
  background-image: linear-gradient(
      rgba(30, 64, 175, 0.2) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(30, 64, 175, 0.2) 1px,
      transparent 1px
    );
  background-size: 42px 42px;
  mask-image: radial-gradient(
    circle at top,
    #000 0,
    #000 45%,
    transparent 90%
  );
  z-index: -1;
}

.wrapper {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  width: 100%;
  padding: 0 20px;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 40px;
  padding: 40px 32px 0;
  border-radius: 2.4rem;
  background: #020617;
  border: 1px solid rgba(30, 64, 175, 0.9);
  box-shadow: var(--shadow-deep);
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Desktop: Full-width header layout */
@media (min-width: 901px) {
  .card {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 0;
    padding: 40px 0 0;
  }
  
  .card.email-card {
    padding: 40px 0 0;
  }
  
  .card-header {
    grid-column: 1 / -1;
    padding: 0 48px 40px 48px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.3);
    margin-bottom: 0;
  }
  
  .card.email-card .card-header {
    padding: 0 48px 40px 48px;
  }
  
  .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    background: radial-gradient(circle at top, #0b1120 0, #020617 40%, #020617 100%);
    background-size: 100% 100%;
    background-position: top center;
    background-repeat: no-repeat;
    border-radius: 0 0 2.4rem 2.4rem;
    padding: 40px 48px 48px 48px;
    margin: 0;
    width: 100%;
  }
  
  .card.email-card .card-body {
    background: radial-gradient(circle at top, #0b1120 0, #020617 40%, #020617 100%);
    background-size: 100% 100%;
    background-position: top center;
    background-repeat: no-repeat;
    border-radius: 0 0 2.4rem 2.4rem;
    padding: 40px 48px 48px 48px;
  }
  
  .alert-box.full-width {
    width: 100%;
    max-width: 100%;
    margin-bottom: 32px;
  }
  
  .content-with-art {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }
  
  .content-main {
    min-width: 0;
    padding-right: 32px;
    max-width: 100%;
  }
  
  .art {
    grid-column: 2;
    align-self: start;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    position: sticky;
    top: 20px;
    overflow: visible;
    justify-self: start;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
  }
  
  .common-attacks {
    margin-top: 32px;
  }
}

.card::before {
  content: "";
  position: absolute;
  inset: -140px;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.35), transparent 55%),
    radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.22), transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

/* Desktop improvements */
@media (min-width: 1200px) {
  .card {
    padding: 48px 0 0;
    max-width: 1600px;
  }
  
  .card.email-card {
    padding: 48px 0 0;
  }
  
  .card-header {
    padding-bottom: 40px;
    margin-bottom: 48px;
  }
  
  .content-with-art {
    gap: 56px;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  }
  
  .content-main {
    padding-right: 40px;
    max-width: 900px;
  }
  
  .art {
    max-width: 100%;
    justify-self: start;
    width: 100%;
  }
  
  .alert-box.full-width {
    margin-bottom: 40px;
  }
  
  .common-attacks {
    margin-top: 40px;
    padding: 28px 32px 32px;
  }
  
  .footer {
    margin-top: 56px;
    padding: 40px 0;
  }
}

@media (max-width: 900px) {
  .wrapper {
    padding: 0 16px;
  }
  
  .card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    padding: 26px 18px 22px;
    border-radius: 1.8rem;
    gap: 24px;
  }
  
  .card-header {
    padding: 0 18px 20px 18px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.3);
    margin-bottom: 0;
    text-align: center;
  }
  
  .card {
    padding: 26px 0 0;
  }
  
  .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle at top, #0b1120 0, #020617 40%, #020617 100%);
    background-size: 100% 100%;
    background-position: top center;
    background-repeat: no-repeat;
    border-radius: 0 0 1.8rem 1.8rem;
    padding: 24px 18px 22px;
    margin: 0;
    width: 100%;
  }
  
  .alert-box.full-width {
    width: 100%;
    margin-bottom: 24px;
  }
  
  .content-with-art {
    display: block;
    width: 100%;
    gap: 0;
  }
  
  .content-main {
    padding-right: 0;
    width: 100%;
  }
  
  .art {
    position: relative;
    top: 0;
    margin-top: 24px;
    justify-self: center;
    width: 100%;
  }
  
  .common-attacks {
    margin-top: 28px;
  }
  
  .footer {
    margin-top: 32px;
    padding: 24px 16px;
  }
  
  .footer-note {
    max-width: 100%;
  }
  
  h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 12px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.02em;
  }
  
  h1 br {
    display: block;
  }
  
  .info-section {
    margin-bottom: 24px;
  }
  
  .info-text {
    font-size: 1rem;
    color: #cbd5e1;
  }
  
}

/* LEFT: content */
.content {
  position: relative;
  z-index: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background: radial-gradient(circle at top left, #0b1120, #020617);
  color: #e0f2fe;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.9);
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  line-height: 1.15;
  margin-top: 20px;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}

/* Hide line breaks on desktop */
h1 br {
  display: none;
}

.headline-highlight {
  background: linear-gradient(120deg, #22d3ee, #22c55e);
  -webkit-background-clip: text;
  color: transparent;
}

.subhead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 100%;
  line-height: 1.75;
  margin-bottom: 24px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Info section - moved from header */
.info-section {
  margin-bottom: 28px;
}

.info-text {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.75;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 1.2rem;
  border: 1px solid rgba(248, 113, 113, 0.8);
  padding: 16px 18px 18px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.alert-box::before {
  content: "";
  position: absolute;
  inset: -60px;
  background: radial-gradient(
    circle at top left,
    rgba(248, 113, 113, 0.35),
    transparent 60%
  );
  opacity: 0.8;
  pointer-events: none;
}

.alert-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--danger);
  box-shadow: 0 0 18px rgba(248, 113, 113, 0.8);
  background: radial-gradient(circle at top, #111827, #020617);
  flex-shrink: 0;
  animation: pulse-glow 2s ease-in-out infinite;
}

.alert-text-title {
  position: relative;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fecaca;
  margin-bottom: 3px;
}

.alert-text-body {
  position: relative;
  font-size: 0.86rem;
  color: #fee2e2;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.steps {
  margin-top: 10px;
}

.steps-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 8px;
}

.steps-list {
  list-style: none;
  display: grid;
  gap: 12px;
  font-size: 1rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.step strong {
  font-weight: 600;
}

.step span {
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
}

/* Common attacks section (renamed from qr-section) */
.common-attacks {
  margin-top: 32px;
  border-radius: 1.4rem;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background: radial-gradient(circle at top left, #020617, #020617 50%);
  padding: 24px 28px 28px;
  position: relative;
  overflow: hidden;
}

.common-attacks::before {
  content: "";
  position: absolute;
  inset: -80px;
  background: radial-gradient(
    circle at top right,
    rgba(56, 189, 248, 0.25),
    transparent 60%
  );
  opacity: 0.9;
  pointer-events: none;
}

.common-attacks-body {
  position: relative;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.65;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.common-attacks-list {
  position: relative;
  list-style: none;
  display: grid;
  gap: 12px;
  font-size: 0.9rem;
}

.common-attacks-item {
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
  list-style: none;
  position: relative;
  padding-left: 0;
}

/* Legacy qr-section styles for backward compatibility */
.qr-section {
  margin-top: 24px;
  border-radius: 1.4rem;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background: radial-gradient(circle at top left, #020617, #020617 50%);
  padding: 24px 28px 28px;
  position: relative;
  overflow: hidden;
}

.qr-section::before {
  content: "";
  position: absolute;
  inset: -80px;
  background: radial-gradient(
    circle at top right,
    rgba(56, 189, 248, 0.25),
    transparent 60%
  );
  opacity: 0.9;
  pointer-events: none;
}

.qr-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.qr-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  color: #0b1120;
}

.qr-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.qr-chip {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.7);
  color: #e0f2fe;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.qr-body {
  position: relative;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.65;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.qr-list {
  position: relative;
  list-style: none;
  display: grid;
  gap: 12px;
  font-size: 0.9rem;
}

.qr-item {
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
  list-style: none;
  position: relative;
  padding-left: 0;
}

.tiny-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tiny-note span {
  color: var(--accent-strong);
  font-weight: 500;
}

/* Footer */
.footer {
  margin-top: 48px;
  width: 100%;
  max-width: 1600px;
  padding: 32px 0;
  border-top: 1px solid rgba(30, 64, 175, 0.3);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-note {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 800px;
  margin: 0 auto;
}

.footer-note br {
  display: block;
  content: "";
  margin-top: 0.5em;
}

.footer-note span {
  color: var(--accent-strong);
  font-weight: 500;
}

/* RIGHT: fun background art */
.art {
  position: relative;
  z-index: 1;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.art-inner {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 300px;
  border-radius: 2rem;
  overflow: visible;
  flex-shrink: 0;
}

/* QR page art container - larger for phone */
.art-inner.qr-art {
  max-width: 320px;
  min-height: 450px;
  height: 450px;
}

/* Snow Effect (shared) */
.snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10px;
  color: #ffffff;
  font-size: 1em;
  font-family: Arial, sans-serif;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
  animation: snowfall linear infinite;
  opacity: 0.8;
}

@keyframes snowfall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(100vh) translateX(var(--drift)) rotate(360deg);
    opacity: 0;
  }
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.9);
  }
  50% {
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.4);
  }
  100% {
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.9);
  }
}

/* Desktop improvements */
@media (min-width: 1200px) {
  h1 {
    font-size: 3.2rem;
    text-align: center;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.2;
  }
  
  h1 br {
    display: none;
  }
  
  .info-section {
    margin-bottom: 32px;
  }
  
  .info-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d1d5db;
  }
  
  .steps-list {
    gap: 14px;
  }
  
  .step {
    gap: 14px;
  }
  
  .step span {
    line-height: 1.7;
  }
}

/* Mobile tweaks for smaller devices */
@media (max-width: 700px) {
  body {
    padding: 16px 10px;
  }
  
  .wrapper {
    padding: 0 10px;
  }
  
  .card {
    padding: 20px 0 0;
    border-radius: 1.6rem;
  }
  
  .card-header {
    padding: 0 16px 20px 16px;
  }
  
  .card-body {
    padding: 24px 16px 20px 16px;
    border-radius: 0 0 1.6rem 1.6rem;
  }
  
  .alert-box.full-width {
    padding: 14px 14px 16px;
    margin-bottom: 24px;
  }
  
  .alert-text-title {
    font-size: 0.86rem;
  }
  
  .alert-text-body {
    font-size: 0.82rem;
  }
  
  h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    text-align: center;
    margin-top: 14px;
    margin-bottom: 10px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.02em;
  }
  
  h1 br {
    display: block;
  }
  
  .info-text {
    font-size: 0.95rem;
  }
  
  .steps-list {
    gap: 14px;
    font-size: 0.92rem;
  }
  
  .step-index {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
  }
  
  .common-attacks {
    padding: 18px 16px 20px;
  }
  
  .common-attacks-body {
    font-size: 0.86rem;
  }
  
  .common-attacks-list {
    gap: 12px;
    font-size: 0.86rem;
  }
  
  .art-inner {
    height: 240px;
    max-width: 300px;
  }
  
  .art-inner.qr-art {
    max-width: 280px;
    min-height: 400px;
    height: 400px;
  }
  
  .footer {
    margin-top: 32px;
    padding: 24px 16px;
  }
  
  .footer-note {
    font-size: 0.84rem;
  }
}
