/* ============================================
   PermisXP — main.css
   Variables, reset, base, utilitaires, layout
   ============================================ */

/* ============================================
   1. VARIABLES CSS
   ============================================ */
:root {
  /* Couleurs */
  --color-bg:           #0f0f1a;
  --color-card:         #1a1a2e;
  --color-card-hover:   #2a2a3a;
  --color-border:       #2a2a3a;
  --color-primary:      #7F77DD;
  --color-primary-dark: #534AB7;
  --color-success:      #1D9E75;
  --color-danger:       #A32D2D;
  --color-warning:      #854F0B;
  --color-gold:         #facc15;
  --color-text:         #ffffff;
  --color-text-muted:   #888888;
  --color-text-hint:    #444444;

  /* Typographie */
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs:   11px;
  --font-size-sm:   13px;
  --font-size-base: 15px;
  --font-size-md:   17px;
  --font-size-lg:   20px;
  --font-size-xl:   24px;
  --font-size-2xl:  30px;

  /* Border radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-full: 999px;

  /* Espacements */
  --spacing-xs:  4px;
  --spacing-sm:  8px;
  --spacing-md:  16px;
  --spacing-lg:  24px;
  --spacing-xl:  32px;
  --spacing-2xl: 48px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Ombres */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-glow-primary: 0 0 20px rgba(127, 119, 221, 0.25);
}

/* ============================================
   2. RESET MINIMAL
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--color-bg);
  font-family:      var(--font-main);
  font-size:        var(--font-size-base);
  color:            var(--color-text);
  line-height:      1.5;
  min-height:       100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

img, video {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

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

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

/* ============================================
   3. TYPOGRAPHIE DE BASE
   ============================================ */
h1 {
  font-size:   var(--font-size-2xl);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

h2 {
  font-size:   var(--font-size-xl);
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  font-size:   var(--font-size-lg);
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-size:   var(--font-size-md);
  font-weight: 600;
  line-height: 1.4;
}

p {
  font-size:   var(--font-size-base);
  line-height: 1.6;
  color:       var(--color-text);
}

small {
  font-size: var(--font-size-sm);
}

strong {
  font-weight: 700;
}

/* ============================================
   4. UTILITAIRES
   ============================================ */

/* Flexbox */
.flex       { display: flex; align-items: center; }
.flex-col   { display: flex; flex-direction: column; }
.flex-1     { flex: 1; }
.flex-wrap  { flex-wrap: wrap; }
.items-start    { align-items: flex-start; }
.items-center   { align-items: center; }
.items-end      { align-items: flex-end; }
.justify-start  { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

/* Gaps */
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* Texte */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-muted   { color: var(--color-text-muted); }
.text-hint    { color: var(--color-text-hint); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-gold    { color: var(--color-gold); }
.text-sm      { font-size: var(--font-size-sm); }
.text-xs      { font-size: var(--font-size-xs); }
.text-lg      { font-size: var(--font-size-lg); }
.text-xl      { font-size: var(--font-size-xl); }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.font-normal  { font-weight: 400; }

/* Spacements */
.mt-sm  { margin-top: var(--spacing-sm); }
.mt-md  { margin-top: var(--spacing-md); }
.mt-lg  { margin-top: var(--spacing-lg); }
.mb-sm  { margin-bottom: var(--spacing-sm); }
.mb-md  { margin-bottom: var(--spacing-md); }
.mb-lg  { margin-bottom: var(--spacing-lg); }
.pt-sm  { padding-top: var(--spacing-sm); }
.pt-md  { padding-top: var(--spacing-md); }
.pb-md  { padding-bottom: var(--spacing-md); }
.pb-lg  { padding-bottom: var(--spacing-lg); }

/* Visibility */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.w-full { width: 100%; }

/* ============================================
   5. LAYOUT MOBILE-FIRST
   ============================================ */
#app {
  max-width: 390px;
  margin:    0 auto;
  min-height: 100vh;
  position:  relative;
  overflow-x: hidden;
}

.screen {
  display:        none;
  flex-direction: column;
  min-height:     100vh;
  padding:        0 20px;
  padding-bottom: 80px; /* espace pour la nav bottom */
}

.screen.active {
  display: flex;
}

.screen-header {
  padding:         20px 0 16px;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
}

.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Section labels */
.section-label {
  font-size:      var(--font-size-xs);
  font-weight:    700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--color-text-muted);
  margin-bottom:  var(--spacing-sm);
}

/* Divider */
.divider {
  height:     1px;
  background: var(--color-border);
  border:     none;
  margin:     var(--spacing-md) 0;
}

/* Scrollable list */
.scroll-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.scroll-list::-webkit-scrollbar {
  display: none;
}

/* ============================================
   6. SPLASH SCREEN
   ============================================ */
#splash {
  position:        fixed;
  inset:           0;
  background:      var(--color-bg);
  display:         flex;
  align-items:     center;
  justify-content: center;
  z-index:         999;
}

.splash-inner {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            12px;
  text-align:     center;
}

.splash-logo {
  width:  72px;
  height: 72px;
  margin-bottom: 4px;
}

.splash-logo svg {
  width:  100%;
  height: 100%;
}

.splash-title {
  font-size:      32px;
  font-weight:    800;
  letter-spacing: -1px;
  color:          var(--color-text);
}

.splash-sub {
  font-size: 14px;
  color:     var(--color-text-muted);
  margin-top: -4px;
}

.splash-spinner {
  margin-top: 24px;
}
