/* stronazaufana.pl — logowanie / rejestracja (mobile-first) */

:root {
  --auth-bg: #f5f5f5;
  --auth-panel: #ffffff;
  --auth-line: #e0e0e0;
  --auth-text: #333333;
  --auth-muted: #666666;
  --auth-accent: #ff6b35;
  --auth-accent-hover: #ff5722;
  --auth-danger: #c62828;
  --auth-ok: #2e7d32;
  --auth-radius: 16px;
  --auth-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body.auth-page {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--auth-bg);
  color: var(--auth-text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.auth-page-shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0))
           max(16px, env(safe-area-inset-right, 0))
           max(16px, env(safe-area-inset-bottom, 0))
           max(16px, env(safe-area-inset-left, 0));
}

.auth-page-card {
  width: 100%;
  max-width: 440px;
  background: var(--auth-panel);
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-page-card h1,
.auth-page-card h2 {
  margin: 0;
  font-size: clamp(1.35rem, 4.5vw, 1.5rem);
  letter-spacing: 0.02em;
  color: #1a1a1a;
  text-align: center;
}

.auth-page-card label {
  display: block;
  margin: 0.55rem 0 0.35rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-text);
}

.auth-page-card input[type="email"],
.auth-page-card input[type="password"],
.auth-page-card input[type="text"],
.auth-page-card input[type="number"] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--auth-line);
  color: var(--auth-text);
  padding: 12px 14px;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  min-height: 48px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-page-card input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.auth-page-card button[type="submit"],
.auth-page-card .auth-submit {
  background: var(--auth-accent);
  color: #fff;
  border: 1px solid var(--auth-accent);
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  min-height: 48px;
  width: 100%;
  margin-top: 4px;
  transition: background 0.2s;
}

.auth-page-card button[type="submit"]:hover,
.auth-page-card .auth-submit:hover {
  background: var(--auth-accent-hover);
}

.auth-msg-err {
  background: #ffebee;
  color: var(--auth-danger);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid var(--auth-danger);
  line-height: 1.45;
}

.auth-msg-ok {
  background: #e8f5e9;
  color: var(--auth-ok);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid var(--auth-ok);
  line-height: 1.45;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-top: 6px;
}

.auth-actions a {
  color: var(--auth-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.auth-actions a:hover {
  text-decoration: underline;
}

.auth-page-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--auth-muted);
}

.auth-turnstile-wrap {
  margin: 12px 0 0;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-turnstile-hint {
  font-size: 12px;
  color: var(--auth-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.45;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
  font-size: 14px;
  color: var(--auth-muted);
  font-weight: 400;
  cursor: pointer;
}

.auth-remember input {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

/* Pole hasła z przełącznikiem */
.pw-field {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-field input {
  padding-right: 48px !important;
}

.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  border-radius: 50%;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--auth-muted);
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}

.pw-toggle::before {
  content: "👁";
}

.pw-toggle[data-visible="1"]::before {
  content: "🙈";
}

.pw-toggle:hover {
  color: var(--auth-accent);
  background: rgba(0, 0, 0, 0.04);
}

/* —— Drawer na stronie głównej —— */
.auth-drawer {
  padding: max(12px, env(safe-area-inset-top, 0)) 12px 24px;
}

.auth-card {
  width: min(420px, 100%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-head .close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line, #e0e0e0);
  border-radius: 12px;
  background: var(--card-alt, #fafafa);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tabs button {
  flex: 1;
  min-height: 44px;
  padding: 12px;
  font-size: 15px;
}

.auth-body input,
.auth-body input[type="email"],
.auth-body input[type="password"],
.auth-body input[type="text"] {
  font-size: 16px !important;
  min-height: 48px;
  padding: 12px 14px;
}

.auth-body .addsite-btn {
  min-height: 48px;
  font-size: 16px;
  padding: 14px 16px;
}

@media (max-width: 767px) {
  .auth-page-shell {
    justify-content: flex-start;
    padding-top: max(20px, env(safe-area-inset-top, 0));
  }

  .auth-page-card {
    max-width: 100%;
    border-radius: 18px;
    padding: 20px 16px;
  }

  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-actions a {
    justify-content: center;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: #fff;
    padding: 12px 16px;
  }

  .auth-drawer {
    padding: 0 !important;
    align-items: stretch !important;
  }

  .auth-drawer .auth-card {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100dvh;
    max-height: none;
    border-radius: 0 !important;
    border: none;
    padding: calc(16px + env(safe-area-inset-top, 0)) 16px calc(20px + env(safe-area-inset-bottom, 0));
    box-shadow: none;
  }

  .auth-head strong {
    font-size: 1.1rem;
  }
}

@media (max-width: 380px) {
  .auth-page-card {
    padding: 18px 14px;
  }
}
