:root {
  --login-primary: #162033;
  --login-primary-soft: #2b3954;
  --login-accent: #7a1f2b;
  --login-accent-hover: #641724;

  --login-text: #111827;
  --login-muted: #4b5563;

  --login-bg: #c8d2df;
  --login-bg-soft: #d5dde8;

  --login-card: #edf1f7;
  --login-card-soft: #e4eaf2;

  --login-border: #aab7c7;
  --login-border-strong: #7d8da3;

  --login-input-bg: #f8fafc;
  --login-input-border: #a8b4c4;

  --login-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);

  --login-radius-lg: 18px;
  --login-radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--login-bg);
  color: var(--login-text);
}

body {
  min-height: 100vh;
}

/* =========================
   Logowanie / reset hasła / zmiana hasła
   ========================= */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 16px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.36) 0, rgba(255, 255, 255, 0) 360px),
    linear-gradient(180deg, #c4cedb 0%, #d6dee9 48%, #c4cedb 100%);
}

.login-header {
  max-width: 380px;
  text-align: center;
}

.login-header h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--login-primary);
  white-space: nowrap;
}

.login-header p {
  margin: 10px 0 0;
  color: var(--login-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.login-box,
.box.login-box {
  width: min(100%, 380px);
  max-width: 380px;
  background: var(--login-card);
  border: 1px solid var(--login-border);
  border-radius: var(--login-radius-lg);
  padding: 30px 22px;
  box-shadow: var(--login-shadow);
}

.login-box h2,
.box.login-box h2 {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 650;
  color: var(--login-primary);
  letter-spacing: -0.02em;
  text-align: center;
}

.login-box input[type="email"],
.login-box input[type="password"],
.login-box input[type="text"],
.box.login-box input[type="email"],
.box.login-box input[type="password"],
.box.login-box input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--login-input-border);
  border-radius: var(--login-radius-md);
  background: var(--login-input-bg);
  color: var(--login-text);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.login-box input::placeholder,
.box.login-box input::placeholder {
  color: #8f9aaa;
  font-weight: 400;
}

.login-box input:focus,
.box.login-box input:focus {
  border-color: var(--login-primary-soft);
  box-shadow: 0 0 0 4px rgba(39, 50, 74, 0.12);
  background: #ffffff;
}

.login-password-field {
  position: relative;
}

.login-password-field input {
  padding-right: 52px;
}

.login-toggle-password {
  position: absolute;
  right: 10px;
  top: 23px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--login-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  padding: 0;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    opacity 0.18s ease;
}

.login-toggle-password:hover {
  background: rgba(39, 50, 74, 0.08);
  transform: translateY(-50%) scale(1.03);
}

.password-eye {
  font-size: 17px;
  line-height: 1;
}

.password-eye-closed {
  display: none;
}

.login-toggle-password.is-visible .password-eye-open {
  display: none;
}

.login-toggle-password.is-visible .password-eye-closed {
  display: inline;
}

.login-submit-btn,
.login-box button[type="submit"],
.box.login-box button[type="submit"] {
  width: 100%;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid #1f2937;
  border-radius: var(--login-radius-md);
  background: transparent;
  color: var(--login-text);
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.login-submit-btn:hover,
.login-box button[type="submit"]:hover,
.box.login-box button[type="submit"]:hover {
  transform: translateY(-1px);
  border-color: #ffffff;
  background: var(--login-accent);
  color: #ffffff;
}

.login-submit-btn:disabled,
.login-box button[type="submit"]:disabled,
.box.login-box button[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.login-reset-link {
  margin: 18px 0 0;
  text-align: center;
}

.login-reset-link a {
  color: var(--login-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
}

.login-reset-link a:hover {
  text-decoration: underline;
}

.error {
  display: none;
  margin: 16px 0 0;
  min-height: 20px;
  text-align: center;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

.error.visible {
  display: block;
}

.login-footer {
  text-align: center;
  color: var(--login-muted);
  font-size: 13px;
  font-weight: 400;
}

.login-footer a,
.auth-footer a {
  color: var(--login-primary);
  text-decoration: none;
  font-weight: 550;
}

.login-footer a:hover,
.auth-footer a:hover {
  text-decoration: underline;
}

/* =========================
   Siła hasła
   ========================= */

.login-password-strength {
  margin: -2px 0 14px;
}

.login-strength-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #d1d5db;
}

.login-strength-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: #ef4444;
  transition:
    width 0.25s ease,
    background 0.25s ease;
}

.login-password-strength p {
  margin: 7px 0 0;
  color: var(--login-muted);
  font-size: 12px;
  font-weight: 500;
}

.login-strength-bar.weak {
  background: #ef4444;
}

.login-strength-bar.medium {
  background: #f59e0b;
}

.login-strength-bar.strong {
  background: #16a34a;
}

/* =========================
   Rejestracja — rozszerzony formularz
   ========================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 34px 16px 24px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.36) 0, rgba(255, 255, 255, 0) 360px),
    linear-gradient(180deg, #c4cedb 0%, #d6dee9 48%, #c4cedb 100%);
  color: var(--login-text);
}

.auth-intro {
  width: min(100%, 760px);
  text-align: center;
  margin-bottom: 22px;
}

.auth-intro h2 {
  margin: 0;
  font-size: clamp(25px, 4vw, 35px);
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--login-primary);
}

.auth-intro p {
  margin: 12px auto 0;
  max-width: 620px;
  color: var(--login-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
}

.auth-page .box,
.auth-page .register-box,
.register-box {
  width: min(100%, 760px);
  max-width: 760px;
  background: var(--login-card);
  border: 1px solid var(--login-border);
  border-radius: var(--login-radius-lg);
  padding: 30px 26px;
  box-shadow: var(--login-shadow);
}

.register-box h2,
.auth-page .box h2 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 25px;
  font-weight: 650;
  color: var(--login-primary);
  letter-spacing: -0.02em;
}

.register-section {
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--login-border);
  border-radius: 16px;
  background: var(--login-card-soft);
}

.register-section h3 {
  margin: 0 0 15px;
  font-size: 17px;
  font-weight: 600;
  color: var(--login-primary);
}

.register-box input[type="text"],
.register-box input[type="email"],
.register-box input[type="password"],
.register-box input[type="tel"],
.register-box textarea,
.auth-page .box input[type="text"],
.auth-page .box input[type="email"],
.auth-page .box input[type="password"],
.auth-page .box input[type="tel"],
.auth-page .box textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--login-input-border);
  border-radius: var(--login-radius-md);
  background: var(--login-input-bg);
  color: var(--login-text);
  font-size: 15px;
  font-weight: 400;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.register-box textarea,
.auth-page .box textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

.register-box input::placeholder,
.register-box textarea::placeholder,
.auth-page .box input::placeholder,
.auth-page .box textarea::placeholder {
  color: #8f9aaa;
  font-weight: 400;
}

.register-box input:focus,
.register-box textarea:focus,
.auth-page .box input:focus,
.auth-page .box textarea:focus {
  border-color: var(--login-primary-soft);
  box-shadow: 0 0 0 4px rgba(39, 50, 74, 0.12);
  background: #ffffff;
}

.field-hint {
  display: block;
  margin: -8px 0 14px;
  color: var(--login-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.password-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 18px;
  color: var(--login-muted);
  font-size: 14px;
  font-weight: 450;
}

.password-toggle-row input {
  width: auto;
  margin: 0;
}

.register-box button[type="submit"],
.auth-page .box button[type="submit"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid #1f2937;
  border-radius: var(--login-radius-md);
  background: transparent;
  color: var(--login-text);
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.register-box button[type="submit"]:hover,
.auth-page .box button[type="submit"]:hover {
  transform: translateY(-1px);
  border-color: #ffffff;
  background: var(--login-accent);
  color: #ffffff;
}

.register-box button[type="submit"]:disabled,
.auth-page .box button[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.auth-footer {
  margin-top: 22px;
  text-align: center;
  color: var(--login-muted);
  font-size: 13px;
  font-weight: 400;
}

/* =========================
   Responsywność
   ========================= */

@media (max-width: 700px) {
  .auth-page {
    padding: 24px 12px 20px;
  }

  .auth-page .box,
  .auth-page .register-box,
  .register-box {
    padding: 22px 16px;
    border-radius: 16px;
  }

  .register-box h2,
  .auth-page .box h2 {
    font-size: 22px;
  }

  .register-section {
    padding: 16px;
    border-radius: 14px;
  }

  .register-section h3 {
    font-size: 16px;
  }

  .register-box input[type="text"],
  .register-box input[type="email"],
  .register-box input[type="password"],
  .register-box input[type="tel"],
  .register-box textarea,
  .auth-page .box input[type="text"],
  .auth-page .box input[type="email"],
  .auth-page .box input[type="password"],
  .auth-page .box input[type="tel"],
  .auth-page .box textarea {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  .login-page {
    justify-content: flex-start;
    padding-top: 28px;
  }

  .login-header {
    max-width: 100%;
  }

  .login-header h2 {
    white-space: normal;
    font-size: 24px;
  }

  .login-box,
  .box.login-box {
    width: 100%;
    max-width: 380px;
    padding: 24px 18px;
    border-radius: 16px;
  }

  .login-box h2,
  .box.login-box h2 {
    font-size: 22px;
  }

  .login-box input[type="email"],
  .login-box input[type="password"],
  .login-box input[type="text"],
  .box.login-box input[type="email"],
  .box.login-box input[type="password"],
  .box.login-box input[type="text"] {
    font-size: 16px;
  }

  .login-submit-btn {
    font-size: 16px;
  }

  .login-footer,
  .auth-footer {
    font-size: 12px;
  }
}

.register-password-strength {
  margin: -6px 0 14px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}

.register-password-strength.weak {
  color: #7f1d1d;
  background: rgba(254, 226, 226, 0.72);
  border-color: rgba(127, 29, 29, 0.22);
}

.register-password-strength.medium {
  color: #78350f;
  background: rgba(254, 243, 199, 0.78);
  border-color: rgba(146, 64, 14, 0.22);
}

.register-password-strength.strong {
  color: #14532d;
  background: rgba(220, 252, 231, 0.78);
  border-color: rgba(22, 101, 52, 0.22);
}