:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #1e293b;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: rgba(15, 23, 42, 0.6);
  --input-border: #334155;
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --danger-color: #ef4444;
  --success-color: #22c55e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* FIX DLA IOS - Kolorowanie tła całej przeglądarki */
html {
  background-color: var(--bg-gradient-start);
  height: 100%;
}

body {
  font-family: 'Montserrat', sans-serif;


  color: var(--text-color);
  min-height: 100vh;

  /* Obsługa Notcha (wcięcie na kamerę) w iPhone */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Tło animowane */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.4;
  animation: float 10s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: var(--primary-color);
  top: -50px;
  left: -50px;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: #6366f1;
  bottom: -100px;
  right: -100px;
  animation-delay: 5s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(30px, 20px);
  }
}

/* Kontenery */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  margin: 20px 0;
  transition: transform 0.3s ease;
}

.glass-card.wide {
  max-width: 1000px;
}

/* Nagłówki i Tekst */
h1,
h2,
h3 {
  color: var(--text-color);
  margin-bottom: 20px;
  text-align: center;
}

h2 span {
  color: var(--primary-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: 0.3s;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Formularze */
input,
select {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: #fff;
  margin-bottom: 15px;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  min-height: 50px;
  line-height: 1.5;
}

/* FIX DLA DATE INPUT NA IOS */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

input:focus,
select:focus {
  border-color: var(--primary-color);
  background: rgba(15, 23, 42, 0.8);
}

button,
.btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(to right, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  transition: 0.3s;
  font-size: 16px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  text-decoration: none;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  width: auto;
  min-height: auto;
  display: inline-block;
}

.btn-danger {
  background: var(--danger-color);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--input-border);
}

/* Tabele */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  color: var(--text-color);
}

th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--input-border);
}

th {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
}

tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hiddenRow {
  display: none;
}

/* Header Nav */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--input-border);
  padding-bottom: 20px;
}

.logo-area img {
  height: 40px;
  vertical-align: middle;
}

/* Alerty */
.alert {
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
  width: 100%;
  font-weight: 500;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger-color);
  color: #fca5a5;
}

.alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--success-color);
  color: #86efac;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-row input {
  flex: 1;
}

.form-actions {
  text-align: center;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* --- DROPDOWN MENU & MODAL --- */
.user-dropdown {
  position: relative;
  display: inline-block;
  cursor: pointer;
  padding: 10px;
  user-select: none;
  transition: background 0.2s;
  border-radius: 8px;
}

.user-dropdown.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: #1e293b;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
  overflow: hidden;
  margin-top: 5px;
  animation: fadeIn 0.2s ease-out;
}

.user-dropdown.active .user-dropdown-content {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-dropdown-content a,
.user-dropdown-content span {
  color: #f8fafc;
  padding: 15px 20px;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1rem;
}

.user-dropdown-content a:hover,
.user-dropdown-content span:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  margin: 15% auto;
  width: 90%;
  max-width: 400px;
  position: relative;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 10px;
}

/* --- Summary Box --- */
.summary-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 25px;
}

.summary-box {
  text-align: right;
  padding: 20px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 16px;
  border: 1px solid var(--primary-color);
}

.summary-label {
  color: var(--text-muted);
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
}

.summary-value {
  margin: 5px 0 0 0;
  font-size: 2em;
  color: var(--primary-color);
  font-weight: 700;
}

.summary-currency {
  font-size: 0.6em;
  font-weight: 400;
}

/* --- Payment Section --- */
.payment-section {
  background: rgba(59, 130, 246, 0.05);
  padding: 25px;
  border-radius: 20px;
  border: 1px dashed var(--primary-color);
  margin-bottom: 30px;
}

.payment-wrapper {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.payment-input-container {
  flex: 1;
  max-width: 300px;
}

.payment-input-container input {
  margin: 0;
  height: 50px;
  font-size: 1.1rem;
}

.payment-btn {
  flex: 0;
  min-width: 200px;
  white-space: nowrap;
  height: 50px;
}

.payment-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 15px;
}

/* MEDIA QUERIES */
@media (max-width: 900px) {
  .container {
    padding: 15px;
    justify-content: flex-start;
    padding-top: 40px;
  }

  .glass-card {
    padding: 25px 20px;
    border-radius: 20px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .header-nav {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    margin-bottom: 20px;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    padding: 12px 10px;
    font-size: 0.95rem;
  }

  .payment-wrapper {
    flex-direction: column;
    width: 100%;
  }

  .payment-input-container {
    width: 100%;
    max-width: 100%;
  }

  .payment-btn {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 15px;
  }

  .summary-container {
    justify-content: center;
  }

  .summary-box {
    text-align: center;
    width: 100%;
  }

  .btn-outline[style*="float: right"] {
    float: none !important;
    display: block;
    width: 100%;
    margin-bottom: 15px;
    text-align: center;
  }
}