/* =====================================================
   Base styles — global reset + typography.
   Component styles live in css/components/.
   ===================================================== */

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

html {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; }

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  line-height: var(--leading-tight);
  font-weight: var(--font-semibold);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-surface);
  padding: var(--space-4);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 var(--space-4);
}
pre code { background: none; padding: 0; font-size: inherit; }

small { font-size: var(--text-sm); }
strong { font-weight: var(--font-semibold); }

ul, ol { padding-left: var(--space-6); margin: 0 0 var(--space-4); }
li + li { margin-top: var(--space-1); }

/* ── Layout ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* App shell — sidebar + content column */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  overflow-x: hidden;
}

@media (max-width: 1023px) {
  .app-content { margin-left: 0; }
}

main.main {
  flex: 1;
  padding: var(--space-8) var(--space-6);
}

/* ── Messages ───────────────────────────────────────── */
.messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.message {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}

.message--success { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.message--error   { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.message--warning { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.message--info    { background: #e0f2fe; border-color: #bae6fd; color: #0c4a6e; }

/* ── Auth page layout ───────────────────────────────── */
body.fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--color-bg-subtle);
}

.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: var(--space-4);
}

.auth-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-8);
  width: 100%;
  max-width: 26rem;
}

.auth-card__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-6);
}
