:root{
  --bg: #0b0f14;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.09);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.66);
  --line: rgba(255,255,255,.12);
  --accent: #3aa0ff;
  --good: rgba(99,208,201,.95);
  --bad: rgba(255,120,120,.95);

  --r: 18px;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --max: 980px;
}

*{ box-sizing: border-box; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 20% 10%, rgba(58,160,255,.18), transparent 60%),
    radial-gradient(900px 500px at 80% 0%, rgba(99,208,201,.12), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

a{ color: inherit; }
.container{
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 18px;
}
.brand{
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  text-decoration: none;
}

.brand img{
  height: 50px;   /* czytelne na logowaniu */
  width: auto;
  display: block;
  opacity: .95;
}


.navlinks{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}
.pill:hover{ background: rgba(255,255,255,.06); text-decoration: none; }

.card{
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
}

h1{
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.lead{
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.form{
  display: grid;
  gap: 12px;
}

.field{
  display: grid;
  gap: 6px;
}
label{
  font-size: 13px;
  color: var(--muted);
}
input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline: none;
}
input:focus{
  border-color: rgba(58,160,255,.55);
  box-shadow: 0 0 0 4px rgba(58,160,255,.12);
}

input.is-invalid {
  border-color: rgba(255,120,120,.62);
}

.field-error {
  color: #ffb4b4;
  font-size: 12px;
  line-height: 1.35;
}

.password-toggle {
  justify-self: start;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.82);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
}

.password-toggle:hover {
  text-decoration: underline;
}

.help{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

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

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s ease, background .12s ease, opacity .12s ease;
}
.btn:hover{ background: rgba(255,255,255,.07); text-decoration: none; }
.btn:active{ transform: translateY(1px); }
.btn--primary{
  border-color: rgba(58,160,255,.35);
  background: linear-gradient(180deg, rgba(58,160,255,.22), rgba(58,160,255,.10));
}
.btn[disabled]{
  opacity: .55;
  cursor: not-allowed;
}

.msg{
  display: none;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  line-height: 1.5;
}
.msg.is-visible{ display: block; }
.msg.is-success{
  border-color: rgba(99,208,201,.35);
  color: rgba(255,255,255,.88);
}
.msg.is-error{
  border-color: rgba(255,120,120,.30);
  color: rgba(255,255,255,.88);
}
.smalllinks{
  margin-top: 12px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.smalllinks a{ color: rgba(255,255,255,.85); text-decoration: none; }
.smalllinks a:hover{ text-decoration: underline; }

.form-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.form-note a {
  color: inherit;
  font-weight: 700;
}

.verification-panel {
  display: grid;
  gap: 14px;
}

@media (min-width: 760px){
  .container{ padding-top: 28px; }
  .card{ padding: 18px; }
  h1{ font-size: 26px; }
}

/* ========================= */
/* LIGHT THEME               */
/* ========================= */

html[data-theme="light"] {
  --bg: #f1f5f9;
  --panel: rgba(15, 23, 42, 0.04);
  --panel2: rgba(15, 23, 42, 0.07);
  --text: rgba(15, 23, 42, 0.90);
  --muted: rgba(15, 23, 42, 0.55);
  --line: rgba(15, 23, 42, 0.12);
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.10);
}

html[data-theme="light"] body {
  background:
    radial-gradient(1100px 600px at 20% 10%, rgba(37, 99, 235, 0.06), transparent 60%),
    radial-gradient(900px 500px at 80% 0%, rgba(45, 212, 191, 0.05), transparent 55%),
    var(--bg);
}

html[data-theme="light"] input {
  background: rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .password-toggle {
  color: rgba(15, 23, 42, 0.75);
}

html[data-theme="light"] .field-error {
  color: #b42318;
}

html[data-theme="light"] .brand {
  border-color: rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.03);
}

html[data-theme="light"] .pill {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.03);
}

html[data-theme="light"] .pill:hover {
  background: rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .smalllinks a {
  color: rgba(15, 23, 42, 0.75);
}

html[data-theme="light"] .btn {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .btn:hover {
  background: rgba(15, 23, 42, 0.07);
}

html[data-theme="light"] .btn--primary {
  border-color: rgba(37, 99, 235, 0.45);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.10));
}

/* Theme toggle */
.auth-theme-toggle {
  font-size: 18px;
  padding: 7px 11px;
  line-height: 1;
  cursor: pointer;
}
