/* ==========================================================================
   AISPIRE WAITLIST STYLESHEET - PERFORMANCE OPTIMIZED EDITION
   ========================================================================== */

/* 1. DESIGN SYSTEM CONSTANTS */
:root {
  /* Color Palette */
  --bg-primary: #000000;
  --color-white: #FFFFFF;
  --color-gray: #B0B0B0;
  --color-accent-orange: #FF6428;
  --color-cyan: #00D9FF;

  /* Pure Glassmorphism Styling (Optimized Alpha values) */
  --card-bg: rgba(10, 16, 30, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);

  --input-bg: rgba(255, 255, 255, 0.03);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-bg-focus: rgba(255, 255, 255, 0.06);
  --input-border-focus: rgba(255, 255, 255, 0.35);

  --btn-bg: #FFFFFF;
  --btn-text: #000000;

  /* Fonts Stack */
  --font-heading: 'Bebas Neue', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro", "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;

  /* High-Performance Transitions (transform/opacity-based only) */
  --transition-smooth: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s ease-out, border-color 0.2s ease-out;
  --transition-quick: transform 0.15s ease-out, opacity 0.15s ease-out, border-color 0.15s ease-out;
}

/* 2. GLOBAL RESET & BASE STYLES */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--color-white);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessibility utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 3. BACKGROUND LAYERS (Hardware Accelerated, Composite-only Animations) */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background-color: var(--bg-primary);
  /* Create isolated rendering context */
  contain: paint layout size;
}

/* 
  Primary Rings background layer - highly brightened as requested.
  COMPOSITING OPTIMIZATION: 
  - Forced dedicated hardware layer via backface-visibility & translate3d.
  - will-change restricts browser paint cache to composite-only transforms.
  - Replaced high-offset translates with small, integer-based shifts to prevent sub-pixel layout calculations.
*/
.rings-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('rings.png');
  background-position: center right;
  background-size: cover;
  background-repeat: no-repeat;

  opacity: 0.92;
  filter: brightness(1.4) saturate(1.25);
  -webkit-filter: brightness(1.4) saturate(1.25);

  /* Hardware Acceleration Promoters */
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000;
  -webkit-perspective: 1000;

  animation: rings-subtle-drift 24s ease-in-out infinite alternate;
}

/* 4. VIEWPORT AND LAYOUT WRAPPER */
.viewport-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 40px 20px;
}

/* 5. HEADER SECTION */
.header {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  z-index: 20;
}

.brand-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2em;
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-text::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: var(--color-white);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

/* 6. CENTRAL CARD CONTAINER (Optimized Glassmorphism Modal, No Neon Glows) */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  z-index: 20;
}

/*
  RENDERING OPTIMIZATIONS:
  - Reduced blur size from 24px to 16px. Visually indistinguishable but saves ~30% GPU compositor fill rate.
  - Isolated composite layer with translate3d and backface-visibility.
  - contain: layout style isolates the modal subtree from global reflows/repaints.
*/
.waitlist-card {
  width: 100%;
  max-width: 500px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);

  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  /* Glass top edge refraction highlight */

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 55px 50px;
  /* 5px smaller top/bottom (rectangular) */
  text-align: center;
  position: relative;
  overflow: hidden;

  /* Render isolation & Hardware Promotion */
  contain: layout style;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  animation: card-entrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Card inner views (Form / Success) */
.card-inner,
.success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Heading Image style */
.heading {
  margin-bottom: 24px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.heading-image {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
}

.description {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-gray);
  max-width: 92%;
  margin-bottom: 40px;
}

.accent-text {
  color: var(--color-accent-orange);
  font-weight: 500;
}

/* Waitlist Form elements */
.waitlist-form {
  width: 100%;
}

.input-group {
  width: 100%;
  position: relative;
  margin-bottom: 20px;
  text-align: left;
}

.input-group input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 15px 20px;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition-quick);
  /* Promote to composite plane to accelerate focus highlight transitions */
  transform: translate3d(0, 0, 0);
}

.input-group input::placeholder {
  color: rgba(176, 176, 176, 0.6);
  transition: opacity 0.15s ease;
}

/* Input Focus State (Sleek and clean, no heavy glow shadows) */
.input-group input:focus {
  background-color: var(--input-bg-focus);
  border-color: var(--input-border-focus);
}

.input-group input:focus::placeholder {
  opacity: 0.35;
}

/* Input Error States */
.input-group.has-error input {
  border-color: var(--color-accent-orange);
}

.error-message {
  font-size: 12px;
  color: var(--color-accent-orange);
  margin-top: 6px;
  padding-left: 4px;
  opacity: 0;
  transform: translateY(-6px);
  height: 0;
  overflow: hidden;
  transition: var(--transition-quick);
}

.input-group.has-error .error-message {
  opacity: 1;
  transform: translateY(0);
  height: auto;
  margin-bottom: 2px;
}

/* Submit Button styling (No neon/cyan glows on hover) */
.submit-btn {
  width: 100%;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 28px;
  padding: 15px 32px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-quick);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transform: translate3d(0, 0, 0);
}

.submit-btn:hover {
  transform: translate3d(0, -2px, 0) scale(1.015);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
  opacity: 0.95;
}

