/* ============================================================
   SoftShop – app.css
   PHP 8.4 | DirectAdmin
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12);
  --transition: 150ms ease;

  /* Jasny motyw */
  --bg:         #f9fafb;
  --bg-card:    #ffffff;
  --bg-subtle:  #f3f4f6;
  --border:     #e5e7eb;
  --border-focus: #6366f1;
  --text:       #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  --primary:        #6366f1;
  --primary-hover:  #4f46e5;
  --primary-light:  #eef2ff;

  --success:      #22c55e;
  --success-bg:   #f0fdf4;
  --success-border:#bbf7d0;

  --error:        #ef4444;
  --error-bg:     #fef2f2;
  --error-border: #fecaca;

  --warning:      #f59e0b;
  --warning-bg:   #fffbeb;
  --warning-border:#fde68a;

  --info:         #3b82f6;
  --info-bg:      #eff6ff;
  --info-border:  #bfdbfe;

  --header-h:   64px;
}

.dark {
  --bg:         #0f172a;
  --bg-card:    #1e293b;
  --bg-subtle:  #1e293b;
  --border:     #334155;
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary-light: #1e1b4b;
  --success-bg:   #052e16;
  --success-border:#166534;
  --error-bg:     #450a0a;
  --error-border: #991b1b;
  --warning-bg:   #451a03;
  --warning-border:#92400e;
  --info-bg:      #172554;
  --info-border:  #1e40af;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; gap: 24px; height: 100%;
}
.logo {
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.main-nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 6px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.9375rem;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg-subtle); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ---- Lang switch ---- */
.lang-switch { display: flex; align-items: center; gap: 4px; font-size: 0.8125rem; }
.lang-switch a { color: var(--text-muted); }
.lang-switch a.active { color: var(--primary); font-weight: 600; }
.lang-switch span { color: var(--border); }

/* ---- Icon buttons ---- */
.btn-icon {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: transparent; border: none;
  color: var(--text-muted); cursor: pointer; position: relative;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--bg-subtle); color: var(--text); }

/* Cart badge */
.cart-count {
  position: absolute; top: 2px; right: 2px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1;
}
.cart-count:empty, .cart-count[data-count="0"] { display: none; }

/* ---- User menu ---- */
.user-menu { position: relative; }
.user-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: 0.875rem;
  border: none; cursor: pointer; text-transform: uppercase;
}
.user-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 200px; overflow: hidden; z-index: 1000;
}
.user-dropdown.open { display: block; }
.user-menu:hover .user-dropdown { display: block; }
.dropdown-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.dropdown-header strong { display: block; font-size: 0.875rem; }
.dropdown-header span { font-size: 0.75rem; color: var(--text-muted); }
.user-dropdown a {
  display: block; padding: 9px 16px; font-size: 0.875rem;
  color: var(--text); transition: background var(--transition);
}
.user-dropdown a:hover { background: var(--bg-subtle); text-decoration: none; }
.user-dropdown a.danger { color: var(--error); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-size: 0.9375rem;
  font-weight: 500; cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; white-space: nowrap; font-family: var(--font);
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.875rem; }
.btn-full { width: 100%; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-subtle); }

.btn-google {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border);
}
.btn-google:hover { background: var(--bg-subtle); }

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

/* ---- Flash messages ---- */
.flash-container {
  position: fixed; top: calc(var(--header-h) + 12px); right: 16px;
  z-index: 500; display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.flash {
  padding: 12px 16px; border-radius: var(--radius); font-size: 0.875rem;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow-lg); border: 1px solid;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }
.flash-success { background: var(--success-bg); border-color: var(--success-border); color: #166534; }
.flash-error   { background: var(--error-bg);   border-color: var(--error-border);   color: #991b1b; }
.flash-warning { background: var(--warning-bg); border-color: var(--warning-border); color: #92400e; }
.flash-info    { background: var(--info-bg);    border-color: var(--info-border);    color: #1e40af; }
.dark .flash-success { color: #86efac; }
.dark .flash-error   { color: #fca5a5; }
.dark .flash-warning { color: #fcd34d; }
.dark .flash-info    { color: #93c5fd; }
.flash-close {
  background: none; border: none; cursor: pointer;
  color: inherit; font-size: 1.125rem; line-height: 1; margin-left: auto; opacity: 0.6;
}
.flash-close:hover { opacity: 1; }

/* ---- Alerts (inline) ---- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.875rem;
  margin-bottom: 16px; border: 1px solid;
}
.alert div + div { margin-top: 4px; }
.alert-error   { background: var(--error-bg);   border-color: var(--error-border);   color: #991b1b; }
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: #166534; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: #92400e; }
.alert-info    { background: var(--info-bg);    border-color: var(--info-border);    color: #1e40af; }
.dark .alert-error   { color: #fca5a5; }
.dark .alert-success { color: #86efac; }
.dark .alert-warning { color: #fcd34d; }
.dark .alert-info    { color: #93c5fd; }

/* ---- Main content ---- */
.main-content { flex: 1; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 32px 0;
  margin-top: 64px;
}
.footer-inner {
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
  justify-content: space-between;
}
.footer-brand p { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { font-size: 0.875rem; color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }
.footer-copy { font-size: 0.8125rem; color: var(--text-light); }

/* ---- Auth pages ---- */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--header-h) - 80px);
  padding: 40px 16px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  box-shadow: var(--shadow);
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header h1 { font-size: 1.625rem; font-weight: 700; }
.auth-header p { color: var(--text-muted); margin-top: 6px; font-size: 0.9375rem; }
.auth-desc { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 20px; }

/* ---- Forms ---- */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
label {
  font-size: 0.875rem; font-weight: 500; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
}
.label-link { font-size: 0.8125rem; font-weight: 400; color: var(--primary); }
.hint { font-size: 0.8125rem; font-weight: 400; color: var(--text-muted); }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="tel"],
select, textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-family: var(--font);
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
input.input-error { border-color: var(--error); }
input.input-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.15); }

/* Password field */
.input-password { position: relative; }
.input-password input { padding-right: 44px; }
.toggle-password {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px;
}
.toggle-password:hover { color: var(--text); }

/* Siła hasła */
.password-strength {
  height: 3px; background: var(--border); border-radius: 2px; margin-top: 4px; overflow: hidden;
}
.strength-bar { height: 100%; width: 0; border-radius: 2px; transition: all 0.3s ease; }

/* Checkboxy */
.checkbox-label {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-size: 0.875rem; color: var(--text-muted);
}
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; accent-color: var(--primary); }
.checkbox-error { color: var(--error); }

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-light); font-size: 0.8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .auth-card { padding: 28px 20px; }
  .header-actions .btn { display: none; }
  .header-actions .btn-icon { display: flex; }
  .user-menu .user-btn { display: flex; align-items: center; justify-content: center; }
}

@media (max-width: 480px) {
  .auth-page { padding: 20px 12px; }
  .auth-card { border-radius: var(--radius); }
}

/* ---- Stopka na dole strony ---- */
body { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; }

/* ---- products-main fix ---- */
.products-main { min-width: 0; flex: 1; }
