/* ------------------------------
   Fonty
---------------------------------*/
@font-face {
  font-family: 'ProductSans';
  src: url('../assets/fonts/ProductSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ProductSans';
  src: url('../assets/fonts/ProductSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------
   Zmienne kolorystyczne
---------------------------------*/
:root {
  color-scheme: dark;

  --color-bg-body-top: rgba(255, 255, 255, 0.18);
  --color-bg-body-bottom: #020617;
  --color-bg-panel-dark-1: rgba(15, 23, 42, 0.92);
  --color-bg-panel-dark-2: rgba(30, 64, 175, 0.80);

  --color-text-main: #f9fafb;
  --color-text-subtle: #e5e7eb;
  --color-text-muted: #9ca3af;

  --color-border-soft: rgba(148, 163, 184, 0.35);
  --color-border-strong: rgba(148, 163, 184, 0.55);

  --color-accent-green-1: #34d399;
  --color-accent-green-2: #22c55e;
  --color-accent-green-border: rgba(34, 197, 94, 0.9);

  --color-danger-bg: rgba(127, 29, 29, 0.9);
  --color-danger-border: rgba(248, 113, 113, 0.9);

  --radius-panel: 20px;
  --radius-input: 12px;
  --radius-pill: 999px;

  --shadow-deep: 0 24px 60px rgba(15, 23, 42, 0.75);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.6);
}

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

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

body {
  min-height: 100vh;
  font-family: 'ProductSans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, var(--color-bg-body-top), transparent 55%),
    radial-gradient(circle at bottom, rgba(15, 23, 42, 0.85), var(--color-bg-body-bottom) 70%),
    url('../assets/leather-dark.png') center/cover fixed no-repeat;
  background-blend-mode: screen, multiply, normal;
}

/* kontener dla stron typu login/logout */
.page-centered {
  width: 100%;
  max-width: 24rem;
  margin-inline: auto;
  padding: 1rem;
}

/* ------------------------------
   Animacje
---------------------------------*/
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-fade {
  animation: fadeIn 0.7s ease-out both;
}

.anim-slide {
  animation: slideUp 0.75s ease-out both;
}

/* ------------------------------
   Logo / nagłówek
---------------------------------*/
.logo-badge {
  background: radial-gradient(circle at 20% 20%, #f97316, #b45309);
  box-shadow:
    0 18px 35px rgba(180, 83, 9, 0.8),
    0 0 0 1px rgba(251, 146, 60, 0.8);
  border-radius: 20px;
  padding: 0.25rem;
  display: inline-flex;
}

.logo-image {
  display: block;
  width: 15rem; /* można zwiększyć/zmn. globalnie */
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

/* ------------------------------
   Panele (glassmorphism)
---------------------------------*/
.glass-panel {
  background: linear-gradient(
    135deg,
    var(--color-bg-panel-dark-1),
    var(--color-bg-panel-dark-2)
  );
  border-radius: var(--radius-panel);
  border: 1px solid var(--color-border-soft);
  box-shadow:
    var(--shadow-deep),
    0 0 0 1px rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(18px);
  padding: 1.5rem;
}

.glass-panel--light {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.85),
    rgba(30, 64, 175, 0.65)
  );
}

/* duży panel dla widoków typu tabela / settings */
.content-panel {
  max-width: 72rem;
  margin-inline: auto;
  margin-top: 1.5rem;
}

/* ------------------------------
   Formularze / pola
---------------------------------*/
.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #e5e7eb;
  margin-bottom: 0.25rem;
}

.input-glass {
  display: flex;
  align-items: center;
  padding-inline: 0.75rem;
  padding-block: 0.6rem;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border-strong);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 1));
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.8),
    var(--shadow-soft);
}

.input-glass:focus-within {
  border-color: rgba(52, 211, 153, 0.95);
  box-shadow:
    0 0 0 1px rgba(5, 150, 105, 0.9),
    0 18px 40px rgba(16, 185, 129, 0.35);
}

.field-icon {
  margin-right: 0.6rem;
  color: rgba(148, 163, 184, 0.95);
  display: inline-flex;
}