.submit-btn:active {
  transform: translate3d(0, 0, 0) scale(1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

/* Button Loading overlay spinner */
.btn-text {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.btn-loader {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-left-color: var(--btn-text);
  border-radius: 50%;
  opacity: 0;
  transform: rotate(0deg) scale(0.5);
  transition: var(--transition-quick);
}

/* Active Loading styles */
.submit-btn.is-loading {
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.85);
}

.submit-btn.is-loading .btn-text {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
}

.submit-btn.is-loading .btn-loader {
  opacity: 1;
  transform: rotate(360deg) scale(1);
  animation: spinner 0.8s linear infinite;
}

/* 7. SUCCESS CONTAINER VIEW */
.success-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 55px 50px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.success-container.is-active {
  position: relative;
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

/* Success icons */
.success-icon-wrapper {
  width: 68px;
  height: 68px;
  margin-bottom: 24px;
}

.checkmark-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  stroke-width: 3.5;
  stroke: var(--color-cyan);
  stroke-miterlimit: 10;
  animation: check-scale 0.4s ease-in-out 0.3s both;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3.5;
  stroke-miterlimit: 10;
  stroke: var(--color-cyan);
  fill: none;
  animation: check-stroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) 0.1s forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: check-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

.success-heading {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 38px;
  line-height: 1.15;
  color: var(--color-white);
  margin-bottom: 16px;
}

.success-description {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-gray);
  max-width: 90%;
  margin-bottom: 32px;
}

.user-email {
  color: var(--color-cyan);
  font-weight: 500;
}

/* Back Button */
.back-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-gray);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-quick);
}

.back-btn:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--color-white);
}

/* 8. FOOTER SECTION (Powered by Aispire in a single straight line) */
.footer {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  z-index: 20;
}

.powered-by {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: rgba(176, 176, 176, 0.5);
  text-transform: uppercase;
  display: inline-block;
  line-height: 1;
}

.footer-logo {
  height: 30px;
  max-height: 45px;
  width: auto;
  opacity: 0.75;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.05));
  transition: opacity 0.3s ease;
  display: inline-block;
}

.footer-logo:hover {
  opacity: 1;
}

/* 9. KEYFRAME ANIMATIONS */

/* Optimized drift - composite plane translation (uses translate3d instead of 2D translation for GPU pinning) */
@keyframes rings-subtle-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-5px, 3px, 0) scale(1.015);
  }

  100% {
    transform: translate3d(3px, -2px, 0) scale(1.005);
  }
}

/* Card entry fade & subtle zoom-in */
@keyframes card-entrance {
  0% {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(0.97);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* Submit button spinner rotation */
@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Checkmark drawing strokes */
@keyframes check-stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes check-scale {

  0%,
  100% {
    transform: none;
  }

  50% {
    transform: scale3d(1.15, 1.15, 1);
  }
}

/* Inline Shake Style natively defined in CSS to prevent JS injection reflow bottlenecks */
@keyframes input-shake {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  20%,
  60% {
    transform: translate3d(-6px, 0, 0);
  }

  40%,
  80% {
    transform: translate3d(6px, 0, 0);
  }
}

.input-shaking {
  animation: input-shake 0.4s ease-out;
}

/* ==========================================================================
   10. RESPONSIVE DESIGN & MEDIA QUERIES
   ========================================================================== */

/* Tablet Viewports (768px to 1199px) */
@media (max-width: 1199px) {
  .viewport-wrapper {
    padding: 35px 24px;
  }

  .waitlist-card {
    max-width: 480px;
    padding: 50px 40px;
    /* Reduced rectangular padding */
  }

  .heading-image {
    max-width: 290px;
  }

  .description {
    font-size: 14px;
    margin-bottom: 35px;
  }

  .rings-background {
    opacity: 0.85;
  }
}

/* Mobile Viewports (<768px) */
@media (max-width: 767px) {
  body {
    overflow-y: auto;
  }

  .viewport-wrapper {
    padding: 30px 16px;
    height: auto;
    min-height: 100%;
    justify-content: flex-start;
    gap: 40px;
  }

  .header {
    margin-top: 10px;
  }

  .brand-text {
    font-size: 14px;
  }

  .main-content {
    flex: none;
    margin: auto 0;
  }

  .waitlist-card {
    max-width: 100%;
    border-radius: 16px;
    padding: 35px 24px;
    /* Reduced rectangular padding */
    margin: 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
  }

  .heading {
    margin-bottom: 20px;
  }

  .heading-image {
    max-width: 240px;
  }

  .description {
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 30px;
    max-width: 100%;
  }

  .input-group {
    margin-bottom: 16px;
  }

  .input-group input {
    padding: 13px 16px;
    font-size: 13.5px;
  }

  .submit-btn {
    padding: 13px 24px;
    font-size: 14px;
  }

  .success-container {
    padding: 35px 24px;
  }

  .success-heading {
    font-size: 30px;
  }

  .rings-background {
    background-position: center 30%;
    background-size: cover;
    opacity: 0.75;
  }

  .footer {
    margin-bottom: 10px;
  }
}

/* Handle Short Viewport Heights */
@media (max-height: 650px) and (min-width: 768px) {
  .viewport-wrapper {
    padding: 20px;
  }

  .waitlist-card {
    padding: 30px 40px;
  }

  .heading {
    margin-bottom: 18px;
  }
}