/* ══════════════════════════════════════════════════════════════════════════
   KalkulatorTempa — Auth styles (theme-aware)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Navbar auth button ──────────────────────────────────────────────────── */
.navbar__auth-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: border-color .2s, background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font, 'Inter', sans-serif);
}
.navbar__auth-btn:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}
.navbar__auth-btn--in {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  border-color: transparent;
  color: #fff !important;
  box-shadow: 0 2px 12px rgba(255,69,0,.35);
}

/* ── User dropdown ───────────────────────────────────────────────────────── */
.auth-dropdown {
  position: fixed;
  top: calc(var(--nav-h, 58px) + 10px);
  right: 14px; /* overridden by JS on open */
  z-index: 400;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
  min-width: 220px;
  box-shadow: var(--card-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(.97);
  transition: opacity .2s, transform .2s;
}
.auth-dropdown--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.auth-dd-user {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.auth-dd-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #ff4500, #ff7340);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; color: #fff;
  font-family: var(--font, 'Inter', sans-serif);
}
.auth-dd-name {
  font-size: 0.9rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em;
}
.auth-dd-email {
  font-size: 0.7rem; color: var(--text-dim); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px;
}
.auth-dd-sep {
  height: 1px; background: var(--border); margin-bottom: 10px;
}
.auth-dd-link {
  width: 100%; padding: 9px 14px; border-radius: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  color: var(--text-muted); font-size: 0.84rem; font-weight: 600; cursor: pointer;
  font-family: var(--font, 'Inter', sans-serif);
  transition: background .18s, border-color .18s, color .18s;
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.auth-dd-link:hover { background: var(--border-light); color: var(--text); border-color: var(--border); }
.auth-dd-logout {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(255,69,0,.08); border: 1px solid rgba(255,69,0,.25);
  color: var(--accent); font-size: 0.84rem; font-weight: 700; cursor: pointer;
  font-family: var(--font, 'Inter', sans-serif);
  transition: background .18s, border-color .18s;
  text-align: left;
}
.auth-dd-logout:hover { background: rgba(255,69,0,.15); border-color: rgba(255,69,0,.5); }

/* ══════════════════════════════════════════════════════════════════════════
   AUTH MODAL
   ══════════════════════════════════════════════════════════════════════════ */
.auth-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
html.dark .auth-modal { background: rgba(0,0,0,.82); }
.auth-modal--open {
  opacity: 1; pointer-events: auto;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  padding: 28px 24px 24px;
  width: 100%; max-width: 400px;
  position: relative;
  box-shadow: var(--card-shadow);
  max-height: 90dvh;
  overflow-y: auto;
  animation: authCardIn .28s cubic-bezier(.22,1,.36,1);
}
@keyframes authCardIn {
  from { opacity: 0; transform: scale(.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Close button ────────────────────────────────────────────────────────── */
.auth-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  color: var(--text-dim); font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: var(--font, 'Inter', sans-serif);
  transition: background .15s, color .15s;
}
.auth-close:hover { background: var(--border-light); color: var(--text); }

/* ── Logo in modal ───────────────────────────────────────────────────────── */
.auth-modal-logo {
  text-align: center; margin-bottom: 20px;
}
.auth-modal-logo span {
  font-size: 0.95rem; font-weight: 900; letter-spacing: -0.03em; color: var(--text);
}
.auth-modal-logo em {
  color: var(--accent); font-style: normal;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex; gap: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: 13px; padding: 4px; margin-bottom: 22px;
}
.auth-tab {
  flex: 1; padding: 8px 10px; border-radius: 10px;
  font-size: 0.82rem; font-weight: 700; color: var(--text-dim);
  cursor: pointer; font-family: var(--font, 'Inter', sans-serif);
  transition: all .2s;
}
.auth-tab--active {
  background: linear-gradient(135deg, #ff4500, #ff7340);
  color: #fff; box-shadow: 0 2px 12px rgba(255,69,0,.3);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.auth-form--hidden { display: none !important; }
.auth-field { margin-bottom: 14px; }

.auth-label {
  display: block; font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px;
  font-family: var(--font, 'Inter', sans-serif);
}

.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%; background: var(--bg-elevated); border: 1.5px solid var(--border-light);
  border-radius: 10px; padding: 11px 14px;
  color: var(--text); font-size: 0.9rem; font-weight: 500;
  font-family: var(--font, 'Inter', sans-serif);
  transition: border-color .18s, box-shadow .18s, background-color 0.25s;
  outline: none; appearance: none;
}
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,69,0,.15); }
.auth-input--error { border-color: #ff3b3b !important; box-shadow: 0 0 0 3px rgba(255,59,59,.12) !important; }
.auth-input::placeholder { color: var(--text-dim); }

/* Date input color scheme per theme */
html.dark .auth-input { color-scheme: dark; }
html:not(.dark) .auth-input { color-scheme: light; }
html.dark input[type="date"].auth-input::-webkit-calendar-picker-indicator {
  filter: invert(0.6) sepia(1) saturate(3) hue-rotate(340deg);
  cursor: pointer;
}

/* Password field with show/hide button */
.auth-input-wrap .auth-input { padding-right: 64px; }
.auth-show-pwd {
  position: absolute; right: 0; top: 0; bottom: 0; padding: 0 12px;
  font-size: 0.76rem; font-weight: 700; color: var(--accent);
  cursor: pointer; font-family: var(--font, 'Inter', sans-serif);
  transition: color .15s;
  border-radius: 0 10px 10px 0;
}
.auth-show-pwd:hover { color: var(--text); }

/* Error text */
.auth-error {
  display: block; font-size: 0.73rem; font-weight: 600;
  color: #ff4444; margin-top: 5px; min-height: 0;
  font-family: var(--font, 'Inter', sans-serif);
  line-height: 1.4;
}
.auth-error:empty { display: none; }
.auth-error--form {
  text-align: center; margin-top: 8px; margin-bottom: 2px;
  font-size: 0.8rem; padding: 8px 12px;
  background: rgba(255,59,59,.08); border-radius: 8px;
  border: 1px solid rgba(255,59,59,.2);
}
.auth-error--form:empty { display: none; }

/* Password rules */
.auth-pwd-rules {
  list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
}
.rule {
  font-size: 0.65rem; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  background: var(--bg-elevated); border: 1px solid var(--border-light); color: var(--text-dim);
  transition: all .2s; font-family: var(--font, 'Inter', sans-serif);
  display: flex; align-items: center; gap: 4px;
}
.rule::before { content: '○'; font-size: 0.5rem; }
.rule--ok { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.35); color: #22a84a; }
html.dark .rule--ok { color: #4ade80; }
.rule--ok::before { content: '●'; }

/* Submit button */
.auth-submit {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #ff4500, #ff7340);
  border: none; border-radius: 12px;
  color: #fff; font-size: 0.92rem; font-weight: 800;
  cursor: pointer; font-family: var(--font, 'Inter', sans-serif);
  margin-top: 10px; margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(255,69,0,.3);
  transition: opacity .18s, transform .1s;
}
.auth-submit:hover { opacity: .9; }
.auth-submit:active { transform: scale(.98); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }

/* Switch link */
.auth-switch {
  text-align: center; font-size: 0.76rem; color: var(--text-dim);
  font-family: var(--font, 'Inter', sans-serif);
}
.auth-switch-link {
  color: var(--accent); font-weight: 700; font-size: 0.76rem;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
  font-family: var(--font, 'Inter', sans-serif); transition: color .15s;
}
.auth-switch-link:hover { color: var(--text); }

/* Zgoda RODO przy rejestracji */
.auth-consent {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-top: 10px;
  margin-bottom: 4px;
  font-family: var(--font, 'Inter', sans-serif);
}
.auth-consent a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.auth-consent a:hover { color: var(--accent-bright); }
