/* css/login.css
   Dark theme, responsywne, zapobiega "wyjeżdżaniu" pól/formularzy.
   Dopasowane do HTML z twojego posta (main.container, .card, img.logo, #loginForm, modale itp.)
*/

/* --- zmienne kolorów --- */
:root{
  --bg-1: #07080a;
  --bg-2: #0c0e11;
  --panel: #0f1214;
  --panel-2: #0b0d0f;
  --accent: #2ea6ff;
  --accent-2: #1b8de0;
  --muted: #9aa3ad;
  --text: #e6eef6;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,0.6);
  --gap: 12px;
  --max-width: 460px;
}

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

html,body {
  height: 100%;
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  color: var(--text);
}

/* --- główny kontener (twoje <main class="container">) --- */
main.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* --- karta logowania --- */
.card {
  width: 100%;
  max-width: var(--max-width);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);
  overflow: hidden; /* ważne: zapobiega "wyjeżdżaniu" elementów */
}

/* --- logo --- */
.card .logo,
.card img.logo {
  display: block;
  margin: 0 auto 10px;
  width: 140px;
  max-width: 52%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

/* --- tytuł --- */
.card h1 {
  margin: 6px 0 14px;
  text-align: center;
  font-size: 20px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.1;
}

/* --- formularz --- */
#loginForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* etykiety */
#loginForm label,
.card label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* pola - kluczowe: width:100% i box-sizing */
#loginForm input[type="email"],
#loginForm input[type="password"],
#loginForm input[type="text"],
#loginForm input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease, transform .08s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* placeholder */
#loginForm input::placeholder { color: rgba(255,255,255,0.24); }

/* focus */
#loginForm input:focus {
  border-color: rgba(46,166,255,0.28);
  box-shadow: 0 6px 20px rgba(46,166,255,0.06);
  transform: translateY(-1px);
}

/* --- przycisk --- */
#loginForm button[type="submit"],
.card button {
  margin-top: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30,120,200,0.14);
  transition: transform .12s ease, box-shadow .12s ease;
}

/* hover/active */
#loginForm button[type="submit"]:hover { transform: translateY(-2px); }
#loginForm button[type="submit"]:active { transform: translateY(0); }

/* --- drobne linki --- */
p.small {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
p.small a { color: var(--accent); text-decoration: none; }

/* --- modal --- */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,4,6,0.6);
  padding: 18px;
  z-index: 9999;
}
.modal.hidden { display: none; }

/* modal content */
.modal .modal-content,
.modal-content {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg,#111315,#0d0f11);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  color: var(--text);
  overflow: auto; /* jeśli treść duża */
}

/* modal actions (przyciski) */
.modal .modal-actions,
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.modal .modal-actions button,
.modal-actions button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.modal .modal-actions button:first-child,
.modal-actions button:first-child {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* 2FA input - szerokość kontrolowana */
#twofa-code {
  width: 160px;
  max-width: 100%;
  padding: 10px;
  font-size: 18px;
  letter-spacing: 6px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  display: block;
  margin-top: 8px;
}

/* responsywność - małe ekrany */
@media (max-width: 520px) {
  :root { --max-width: 420px; }
  .card { padding: 16px; border-radius: 10px; }
  .card .logo { width: 120px; max-width: 46%; margin-bottom: 8px; }
  .modal .modal-content { max-width: 92%; padding: 14px; }
  #twofa-code { width: 100%; letter-spacing: 4px; font-size: 16px; }
}

/* zapobieganie "wyjeżdżaniu" przy bardzo długich słowach */
.card, .modal .modal-content {
  word-break: break-word;
  hyphens: auto;
}

/* focus outline dla dostępności */
:focus { outline: 3px solid rgba(46,166,255,0.12); outline-offset: 2px; }
