/* 1. Import czcionki Optimistic Text Medium */
@font-face {
  font-family: "Optimistic Text Medium";
  src: url("/fonts/OptimisticText-Medium.woff2") format("woff2"),
       url("/fonts/OptimisticText-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* 2. Variables */
:root {
  --text-primary: hsl(0, 0%, 100%);
  --text-secondary: hsl(204, 100%, 48%);
  --text-placeholder: hsl(0, 0%, 56%);
  --bg-image: url('back.png') center center / cover no-repeat;
  --bg-input: hsl(0, 0%, 15%);
  --bg-border: hsl(200, 16%, 30%);
  --btn-primary-bg: rgb(0, 100, 224);
  --btn-primary-text: hsl(0, 0%, 100%);
  --btn-secondary-border: rgb(69, 153, 254);
  --btn-secondary-text: rgb(71, 165, 250);
  --font-sm: 0.85rem;
}

/* 3. Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
}

/* 4. Full-page centering */
html,
body {
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-image);
  color: var(--text-primary);
  padding: env(safe-area-inset);
}

/* 5. Container */
.login-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: calc(100% - 48px);
  height: 100%;
  padding: 1rem 0;
}

/* 6. Language & Logo */
.language { font-size: var(--font-sm); }
.hero { display: flex; justify-content: center; align-items: center; }
.logo { width: 60px; height: 60px; }

/* 7. Form */
.auth-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

/* 8. Inputs */
.bloks-input {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 64px;
  padding: 0 16px;
  background: rgb(28, 43, 51);

  border: 1px solid var(--bg-border);
  border-radius: 12px;
  cursor: text;
}
.bloks-input input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: "Optimistic Text Medium", sans-serif;
  font-size: 16px;
  line-height: 1.3;
}
.bloks-input input::placeholder {
  color: rgb(133, 149, 164);
}

/* 9. Eye toggle – zmienione */
.password-field .password-toggle {
  position: absolute;
  right: 24px;
  background: none;
  border: none;
  display: none;               /* domyślnie ukryte */
  align-items: center;
  justify-content: center;
  color: var(--text-primary);  /* białe oko */
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease; /* lekka animacja przy kliknięciu */
}

/* pokazujemy dopiero gdy jest treść w polu */
.password-field.has-content .password-toggle {
  display: flex;
}

/* SVG: oko zawsze białe (stroke=currentColor), a pupil w środku też */
.password-toggle svg {
  stroke: currentColor;
  fill: none;
}

/* animacja linią przekreślenia */
.password-toggle .slash {
  stroke-dasharray: 30;           /* długość kreski */
  stroke-dashoffset: 30;          /* początkowo całkowicie ukryte */
  transition: stroke-dashoffset 0.3s ease;
}

/* po przełączeniu widoczności hasła “rysujemy” przekreślenie */
.password-toggle.visible .slash {
  stroke-dashoffset: 0;
}

/* przygaszone oko po otwieraniu */
.password-toggle.visible .eye,
.password-toggle.visible .pupil {
  opacity: 0.3;
}


/* 10. “Zaloguj się” (główny przycisk) */
.btn-primary {
  width: calc(100% - 16px);
  margin: 0 16px;
  height: 44px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: none;
  border-radius: 32px;
  font-family: "Optimistic Text Medium", sans-serif;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* 11. “Nie pamiętasz hasła?” (link) */
.link {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Optimistic Text Medium", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.link:focus,
.link:active {
  outline: none;
  background: transparent;
  opacity: 1;
}

/* 12. “Utwórz nowe konto” (przycisk sekundarny) */
.btn-secondary {
  width: 100%;
  height: 44px;
  background: transparent;
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 32px;
  font-family: "Optimistic Text Medium", sans-serif;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-top: 1rem;
}

/* 13. Footer */
.footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: var(--text-placeholder);
}
.footer img {
  width: 16px;
  height: 16px;
  margin-top: 1rem;
}

/* Override autofill background & text color */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px var(--bg-input) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  transition: background-color 5000s ease-in-out 0s;
}
.password-toggle .slash {
  opacity: 0;
  transition: opacity 0.1s;
}
.password-toggle.visible .slash {
  opacity: 1;
}
.password-toggle.visible .pupil,
.password-toggle.visible .eye {
  opacity: 0.3; /* lub dowolna wartość, żeby oko było przygaszone */
}
