@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* ============================================
     ROYAL WINGS ALLIANCE — CLAYMORPHIC FLIGHT-OPS THEME
     Soft extruded "model-kit plastic" surfaces.
     All variable names kept stable for templates.
     ============================================ */

  --bg-deep: #000000;
  --bg-base: #05070d;
  --surface-panel: #0d1524;
  --surface-card: #111a2e;
  --surface-card-elevated: #16223c;
  --surface-row: #0e1728;
  --surface-hover: #1a2a48;
  --surface-active: #213558;

  /* Borders */
  --border-hairline: rgba(148, 180, 230, 0.14);
  --border-subtle: rgba(168, 196, 240, 0.22);
  --border-glow: rgba(245, 158, 11, 0.45);
  --border-focus: #fbbf24;
  --border-cyan: rgba(56, 189, 248, 0.45);

  /* Flight-Ops Accents */
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-amber-dark: #d97706;
  --accent-amber-subtle: rgba(245, 158, 11, 0.16);
  --accent-amber-glow: 0 6px 20px rgba(245, 158, 11, 0.35);

  --accent-cyan: #38bdf8;
  --accent-cyan-subtle: rgba(56, 189, 248, 0.16);
  --accent-cyan-glow: 0 6px 20px rgba(56, 189, 248, 0.35);

  /* Status Tokens */
  --status-green: #34d399;
  --status-green-glow: 0 6px 16px rgba(52, 211, 153, 0.35);
  --status-green-bg: rgba(52, 211, 153, 0.15);
  --status-green-border: rgba(52, 211, 153, 0.45);

  --status-amber: #f59e0b;
  --status-amber-glow: 0 6px 16px rgba(245, 158, 11, 0.35);
  --status-amber-bg: rgba(245, 158, 11, 0.15);
  --status-amber-border: rgba(245, 158, 11, 0.45);

  --status-red: #f87171;
  --status-red-glow: 0 6px 16px rgba(248, 113, 113, 0.4);
  --status-red-bg: rgba(248, 113, 113, 0.15);
  --status-red-border: rgba(248, 113, 113, 0.5);

  --status-neutral: #a5b8d4;
  --status-neutral-bg: rgba(165, 184, 212, 0.12);
  --status-neutral-border: rgba(165, 184, 212, 0.3);

  /* Typography */
  --text-primary: #f2f6fd;
  --text-secondary: #a7b8d4;
  --text-muted: #7488a8;
  --text-inverse: #0d1524;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-display: 'Baloo 2', 'Inter', sans-serif;

  /* Scale — chunky clay rounding */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* ============================================
     CLAY 3D SHADOW SYSTEM
     Light from top-left; dark extrusion bottom-right.
     ============================================ */
  --clay-raised:
    8px 8px 20px rgba(3, 8, 18, 0.55),
    -4px -4px 12px rgba(150, 185, 240, 0.07),
    inset 1px 1px 1px rgba(190, 215, 250, 0.16),
    inset -2px -3px 6px rgba(4, 10, 22, 0.5);
  --clay-raised-lg:
    14px 16px 40px rgba(3, 8, 18, 0.6),
    -6px -6px 16px rgba(150, 185, 240, 0.08),
    inset 1px 1px 2px rgba(190, 215, 250, 0.18),
    inset -3px -4px 8px rgba(4, 10, 22, 0.5);
  --clay-pressed:
    inset 5px 6px 12px rgba(3, 8, 18, 0.6),
    inset -3px -3px 8px rgba(150, 185, 240, 0.06);
  --clay-inset:
    inset 3px 4px 8px rgba(3, 8, 18, 0.5),
    inset -2px -2px 6px rgba(150, 185, 240, 0.06);
  --clay-key:
    0 6px 0 var(--clay-key-edge, #0d1830),
    0 10px 24px rgba(3, 8, 18, 0.5),
    inset 1px 1px 1px rgba(200, 222, 255, 0.28);
}

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

/* ============================================
   FLIGHT-OPS THEMED SCROLLBARS (Cross-Browser)
   Replaces default OS / Windows light-gray scrollbars
   with sleek, dark claymorphic styling.
   ============================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 180, 230, 0.28) rgba(5, 7, 13, 0.4);
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(5, 7, 13, 0.35);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 180, 230, 0.24);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: content-box;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-amber);
  background-clip: content-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  background-image:
    radial-gradient(ellipse 900px 520px at 15% -5%, rgba(56, 189, 248, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 1000px 600px at 90% 10%, rgba(245, 158, 11, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse 800px 700px at 50% 110%, rgba(99, 102, 241, 0.05) 0%, transparent 60%),
    #000000;
}

/* Soft clay cloud puffs floating in the sky layer */
body::before {
  content: "";
  position: fixed;
  top: -220px; left: -220px; right: -220px; bottom: -220px;
  background-image:
    radial-gradient(closest-side, rgba(190, 215, 250, 0.045), transparent 72%),
    radial-gradient(closest-side, rgba(190, 215, 250, 0.035), transparent 72%);
  background-size: 520px 300px, 380px 240px;
  background-position: 8% 18%, 78% 12%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  animation: cloudDrift 90s ease-in-out infinite alternate;
}

/* Accessible focus styling */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--border-hairline);
}

button {
  cursor: pointer;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Buttons pressed down instantly on click (also keyboard/mouse-hold) */
button:not(:disabled):active {
  transform: translateY(2px) scale(0.98);
}

/* Clay form controls base */
input.form-input, select.form-input, textarea.form-input,
input[type="text"], input[type="password"], select, textarea {
  border-radius: var(--radius-sm);
  background: var(--surface-panel);
  box-shadow: var(--clay-inset);
  border: 1px solid transparent;
}

/* SVG Icon standardization */
.icon-svg {
  display: inline-block;
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(3, 8, 18, 0.45));
}

.icon-svg-lg {
  width: 20px;
  height: 20px;
}

.icon-svg-xl {
  width: 30px;
  height: 30px;
}

/* ============================================
   ANIMATION LIBRARY — clay motion language
   ============================================ */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

@keyframes radarSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes flashHighlight {
  0% { background-color: rgba(245, 158, 11, 0.35); }
  100% { background-color: transparent; }
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-9px) rotate(-1.2deg); }
}

@keyframes cloudDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(90px, 26px, 0); }
}

@keyframes clayPop {
  0% { opacity: 0; transform: perspective(900px) translateZ(-90px) scale(0.92); }
  60% { opacity: 1; transform: perspective(900px) translateZ(6px) scale(1.015); }
  100% { opacity: 1; transform: perspective(900px) translateZ(0) scale(1); }
}

@keyframes runwayDash {
  from { background-position: 0 0; }
  to   { background-position: 46px 0; }
}

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

@keyframes tiltIn {
  from { opacity: 0; transform: perspective(1100px) rotateX(9deg) translateY(22px); }
  to   { opacity: 1; transform: none; }
}

@keyframes spinnerPlane {
  0%   { transform: translateX(-140%) rotate(8deg); }
  100% { transform: translateX(140vw) rotate(8deg); }
}

@keyframes dashFlow {
  to { stroke-dashoffset: -28; }
}

.flash-row {
  animation: flashHighlight 1.4s ease-out;
}

/* Clay page-entrance for main content */
.main-content {
  animation: tiltIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Reduced motion: strip all non-essential movement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .main-content { animation: none; }
}
