/*
 * Cinematic phone/OTP auth — mirrors mobile/app/index.tsx + verify.tsx.
 * Teal base (#011F1F) with green CTA (#00B388), photo montage under a
 * three-stop gradient, content anchored to the bottom.
 */
:root {
  --auth-bg: #011f1f;
  --auth-accent: #00b388;
  --auth-ink: #042018;
  --auth-cream: #eeede7;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body.auth {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--auth-bg);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  overflow: hidden;
}

.auth-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* Ken Burns montage */
.montage {
  position: absolute;
  inset: 0;
}
.montage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1600ms cubic-bezier(0.45, 0, 0.55, 1);
  will-change: opacity, transform;
}
.montage-img.active {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .montage-img {
    transition: none;
    transform: scale(1.05) !important;
  }
}

.auth-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(1, 20, 20, 0.15) 0%,
    rgba(1, 20, 20, 0.55) 45%,
    rgba(1, 20, 20, 0.97) 100%
  );
}

.auth-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 24px max(56px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
}

.auth-brand {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin: 0 0 8px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.auth-sub {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 22px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.auth-field {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 16px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #fff;
  font-family: inherit;
}
.auth-input::placeholder {
  color: rgba(238, 237, 231, 0.5);
}
.auth-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
}
.auth-input.code {
  font-size: 24px;
  text-align: center;
  letter-spacing: 0;
}
.auth-input.code.filled {
  letter-spacing: 10px;
}
.auth-field-spinner {
  position: absolute;
  right: 16px;
}

.auth-btn {
  margin-top: 12px;
  background: var(--auth-accent);
  color: var(--auth-ink);
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}
.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.auth-link {
  margin-top: 16px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--auth-accent);
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
}

.auth-back {
  position: absolute;
  left: 16px;
  top: max(16px, env(safe-area-inset-top));
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(238, 237, 231, 0.2);
  color: var(--auth-cream);
  font-size: 20px;
  cursor: pointer;
  text-decoration: none;
}

.auth-alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}
.auth-alert-error {
  background: rgba(217, 122, 108, 0.22);
  color: #ffd9d1;
  border: 1px solid rgba(217, 122, 108, 0.5);
}
.auth-alert-info {
  background: rgba(0, 179, 136, 0.16);
  color: #b9f4e3;
  border: 1px solid rgba(0, 179, 136, 0.4);
}
.hidden {
  display: none !important;
}

/* In-field / button spinner */
.dots {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(0, 179, 136, 0.3);
  border-top-color: var(--auth-accent);
  animation: authspin 0.8s linear infinite;
}
@keyframes authspin {
  to {
    transform: rotate(360deg);
  }
}
