/* Premium Base Styles - Top-tier UX/UI Best Practices */

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

/* Smooth scrolling with momentum */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #81CCCF;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.container {
  background: #81CCCF;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Background decoration */
.container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  animation: bgFloat 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, 2%) rotate(1deg); }
  66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

/* ===== LOGO STYLES ===== */
.logo {
  margin: 40px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: logoFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.logo img,
.logo svg {
  max-width: 100%;
  height: auto;
  width: 280px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover img,
.logo:hover svg {
  transform: scale(1.03);
}

@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Logo path tracing animation */
.logo-animated {
  position: relative;
}

.logo-animated svg {
  overflow: visible;
}

.logo-path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawLogoPath 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes drawLogoPath {
  0% {
    stroke-dashoffset: 600;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* Logo glow effect */
.logo-glow {
  position: relative;
}

.logo-glow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  opacity: 0;
  animation: logoGlow 3s ease-in-out 2s infinite;
  pointer-events: none;
}

@keyframes logoGlow {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.1); }
}

/* Logo float animation */
.logo-float {
  animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== TYPOGRAPHY ===== */
h1 {
  color: white;
  font-size: 48px;
  font-weight: 400;
  margin-bottom: 30px;
  letter-spacing: -1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Only animate on non-hero pages */
body:not(.hero-page) h1 {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s backwards;
}

p {
  color: white;
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 20px;
  opacity: 0.95;
  font-weight: 300;
}

/* Only animate on non-hero pages */
body:not(.hero-page) p {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

/* ===== MAIN BUTTON - ENHANCED UX ===== */
.main-button {
  background: white;
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 20px 60px;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  margin-top: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60px;
  position: relative;
  overflow: hidden;
}

/* Only animate on non-hero pages */
body:not(.hero-page) .main-button {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

/* Ripple effect */
.main-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.main-button:active::before {
  width: 350px;
  height: 350px;
}

.main-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  background: #f8f8f8;
}

.main-button:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

.main-button:focus {
  outline: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 4px rgba(255, 255, 255, 0.25);
}

/* Button arrow animation */
.main-button .arrow {
  transition: transform 0.3s ease;
}

.main-button:hover .arrow {
  transform: translateX(4px);
}

/* Button loading state */
.main-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== VK BUTTON ===== */
.btn {
  background: white;
  color: #333;
  border: none;
  border-radius: 25px;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  width: auto;
  min-width: 200px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
  width: 350px;
  height: 350px;
}

.btn:hover {
  background: #f8f8f8;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  background: #e8e8e8;
  color: #999;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== LOADER ===== */
.loader {
  display: none;
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 20px auto;
}

.loader.active {
  display: block;
}

/* Premium loader */
.loader-premium {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: relative;
}

.loader-premium::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border: 2px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: spin 0.8s linear infinite reverse;
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== FOCUS STATES FOR ACCESSIBILITY ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}

/* ===== SMOOTH TRANSITIONS FOR INTERACTIVE ELEMENTS ===== */
a, button, input, select {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TOUCH TARGET IMPROVEMENTS ===== */
@media (pointer: coarse) {
  button,
  a {
    min-height: 48px;
    min-width: 48px;
  }
}

/* ===== REDUCED MOTION FOR ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== SKELETON LOADING STATE ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.08) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 10px;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ===== ERROR STATES ===== */
.error-message {
  color: #fff;
  font-size: 14px;
  margin-top: 10px;
  animation: fadeIn 0.3s ease-out;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.input-error {
  border-color: #ff6b6b !important;
  animation: shake 0.4s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ===== SUCCESS STATES ===== */
.success-message {
  color: #fff;
  font-size: 14px;
  margin-top: 10px;
  animation: fadeIn 0.3s ease-out;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ===== INPUT STYLES ===== */
input, select, textarea {
  font-family: inherit;
  font-size: 16px;
  padding: 16px 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: all 0.3s ease;
  width: 100%;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

/* ===== CARD STYLES ===== */
.card {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* ===== LINK STYLES ===== */
a {
  color: white;
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: white;
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ===== SELECTION STYLING ===== */
::selection {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* ===== SPARKLE PARTICLES ===== */
.sparkle-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

@keyframes sparkleParticle {
  0% { opacity: 0; transform: scale(0); }
  50% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(0); }
}
