/* ==========================================================================
   MOPPLSIA Core Design System — 60fps Apple Obsidian Glass & Motion
   ========================================================================== */

:root {
  --bg-pure-black: #000000;
  --bg-elevated: #08080a;
  --bg-surface: #0e0e12;
  --bg-card-glass: rgba(12, 12, 16, 0.72);
  --bg-input: rgba(255, 255, 255, 0.036);
  --bg-input-focus: rgba(255, 255, 255, 0.068);

  --text-white: #ffffff;
  --text-soft: #f5f5f7;
  --text-label: rgba(255, 255, 255, 0.86);
  --text-muted: rgba(255, 255, 255, 0.54);
  --text-subtle: rgba(255, 255, 255, 0.34);
  --text-placeholder: rgba(255, 255, 255, 0.25);

  --border-hairline: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.2);
  --border-focus: rgba(255, 255, 255, 0.44);

  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-sky: #60a5fa;
  --accent-rose: #ff6b6b;

  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-pure-black);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  background-color: var(--bg-pure-black);
  color: var(--text-white);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

::selection {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #040406;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   Ambient Background Layers (Pure Black + Subtle Micro-Stars + Soft Aura)
   ========================================================================== */

#particles-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

.bg-particles-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.11;
  background-image: radial-gradient(circle, #ffffff 1px, transparent 1px);
  background-size: 64px 64px;
}

.bg-ambient-aura {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(900px 460px at 50% -8%, rgba(255, 255, 255, 0.048), rgba(0, 0, 0, 0) 68%);
}

/* ==========================================================================
   Seamless Transparent-Feel Video Logo (Zero Box / Zero Edge)
   ========================================================================== */

.brand-video-seamless {
  position: relative;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
}

.brand-video-seamless video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
  filter: contrast(1.22) brightness(1.06);
  -webkit-mask-image: radial-gradient(ellipse 58% 58% at 50% 49%, #000000 38%, rgba(0, 0, 0, 0.55) 60%, transparent 88%);
  mask-image: radial-gradient(ellipse 58% 58% at 50% 49%, #000000 38%, rgba(0, 0, 0, 0.55) 60%, transparent 88%);
}

/* ==========================================================================
   Apple-Grade Obsidian Glass Card (GPU-Composited & Pointer Specular Rim)
   ========================================================================== */

.apple-glass-card {
  position: relative;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.78) 0%, rgba(7, 7, 10, 0.9) 100%);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  border: 1px solid var(--border-hairline);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.025) inset,
    0 1px 0 0 rgba(255, 255, 255, 0.14) inset,
    0 36px 96px -18px rgba(0, 0, 0, 0.95),
    0 14px 36px -10px rgba(0, 0, 0, 0.8);
  transform: translate3d(0, 0, 0);
  overflow: hidden;
  transition: transform 0.45s var(--ease-apple), border-color 0.35s ease;
}

@supports not (backdrop-filter: blur(28px)) {
  .apple-glass-card {
    background: rgba(14, 14, 18, 0.96);
  }
}

/* Top specular hairline */
.apple-glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16%;
  right: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  pointer-events: none;
  z-index: 2;
}

/* GPU-composited cursor-reactive specular sheen (animates opacity only) */
.apple-glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    520px circle at var(--mouse-x, 50%) var(--mouse-y, 20%),
    rgba(255, 255, 255, 0.055),
    transparent 45%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.apple-glass-card:hover::after {
  opacity: 1;
}

.apple-glass-card > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Buttons & Tactile Controls
   ========================================================================== */

.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 54px;
  padding: 0 1.75rem;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    0 0 28px rgba(255, 255, 255, 0.18),
    0 10px 26px rgba(0, 0, 0, 0.5);
  transform: translate3d(0, 0, 0);
  transition: transform 0.32s var(--ease-apple), opacity 0.25s ease;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: skewX(-20deg);
  transition: transform 0.65s var(--ease-apple);
}

.btn-primary:hover:not(:disabled) {
  transform: translate3d(0, -2px, 0) scale(1.01);
}

.btn-primary:hover:not(:disabled)::before {
  transform: translateX(360%) skewX(-20deg);
}

.btn-primary:active:not(:disabled) {
  transform: translate3d(0, 0, 0) scale(0.982);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 0.68rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transform: translate3d(0, 0, 0);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-apple);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.26);
  transform: translate3d(0, -1px, 0);
}

.btn-ghost:active {
  transform: scale(0.975);
}

/* ==========================================================================
   Form Controls
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
}

.form-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-label);
  letter-spacing: -0.005em;
}

.req-star {
  color: rgba(255, 255, 255, 0.4);
}

.form-control,
.form-select {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 1rem;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.93rem;
  outline: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: background 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.form-control::placeholder {
  color: var(--text-placeholder);
}

.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
}

.form-control:focus:not([readonly]),
.form-select:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='rgba(255,255,255,0.55)' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  cursor: pointer;
}

.form-select option {
  background-color: #111115;
  color: #ffffff;
}

textarea.form-control {
  min-height: 98px;
  resize: vertical;
  line-height: 1.55;
}

.form-control.has-error,
.form-select.has-error {
  border-color: rgba(255, 90, 90, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 90, 90, 0.12);
}

.field-error {
  font-size: 0.76rem;
  color: var(--accent-rose);
  display: none;
}

.field-error.visible {
  display: block;
  animation: fadeSlideDown 0.22s var(--ease-apple);
}

/* ==========================================================================
   Spinner & Toast Notifications
   ========================================================================== */

.btn-spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
  animation: spin 0.7s linear infinite;
}

.toast-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 360px;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-radius: 16px;
  background: rgba(16, 16, 20, 0.92);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.8);
  animation: toastIn 0.35s var(--ease-apple);
}

.toast-item--success {
  border-color: rgba(52, 211, 153, 0.35);
}

.toast-item--error {
  border-color: rgba(255, 107, 107, 0.4);
}

/* ==========================================================================
   Fixed Header (Admin Only / Minimal)
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.35s var(--ease-apple), border-color 0.35s var(--ease-apple);
}

.site-header.is-scrolled {
  background: rgba(0, 0, 0, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.site-header__inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-white);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.22));
}

.brand-wordmark {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-white);
}

/* ==========================================================================
   Shared Keyframes (GPU-Composited)
   ========================================================================== */

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translate3d(0, -6px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes appleShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-8px, 0, 0); }
  36% { transform: translate3d(7px, 0, 0); }
  54% { transform: translate3d(-5px, 0, 0); }
  72% { transform: translate3d(4px, 0, 0); }
  90% { transform: translate3d(-2px, 0, 0); }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

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

@media (max-width: 640px) {
  .apple-glass-card {
    border-radius: 22px;
  }
}
