/* ================================================================
   Puffy's — core.css
   Variables CSS, reset, typographie de base
   ================================================================ */

:root {
  /* Fonds */
  --bg-base:      #0B0B10;
  --bg-surface:   #111118;
  --bg-card:      #18181F;
  --bg-elevated:  #1F1F28;
  --bg-glass:     rgba(255, 255, 255, 0.025);

  /* Accent — or satiné */
  --accent:       #C4A35A;
  --accent-hover: #D4B46A;
  --accent-dim:   rgba(196, 163, 90, 0.12);
  --accent-glow:  rgba(196, 163, 90, 0.06);

  /* Texte */
  --text-primary:   #EDEAE2;
  --text-secondary: #908E89;
  --text-muted:     #5A5855;

  /* Bordures */
  --border:        rgba(255, 255, 255, 0.06);
  --border-accent: rgba(196, 163, 90, 0.22);

  /* Statuts */
  --color-success: #4A7C62;
  --color-error:   #8C3A3A;
  --color-warning: #8C6030;
  --color-info:    #3A5A7C;

  --bg-success: rgba(74, 124, 98, 0.12);
  --bg-error:   rgba(140, 58, 58, 0.12);
  --bg-warning: rgba(140, 96, 48, 0.12);
  --bg-info:    rgba(58, 90, 124, 0.12);

  /* Layout */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md:  0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 8px 40px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition: 200ms ease;
  --transition-slow: 350ms cubic-bezier(0.32, 0.72, 0, 1);

  /* Bottom nav height */
  --bottom-nav-h: 68px;
  --top-bar-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Texture de fond subtile */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('/assets/img/textures/grain.png');
  background-size: 200px 200px;
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Typographie ── */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.mono, code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875em;
}

.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-success   { color: var(--color-success); }
.text-error     { color: var(--color-error); }
.text-warning   { color: var(--color-warning); }
.text-accent    { color: var(--accent); }

/* ── Logo ── */
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
}

/* ── Auth layout ── */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
}

.auth-wrapper {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-title {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.375rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.auth-form-wrap {}

.auth-back-link {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-back-link:hover { color: var(--text-primary); }

.auth-legal {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Error page ── */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-container {
  text-align: center;
  padding: 2rem;
}

.error-code {
  display: block;
  font-size: 5rem;
  font-weight: 700;
  color: var(--accent-dim);
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 1rem;
}