/* właściwy input */
.input-inner {
  background-color: transparent !important;
  border: none;
  outline: none;
  flex: 1 1 auto;
  font-size: 0.9rem;
  color: #f9fafb !important;
  min-width: 0;
}

.input-inner::placeholder {
  color: #d1d5db !important;
  opacity: 1;
}

/* Autofill – Edge/Chrome */
input.input-inner:-webkit-autofill,
input.input-inner:-webkit-autofill:hover,
input.input-inner:-webkit-autofill:focus {
  -webkit-text-fill-color: #f9fafb !important;
  -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
  box-shadow: 0 0 0px 1000px transparent inset !important;
  background-color: transparent !important;
}

/* ------------------------------
   Przyciski
---------------------------------*/
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    filter 0.15s ease-out;
}

/* zielony – akcja główna */
.btn-primary {
  background: radial-gradient(circle at top left, var(--color-accent-green-1), var(--color-accent-green-2));
  color: #ffffff;
  box-shadow:
    0 12px 30px rgba(16, 185, 129, 0.45),
    0 0 0 1px var(--color-accent-green-border);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 16px 40px rgba(16, 185, 129, 0.6),
    0 0 0 1px rgba(34, 197, 94, 1);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 8px 18px rgba(16, 185, 129, 0.55),
    0 0 0 1px rgba(22, 163, 74, 0.95);
}

/* jasny przycisk – np. powrót, anuluj */
.btn-secondary {
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.7);
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.85);
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: #fef2f2;
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow:
    0 10px 25px rgba(127, 29, 29, 0.75),
    0 0 0 1px rgba(248, 113, 113, 0.8);
}

.btn-danger:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* ------------------------------
   Alerty / komunikaty
---------------------------------*/
.alert {
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.alert-error {
  border: 1px solid var(--color-danger-border);
  background: linear-gradient(
    135deg,
    rgba(248, 113, 113, 0.18),
    var(--color-danger-bg)
  );
  color: #fee2e2;
}

.alert-success {
  border: 1px solid rgba(52, 211, 153, 0.7);
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.15),
    rgba(6, 78, 59, 0.9)
  );
  color: #ecfdf5;
}

/* ------------------------------
   Tabele / listy
---------------------------------*/
.table-wrapper {
  overflow-x: auto;
}

.table-default {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-default thead tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.table-default thead th {
  text-align: left;
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.table-default tbody tr {
  border-bottom: 1px solid rgba(15, 23, 42, 0.5);
  transition: background-color 0.12s ease-out;
}

.table-default tbody tr:hover {
  background-color: rgba(15, 23, 42, 0.35);
}

.table-default td {
  padding: 0.4rem 0.5rem;
  color: #e5e7eb;
}

/* ------------------------------
   Badge / statusy
---------------------------------*/
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-muted {
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
}

/* ------------------------------
   Górny pasek na stronach głównych
   (layout_header.php)
---------------------------------*/
.top-bar {
  width: 100%;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 0.92)
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.85);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.9);
}

.top-bar-inner {
  max-width: 80rem;
  margin-inline: auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-main);
  font-size: 1.1rem;
  font-weight: 600;
}

/* Nawigacja */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.7);
  transition:
    background-color 0.15s ease-out,
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.nav-link:hover {
  background: rgba(30, 64, 175, 0.85);
  transform: translateY(-1px);
}

.nav-link--active {
  background: rgba(30, 64, 175, 1);
  border-color: rgba(129, 140, 248, 0.9);
}

/* przycisk wylogowania w topbarze */
.nav-logout {
  background: #ef4444;
  border-color: rgba(248, 113, 113, 0.9);
  color: #f9fafb;
}

/* ------------------------------
   Stopka
---------------------------------*/
.page-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* ------------------------------
   Responsywność
---------------------------------*/
@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .glass-panel {
    border-radius: 16px;
    padding: 1.25rem;
  }

  .logo-image {
    width: 12.5rem;
  }

  .top-bar-inner {
    padding-inline: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
}
