/* ============================================
   SUBSCRIBER ACCOUNT – STYLE
   falgowski.com
   ============================================ */

/* ── GLOBALNE CONSTRAINTY SVG (zapobiegają powiększeniu przez motyw) ── */
.sa-account-wrap svg,
.sa-login-wrap svg,
.sa-btn svg,
.sa-nav-item svg,
.sa-toggle-pw svg,
.sa-empty-icon svg {
  max-width: 100%;
  max-height: 100%;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.sa-btn svg          { width: 16px !important; height: 16px !important; }
.sa-nav-item svg     { width: 16px !important; height: 16px !important; }
.sa-toggle-pw svg    { width: 18px !important; height: 18px !important; }

/* ── ZMIENNE ── */
:root {
  --sa-primary:     #f97316;
  --sa-primary-d:   #ea6c0a;
  --sa-accent:      #fb923c;
  --sa-success:     #16a34a;
  --sa-warning:     #d97706;
  --sa-error:       #dc2626;
  --sa-text:        #111827;
  --sa-muted:       #6b7280;
  --sa-border:      #e5e7eb;
  --sa-bg:          #f9fafb;
  --sa-white:       #ffffff;
  --sa-radius:      12px;
  --sa-radius-sm:   8px;
  --sa-shadow:      0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --sa-shadow-lg:   0 8px 30px rgba(0,0,0,.12);
  --sa-transition:  .2s ease;
  --sa-font:        -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

/* ============================================
   FORMULARZ LOGOWANIA
   ============================================ */
.sa-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  min-height: 60vh;
}

.sa-login-card {
  background: var(--sa-white);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
}

.sa-login-header {
  text-align: center;
  margin-bottom: 32px;
}

.sa-login-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
}

.sa-login-header h2 {
  font-family: var(--sa-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--sa-text);
  margin: 0 0 6px;
}

.sa-login-header p {
  color: var(--sa-muted);
  font-size: 14px;
  margin: 0;
}

/* ── POLA ── */
.sa-field {
  margin-bottom: 18px;
}

.sa-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--sa-text);
  margin-bottom: 6px;
}

.sa-field input,
.sa-field select,
.sa-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--sa-border);
  border-radius: var(--sa-radius-sm);
  font-size: 15px;
  color: var(--sa-text);
  background: var(--sa-white);
  transition: border-color var(--sa-transition), box-shadow var(--sa-transition);
  outline: none;
  font-family: var(--sa-font);
}

.sa-field input:focus,
.sa-field select:focus,
.sa-field textarea:focus {
  border-color: var(--sa-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

/* ── PASSWORD TOGGLE ── */
.sa-password-wrap {
  position: relative;
}

.sa-password-wrap input {
  padding-right: 44px;
}

.sa-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--sa-muted);
  display: flex;
  align-items: center;
  transition: color var(--sa-transition);
}

.sa-toggle-pw:hover { color: var(--sa-primary); }
.sa-toggle-pw svg { width: 18px; height: 18px; }

/* ── CHECKBOX ROW ── */
.sa-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}

.sa-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--sa-text);
  cursor: pointer;
}

.sa-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sa-primary);
  cursor: pointer;
}

.sa-forgot {
  font-size: 13px;
  color: var(--sa-primary);
  text-decoration: none;
  transition: color var(--sa-transition);
}
.sa-forgot:hover { color: var(--sa-primary-d); text-decoration: underline; }

/* ── AUTH TABS (logowanie / rejestracja) ── */
.sa-login-card--tabs {
  max-width: 480px;
  padding: 36px 36px 32px;
}

.sa-auth-tabs {
  display: flex;
  background: var(--sa-bg);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.sa-auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--sa-font);
  color: var(--sa-muted);
  cursor: pointer;
  transition: all var(--sa-transition);
}

.sa-auth-tab:hover {
  color: var(--sa-text);
  background: rgba(0,0,0,.04);
}

.sa-auth-tab--active {
  background: var(--sa-white);
  color: var(--sa-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── PANELE LOGOWANIA / REJESTRACJI ── */
.sa-auth-panel {
  display: block !important;
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .22s ease;
  animation: none !important;
}

.sa-auth-panel--active {
  max-height: 2000px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  animation: sa-fade-in .22s ease !important;
}

@keyframes sa-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── DWIE KOLUMNY (imię + nazwisko) ── */
.sa-field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

/* ── WYMAGANE POLE ── */
.sa-req {
  color: var(--sa-error);
  font-size: 13px;
}

/* ── CHECKBOX REGULAMIN ── */
.sa-checkbox--terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--sa-muted);
  line-height: 1.5;
  cursor: pointer;
}

.sa-checkbox--terms input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--sa-primary);
  cursor: pointer;
}

.sa-checkbox--terms a {
  color: var(--sa-primary);
  text-decoration: underline;
}

/* ── PRZEŁĄCZNIK LOGIN ↔ REJESTRACJA ── */
.sa-auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--sa-muted);
  margin: 20px 0 0;
}

