/* ==========================================================================
   Variables
   ========================================================================== */

:root {
  /* Colors */
  --color-background: #050910; /* Deep blue-black */
  --color-surface: #0a1018;    /* Elevated surface */
  --color-surface-alt: #101827;

  --color-text: #e5edf6;
  --color-text-muted: #9ca9c0;

  --color-primary: #2d7ff9;          /* CIBERTS blue */
  --color-primary-soft: rgba(45, 127, 249, 0.12);
  --color-primary-strong: #1f5fcc;

  --color-accent-silver: #c0cad8;     /* Silver accent */

  --color-success: #22c55e;
  --color-warning: #facc15;
  --color-danger: #ef4444;

  --gray-50:  #0b1120;
  --gray-100: #111827;
  --gray-200: #111827;
  --gray-300: #1f2937;
  --gray-400: #4b5563;
  --gray-500: #6b7280;
  --gray-600: #9ca3af;
  --gray-700: #d1d5db;
  --gray-800: #e5e7eb;
  --gray-900: #f9fafb;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;  /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-md: 1rem;     /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem;  /* 20px */
  --font-size-2xl: 1.5rem;  /* 24px */
  --font-size-3xl: 1.875rem;/* 30px */
  --font-size-4xl: 2.25rem; /* 36px */
  --font-size-5xl: 3rem;    /* 48px */

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.55);
  --shadow-soft-glow: 0 0 0 1px rgba(192, 202, 216, 0.18), 0 18px 40px rgba(15, 23, 42, 0.85);

  /* Transitions */
  --transition-fast: 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-normal: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-slow: 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   Reset / Normalize
   ========================================================================== */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  background: radial-gradient(circle at top left, #0b1220 0%, #020617 48%, #020617 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(var(--font-size-3xl), 2.3vw + 1.5rem, var(--font-size-5xl));
  letter-spacing: 0.03em;
}

h2 {
  font-size: clamp(var(--font-size-2xl), 1.6vw + 1.2rem, var(--font-size-4xl));
}

h3 {
  font-size: clamp(var(--font-size-xl), 1.2vw + 1rem, var(--font-size-3xl));
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-md);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
}

a:focus-visible {
  outline: 2px solid var(--color-accent-silver);
  outline-offset: 3px;
}

strong,
b {
  font-weight: 600;
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
}

hr {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin: var(--space-8) 0;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

/* Layout */

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
  max-width: 1120px;
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.w-full {
  width: 100%;
}

.max-w-screen {
  max-width: 100vw;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Spacing helpers (small curated set for layout) */

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.pt-8 { padding-top: var(--space-8); }
.pb-8 { padding-bottom: var(--space-8); }
.pt-12 { padding-top: var(--space-12); }
.pb-12 { padding-bottom: var(--space-12); }

/* Screen-reader only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Buttons */

.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: var(--font-size-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-strong) 52%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3), 0 18px 35px rgba(15, 23, 42, 0.9);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    opacity var(--transition-fast);
  white-space: nowrap;
}

.button--ghost {
  background: rgba(15, 23, 42, 0.8);
  color: var(--color-accent-silver)!important;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.button--subtle {
  background: var(--color-primary-soft);
  color: var(--color-primary)!important;
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: none;
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.55), 0 22px 45px rgba(15, 23, 42, 0.95);
  opacity: 0.98;
  color: #ffffff;
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.45), 0 8px 20px rgba(15, 23, 42, 0.9);
}

.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.button:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible {
  outline: 2px solid var(--color-accent-silver);
  outline-offset: 3px;
}

/* Inputs & form fields */

.input,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"] {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18) 0%, rgba(15, 23, 42, 0.9) 40%, rgba(15, 23, 42, 1) 100%);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.input::placeholder,
select::placeholder,
textarea::placeholder,
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder,
input[type="password"]::placeholder,
input[type="search"]::placeholder,
input[type="url"]::placeholder,
input[type="number"]::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.input:focus,
select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.55), 0 14px 30px rgba(15, 23, 42, 0.95);
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.32) 0%, rgba(15, 23, 42, 0.95) 36%, rgba(15, 23, 42, 1) 100%);
}

.input:disabled,
select:disabled,
textarea:disabled,
input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="tel"]:disabled,
input[type="password"]:disabled,
input[type="search"]:disabled,
input[type="url"]:disabled,
input[type="number"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

label {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-accent-silver);
}

/* Card */

.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.2) 0%, rgba(15, 23, 42, 0.96) 38%, rgba(15, 23, 42, 1) 100%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow-soft-glow);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 55%);
  opacity: 0.7;
}

.card > * {
  position: relative;
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Focus styles (accessibility) */

:focus-visible {
  outline: 2px solid #e5e7eb;
  outline-offset: 3px;
}

/* ==========================================================================
   Motion & Accessibility Preferences
   ========================================================================== */

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

/* ==========================================================================
   Theming helpers (optional)
   ========================================================================== */

.bg-surface {
  background-color: var(--color-surface);
}

.bg-surface-alt {
  background-color: var(--color-surface-alt);
}

.text-muted {
  color: var(--color-text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent-silver);
  background: rgba(15, 23, 42, 0.9);
}

.badge--primary {
  border-color: rgba(37, 99, 235, 0.7);
  background: rgba(37, 99, 235, 0.16);
  color: var(--color-primary);
}
