/* AERORELAY — design system (ported 1:1 from the in-house gateway design language) */

:root {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --muted-foreground: #a3a3a3;
  --border: rgba(255, 255, 255, .1);
  --card: rgba(23, 23, 23, .9);
  --ring: rgba(255, 255, 255, .18);
  --destructive: #ef4444;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============ landing section ============ */

.landing-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
}

.noise-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: .03;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.5rem;
  pointer-events: none;
}

.hero-content a, .hero-content button { pointer-events: auto; }

.hero-logo { margin-bottom: 2rem; }

.hero-title {
  margin: 0 0 1rem;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
  color: var(--foreground);
}

.hero-subtitle {
  margin: 0 0 2.5rem;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--muted-foreground);
}

@media (min-width: 768px) {
  .hero-title { font-size: 4.5rem; }
  .hero-subtitle { font-size: 1.5rem; }
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  padding: 0 2rem;
  border-radius: .5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .3s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-light {
  background: #f8f8f8;
  color: #0a0a0a;
}

.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(255, 255, 255, .15);
}

.btn-ghost {
  background: rgba(10, 10, 10, .5);
  color: var(--foreground);
  border-color: rgba(255, 255, 255, .18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .3);
}

.scroll-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translate(-50%);
  z-index: 10;
  background: none;
  border: 0;
  padding: .75rem;
  cursor: pointer;
  color: var(--muted-foreground);
  display: block;
}

.scroll-hint:hover { color: var(--foreground); }

/* ============ auth page ============ */

.auth-section {
  position: relative;
  display: flex;
  height: 100vh;
  height: 100dvh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
}

.auth-bg {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.theme-corner {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .375rem;
  background: rgba(23, 23, 23, .6);
  border: 1px solid var(--border);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color .15s ease;
}

.icon-btn:hover { background: rgba(255, 255, 255, .08); }

.auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 28rem;
  max-height: 100%;
  overflow-y: auto;
  border-radius: .75rem;
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .6);
  padding: 1.5rem;
}

.auth-card .card-logo {
  pointer-events: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  height: 5rem;
  width: auto;
  opacity: .15;
  color: #fff;
}

.auth-head { margin-bottom: 1.5rem; }

.auth-title {
  margin: 0 0 .5rem;
  font-size: 1.5rem;
  font-weight: 700;
  font-style: italic;
}

.auth-desc {
  margin: 0;
  font-size: .875rem;
  color: var(--muted-foreground);
}

.field { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }

.field label { font-size: .875rem; font-weight: 500; }

.input {
  width: 100%;
  height: 2.5rem;
  padding: 0 .75rem;
  border-radius: .5rem;
  border: 1px solid var(--border);
  background: rgba(10, 10, 10, .55);
  color: var(--foreground);
  font-size: .9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.input::placeholder { color: #525252; }

.input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}

.btn-submit {
  width: 100%;
  height: 2.5rem;
  border: 0;
  border-radius: .5rem;
  background: #e5e5e5;
  color: #0a0a0a;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease;
  margin-top: .25rem;
}

.btn-submit:hover:not(:disabled) { background: #fff; }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

.btn-outline {
  width: 100%;
  height: 2.5rem;
  border-radius: .5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease;
}

.btn-outline:hover { background: rgba(255, 255, 255, .06); }

.divider {
  position: relative;
  margin: 1.5rem 0;
}

.divider .line {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.divider .line span {
  width: 100%;
  border-top: 1px solid var(--border);
}

.divider .label {
  position: relative;
  display: flex;
  justify-content: center;
  font-size: .75rem;
  text-transform: uppercase;
}

.divider .label span {
  background: #161616;
  padding: 0 .5rem;
  color: var(--muted-foreground);
}

.form-error {
  display: none;
  margin: .75rem 0 0;
  font-size: .875rem;
  color: var(--destructive);
}

.form-error.show { display: block; }

.spinner {
  margin-right: .5rem;
  width: 1rem;
  height: 1rem;
  animation: spin 1s linear infinite;
  display: none;
}

.btn-submit.loading .spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ animations (verbatim from design system) ============ */

@keyframes logo-path-draw {
  0% { stroke-dashoffset: 3000; fill-opacity: 0 }
  60% { stroke-dashoffset: 0; fill-opacity: 0 }
  to { stroke-dashoffset: 0; fill-opacity: 1 }
}

.animated-logo-path {
  stroke-dasharray: 3000;
  stroke-dashoffset: 3000;
  fill-opacity: 0;
  animation: logo-path-draw 2s cubic-bezier(.4, 0, .2, 1) forwards;
}

.animated-logo-path-1 { animation-delay: 0s }
.animated-logo-path-2 { animation-delay: .2s }
.animated-logo-path-3 { animation-delay: .4s }

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(20px) }
  to { opacity: 1; transform: none }
}

@keyframes fade-in-scale {
  0% { opacity: 0; transform: scale(.8) }
  to { opacity: 1; transform: scale(1) }
}

@keyframes fade-in {
  0% { opacity: 0 }
  to { opacity: 1 }
}

.animate-fade-in-up { animation: fade-in-up .6s ease-out forwards; opacity: 0 }
.animate-fade-in-scale { animation: fade-in-scale .8s ease-out forwards; opacity: 0 }
.animate-fade-in { animation: fade-in .5s ease-out forwards; opacity: 0 }

.animation-delay-300 { animation-delay: .3s }
.animation-delay-500 { animation-delay: .5s }
.animation-delay-900 { animation-delay: .9s }
.animation-delay-1500 { animation-delay: 1.5s }

@keyframes bounce-y {
  0%, to { transform: translateY(0) }
  50% { transform: translateY(8px) }
}

.animate-bounce-y { animation: bounce-y 2s ease-in-out infinite }

@keyframes shake {
  0%, to { transform: translate(0) }
  25% { transform: translate(3px) }
  75% { transform: translate(-3px) }
}

.animate-shake { animation: shake .1s ease-in-out infinite }

@media (prefers-reduced-motion: reduce) {
  .animated-logo-path { animation-duration: .01s }
  .animate-fade-in-up, .animate-fade-in-scale, .animate-fade-in { animation-duration: .01s }
  .animate-bounce-y { animation: none }
}