.sa-auth-switch a,
.sa-tab-link {
  color: var(--sa-primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.sa-auth-switch a:hover,
.sa-tab-link:hover { text-decoration: underline; }

/* ── SIŁA HASŁA ── */
.sa-password-strength {
  margin-top: 8px;
}

.sa-pw-bar {
  height: 4px;
  background: var(--sa-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.sa-pw-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width .3s ease, background .3s ease;
}

.sa-pw-bar--weak span   { width: 25%; background: var(--sa-error); }
.sa-pw-bar--fair span   { width: 55%; background: var(--sa-warning); }
.sa-pw-bar--good span   { width: 80%; background: var(--sa-primary); }
.sa-pw-bar--strong span { width: 100%; background: var(--sa-success); }

.sa-pw-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sa-pw-label--weak   { color: var(--sa-error); }
.sa-pw-label--fair   { color: var(--sa-warning); }
.sa-pw-label--good   { color: var(--sa-primary); }
.sa-pw-label--strong { color: var(--sa-success); }

/* ── PRZYCISKI ── */
.sa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--sa-radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--sa-font);
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all var(--sa-transition);
  white-space: nowrap;
}

.sa-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.sa-btn--primary {
  background: var(--sa-primary);
  color: var(--sa-white);
  border-color: var(--sa-primary);
}
.sa-btn--primary:hover {
  background: var(--sa-primary-d);
  border-color: var(--sa-primary-d);
  color: var(--sa-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,86,219,.3);
}

.sa-btn--outline {
  background: transparent;
  color: var(--sa-primary);
  border-color: var(--sa-primary);
}
.sa-btn--outline:hover {
  background: var(--sa-primary);
  color: var(--sa-white);
}

.sa-btn--full { width: 100%; }

.sa-btn--sm {
  padding: 7px 14px;
  font-size: 13px;
}

/* ── ALERTY ── */
.sa-alert {
  padding: 12px 16px;
  border-radius: var(--sa-radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  border-left: 4px solid;
}

.sa-alert--success {
  background: #f0fdf4;
  color: var(--sa-success);
  border-color: var(--sa-success);
}

.sa-alert--error {
  background: #fef2f2;
  color: var(--sa-error);
  border-color: var(--sa-error);
}

/* ============================================
   PANEL KLIENTA
   ============================================ */
.sa-account-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 16px;
  align-items: start;
  font-family: var(--sa-font);
}

/* ── SIDEBAR ── */
.sa-sidebar {
  background: var(--sa-white);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow);
  overflow: hidden;
  position: sticky;
  top: 24px;
}

.sa-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: white;
}

.sa-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sa-user-info strong {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sa-user-info span {
  font-size: 12px;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── NAWIGACJA ── */
.sa-nav {
  padding: 12px 0;
}

.sa-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sa-muted);
  text-decoration: none;
  transition: all var(--sa-transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.sa-nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.sa-nav-item:hover {
  background: var(--sa-bg);
  color: var(--sa-text);
}

.sa-nav-item--active {
  background: #fff7ed;
  color: var(--sa-primary);
  border-left-color: var(--sa-primary);
  font-weight: 600;
}

.sa-nav-item--logout {
  margin-top: 4px;
  border-top: 1px solid var(--sa-border);
  color: var(--sa-error);
}

.sa-nav-item--logout:hover {
  background: #fef2f2;
  color: var(--sa-error);
}

/* ── GŁÓWNA SEKCJA ── */
.sa-main {
  min-width: 0;
}

.sa-tab--hidden {
  display: block !important;
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sa-section-header {
  margin-bottom: 24px;
}

.sa-section-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--sa-text);
  margin: 0 0 4px;
}

.sa-section-header p {
  font-size: 14px;
  color: var(--sa-muted);
  margin: 0;
}

/* ============================================
   KARTY WYCIECZEK
   ============================================ */
.sa-trips-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sa-trip-card {
  background: var(--sa-white);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow);
  overflow: hidden;
  transition: box-shadow var(--sa-transition), transform var(--sa-transition);
}

.sa-trip-card:hover {
  box-shadow: var(--sa-shadow-lg);
  transform: translateY(-2px);
}

.sa-trip-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sa-border);
  background: var(--sa-bg);
  flex-wrap: wrap;
  gap: 10px;
}

.sa-trip-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sa-order-number {
  font-weight: 700;
  font-size: 15px;
  color: var(--sa-text);
}

.sa-order-date {
  font-size: 12px;
  color: var(--sa-muted);
}

/* ── BADGE STATUS ── */
.sa-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.sa-badge--pending    { background: #fef3c7; color: #92400e; }
.sa-badge--processing { background: #dbeafe; color: #1e40af; }
.sa-badge--on-hold    { background: #f3f4f6; color: #374151; }
.sa-badge--completed  { background: #dcfce7; color: #166534; }
.sa-badge--cancelled  { background: #fee2e2; color: #991b1b; }
.sa-badge--refunded   { background: #f5f3ff; color: #5b21b6; }
.sa-badge--failed     { background: #fee2e2; color: #7f1d1d; }

/* ── POZYCJE WYCIECZKI ── */
.sa-trip-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sa-trip-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.sa-trip-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--sa-radius-sm);
  border: 1px solid var(--sa-border);
  flex-shrink: 0;
}

.sa-trip-thumb-placeholder {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border-radius: var(--sa-radius-sm);
  font-size: 28px;
  flex-shrink: 0;
}

.sa-trip-item__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sa-trip-item__info strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--sa-text);
}

.sa-trip-item__info span {
  font-size: 13px;
  color: var(--sa-muted);
}

.sa-trip-meta {
  font-size: 12px;
  color: var(--sa-accent);
  font-weight: 500;
}

/* ── FOOTER KARTY ── */
.sa-trip-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--sa-border);
  flex-wrap: wrap;
  gap: 10px;
}

.sa-trip-total {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--sa-muted);
}

