@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import './variables.css';
@import './components/buttons.css';
@import './components/cards.css';
@import './components/forms.css';
@import './components/progress.css';
@import './components/modals.css';

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

html {
  font-family: var(--font-base);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-neutral);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

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

h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; }

/* === Layout SPA === */
#app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}

.app-nav nav {
  display: flex;
  width: 100%;
  justify-content: space-around;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  color: var(--color-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--transition);
}

.nav-item svg {
  width: 24px; height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active { color: var(--color-primary); }
.nav-item:hover  { color: var(--color-primary); }

.app-main {
  flex: 1;
  padding: var(--space-6) var(--space-4);
  padding-bottom: calc(var(--nav-height) + var(--space-6));
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

/* === Widok ładowania === */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* === Powiadomienia inline (banery) === */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert-error   { background: var(--color-danger-bg);  color: var(--color-danger);  border: 1px solid rgba(192,57,43,.3); }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(39,174,96,.3); }
.alert-info    { background: var(--color-info-bg);    color: var(--color-info);    border: 1px solid rgba(41,128,185,.3); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(230,126,34,.3); }

/* === Utilities === */
.text-center { text-align: center; }
.text-muted  { color: var(--color-muted); }
.text-sm     { font-size: var(--text-sm); }
.text-lg     { font-size: var(--text-lg); }
.fw-bold     { font-weight: 700; }
.mt-2        { margin-top: var(--space-2); }
.mt-4        { margin-top: var(--space-4); }
.mt-6        { margin-top: var(--space-6); }
.mb-4        { margin-bottom: var(--space-4); }
.mb-6        { margin-bottom: var(--space-6); }
.gap-3       { gap: var(--space-3); }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden      { display: none !important; }

/* === Sekcja strony === */
.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-neutral);
  margin-bottom: var(--space-6);
}

.section-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-neutral);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* === Empty state === */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: .4;
}

.empty-state h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

/* === Auth layout === */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--color-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.auth-logo svg {
  width: 40px; height: 40px;
  color: var(--color-primary);
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  text-align: center;
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}
