/* auth.css — strony logowania/rejestracji/hasła, bez zewnętrznych CDN */

:root {
  --blue:        #0369A1;
  --blue-bright: #0284C7;
  --blue-light:  #0EA5E9;
  --blue-pale:   #BAE6FD;
  --blue-xpale:  #E0F2FE;
  --green:       #16A34A;
  --green-pale:  #DCFCE7;
  --red:         #DC2626;
  --red-pale:    #FEE2E2;
  --amber:       #D97706;
  --amber-pale:  #FEF3C7;
  --bg:          #F0F9FF;
  --bg-white:    #FFFFFF;
  --border:      #E0F2FE;
  --border-mid:  #BAE6FD;
  --text:        #0C4A6E;
  --text-mid:    #1E6898;
  --text-muted:  #64748B;
  --text-dim:    #94A3B8;
  --ff:          'Plus Jakarta Sans', system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  font-family: var(--ff);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.auth-wrap {
  width: 100%;
  max-width: 400px;
}

/* ─── LOGO ─────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  text-decoration: none;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-logo-icon svg { width: 22px; height: 22px; }

.auth-logo-text { line-height: 1.2; }
.auth-logo-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.auth-logo-sub {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ─── KARTA ─────────────────────────────────────────── */
.auth-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(3,105,161,0.08), 0 1px 4px rgba(0,0,0,0.04);
  padding: 32px;
}

.auth-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0 0 24px 0;
}

/* ─── FORMULARZ ─────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group:last-of-type { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.form-label-opt {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.72rem;
  margin-left: 4px;
}

.form-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  font-family: var(--ff);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border-mid);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input::placeholder { color: var(--text-dim); font-weight: 400; }
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(3,105,161,0.1);
  background: var(--bg-white);
}

.form-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 5px;
  line-height: 1.5;
}

.form-field-error {
  font-size: 0.7rem;
  color: var(--red);
  margin-top: 4px;
}

/* ─── CHECKBOX ZGODY ────────────────────────────────── */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.form-check-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}

.form-check-label a {
  color: var(--blue);
  text-decoration: none;
}
.form-check-label a:hover { text-decoration: underline; }

/* ─── FLASH (błędy/sukces) ──────────────────────────── */
.auth-flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 18px;
  line-height: 1.4;
}
.auth-flash-error {
  background: var(--red-pale);
  border: 1.5px solid rgba(220,38,38,0.2);
  color: var(--red);
}
.auth-flash-success {
  background: var(--green-pale);
  border: 1.5px solid rgba(22,163,74,0.2);
  color: var(--green);
}
.auth-flash-info {
  background: var(--blue-xpale);
  border: 1.5px solid rgba(3,105,161,0.15);
  color: var(--blue);
}

/* ─── PRZYCISKI ─────────────────────────────────────── */
.btn-auth {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  margin-top: 20px;
  font-family: var(--ff);
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 1px 8px rgba(3,105,161,0.25);
  letter-spacing: -0.01em;
}
.btn-auth:hover {
  background: var(--blue-bright);
  box-shadow: 0 2px 12px rgba(3,105,161,0.35);
  transform: translateY(-1px);
}

/* ─── FOOTER KARTY ──────────────────────────────────── */
.auth-card-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-card-footer a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.auth-card-footer a:hover { text-decoration: underline; }

/* ─── LINK POMOCNICZY (np. "Zapomniałeś hasła?") ───── */
.auth-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

/* ─── SEPARATORY / TEKST INFORMACYJNY ──────────────── */
.auth-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.auth-info a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.auth-info a:hover { text-decoration: underline; }

/* ─── MESSAGES DJANGO ───────────────────────────────── */
.auth-messages { margin-bottom: 16px; }
.auth-messages li { list-style: none; }

/* ─── FOCUS VISIBLE ──────────────────────────────────── */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.form-input:focus-visible { outline: none; }
.btn-auth:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ─── REDUCED MOTION ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