.sa-trip-total strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--sa-text);
}

.sa-trip-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── PASEK POSTĘPU ZAMÓWIENIA ── */
.sa-trip-progress {
  padding: 16px 20px;
  border-top: 1px solid var(--sa-border);
  background: var(--sa-bg);
}

.sa-progress-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.sa-progress-steps::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--sa-border);
  z-index: 0;
}

.sa-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  flex: 1;
}

.sa-progress-step span {
  font-size: 11px;
  color: var(--sa-muted);
  text-align: center;
}

.sa-progress-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sa-border);
  border: 3px solid var(--sa-white);
  box-shadow: 0 0 0 2px var(--sa-border);
  transition: all var(--sa-transition);
}

.sa-progress-step--done .sa-progress-dot {
  background: var(--sa-success);
  box-shadow: 0 0 0 2px var(--sa-success);
}

.sa-progress-step--done span { color: var(--sa-success); font-weight: 600; }

.sa-progress-step--active .sa-progress-dot {
  background: var(--sa-primary);
  box-shadow: 0 0 0 2px var(--sa-primary);
  animation: sa-pulse 1.5s infinite;
}

.sa-progress-step--active span { color: var(--sa-primary); font-weight: 600; }

@keyframes sa-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--sa-primary), 0 0 0 5px rgba(26,86,219,.2); }
  50%       { box-shadow: 0 0 0 2px var(--sa-primary), 0 0 0 8px rgba(26,86,219,.1); }
}

/* ── EMPTY STATE ── */
.sa-empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--sa-white);
  border: 1px dashed var(--sa-border);
  border-radius: var(--sa-radius);
}

.sa-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: #d1d5db;
}

.sa-empty-icon svg {
  width: 100%;
  height: 100%;
}

.sa-empty h3   { font-size: 20px; font-weight: 700; color: var(--sa-text); margin: 0 0 8px; }
.sa-empty p    { color: var(--sa-muted); margin: 0 0 24px; }

/* ── PANEL PRZYPOMNIJ HASŁO ── */
.sa-lost-header {
  margin-bottom: 24px;
}

.sa-lost-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--sa-text);
  margin: 0 0 8px;
}

.sa-lost-header p {
  font-size: 14px;
  color: var(--sa-muted);
  margin: 0;
  line-height: 1.6;
}

/* ============================================
   FORMULARZ DANYCH
   ============================================ */
.sa-form {
  background: var(--sa-white);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius);
  padding: 28px;
  box-shadow: var(--sa-shadow);
}

.sa-form-section {
  margin-bottom: 32px;
}

.sa-form-section:last-of-type { margin-bottom: 0; }

.sa-form-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sa-muted);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sa-border);
}

.sa-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.sa-field--full {
  grid-column: 1 / -1;
}

.sa-form-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--sa-border);
  display: flex;
  justify-content: flex-end;
}

.sa-password-rules {
  font-size: 13px;
  color: var(--sa-muted);
  background: var(--sa-bg);
  border-radius: var(--sa-radius-sm);
  padding: 10px 14px;
  margin-top: 4px;
}

.sa-password-rules p { margin: 0; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .sa-account-wrap {
    grid-template-columns: 1fr;
  }

  .sa-sidebar {
    position: static;
  }

  .sa-user-card {
    padding: 20px;
  }

  .sa-nav {
    display: flex;
    flex-wrap: wrap;
    padding: 8px;
    gap: 4px;
  }

  .sa-nav-item {
    border-left: none;
    border-radius: var(--sa-radius-sm);
    flex: 1;
    justify-content: center;
    min-width: 120px;
    font-size: 13px;
  }

  .sa-nav-item--active {
    background: var(--sa-primary);
    color: white;
  }

  .sa-nav-item--logout {
    border-top: none;
    border: 1px solid #fca5a5;
    color: var(--sa-error);
    flex: 0 0 100%;
  }
}

@media (max-width: 600px) {
  .sa-login-card {
    padding: 28px 18px;
  }

  .sa-login-card--tabs {
    padding: 28px 18px 24px;
  }

  .sa-field-row-2 {
    grid-template-columns: 1fr;
  }

  .sa-form-grid {
    grid-template-columns: 1fr;
  }

  .sa-field--full { grid-column: auto; }

  .sa-trip-card__header,
  .sa-trip-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .sa-trip-actions {
    width: 100%;
  }

  .sa-trip-actions .sa-btn {
    flex: 1;
    justify-content: center;
  }
}
