/* Sign-in card: the standalone /login page (login.php) and the header's
   sign-in popup (#login-modal in includes/header.php). Black and white
   only (see styles/variables.css); red is used for errors alone. Dark mode
   swaps the roles (html.dark). */

.rl-auth {
  --rl-auth-bg: #ffffff;
  --rl-auth-text: #000000;
  --rl-auth-muted: #6c757d;
  --rl-auth-border: #d9d9d9;
  --rl-auth-border-focus: #000000;
  --rl-auth-primary-bg: #000000;
  --rl-auth-primary-text: #ffffff;
  --rl-auth-soft: #f5f5f5;
  --rl-auth-error: #c62828;

  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 28px 28px 24px;
  background: var(--rl-auth-bg);
  color: var(--rl-auth-text);
  border: 1px solid var(--rl-auth-border);
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
}
html.dark .rl-auth {
  --rl-auth-bg: #141414;
  --rl-auth-text: #ffffff;
  --rl-auth-muted: #a8a8a8;
  --rl-auth-border: #3a3a3a;
  --rl-auth-border-focus: #ffffff;
  --rl-auth-primary-bg: #ffffff;
  --rl-auth-primary-text: #000000;
  --rl-auth-soft: #1f1f1f;
  --rl-auth-error: #ff8a80;
}
.rl-auth *,
.rl-auth *::before,
.rl-auth *::after { box-sizing: border-box; }

/* The standalone page: card centred under the site header, with room for
   the mobile bottom navigation. */
.rl-auth-page {
  padding: 32px 16px 96px;
  background: transparent;
}

.rl-auth__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--rl-auth-text);
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  opacity: .75;
}
.rl-auth__close:hover,
.rl-auth__close:focus-visible {
  opacity: 1;
  background: var(--rl-auth-soft);
  color: var(--rl-auth-text);
  text-decoration: none;
  outline: none;
}

.rl-auth__logo {
  display: block;
  height: 28px;
  width: auto;
  margin: 0 0 14px;
}
.rl-auth__title {
  margin: 0 40px 20px 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--rl-auth-text);
}

.rl-auth__error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--rl-auth-error);
  border-radius: 10px;
  color: var(--rl-auth-error);
  font-size: 14px;
}

.rl-auth__field { margin: 0 0 12px; }
.rl-auth__sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.rl-auth__input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rl-auth-border);
  border-radius: 10px;
  background: var(--rl-auth-bg);
  color: var(--rl-auth-text);
  font-size: 16px; /* 16px keeps iOS from zooming in on focus */
  box-shadow: none;
  transition: border-color .15s ease;
}
.rl-auth__input::placeholder { color: var(--rl-auth-muted); opacity: 1; }
.rl-auth__input:focus {
  outline: none;
  border-color: var(--rl-auth-border-focus);
  box-shadow: 0 0 0 1px var(--rl-auth-border-focus);
}

.rl-auth__password { position: relative; }
.rl-auth__password .rl-auth__input { padding-right: 52px; }
.rl-auth__toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rl-auth-muted);
  cursor: pointer;
}
.rl-auth__toggle:hover,
.rl-auth__toggle:focus-visible { color: var(--rl-auth-text); background: var(--rl-auth-soft); outline: none; }
.rl-auth__toggle svg { width: 20px; height: 20px; }
.rl-auth__toggle .rl-auth__eye-off { display: none; }
.rl-auth__toggle[aria-pressed="true"] .rl-auth__eye { display: none; }
.rl-auth__toggle[aria-pressed="true"] .rl-auth__eye-off { display: block; }

.rl-auth__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 4px 0 18px;
  font-size: 14px;
}
.rl-auth__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--rl-auth-text);
  cursor: pointer;
  font-weight: 400;
}
.rl-auth__check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--rl-auth-primary-bg);
  cursor: pointer;
}
.rl-auth__link,
.rl-auth__link:visited {
  color: var(--rl-auth-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rl-auth__link:hover,
.rl-auth__link:focus { color: var(--rl-auth-text); text-decoration: none; }

.rl-auth__submit,
.rl-auth__submit:focus {
  display: block;
  width: 100%;
  height: 48px;
  border: 1px solid var(--rl-auth-primary-bg);
  border-radius: 10px;
  background: var(--rl-auth-primary-bg);
  color: var(--rl-auth-primary-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.rl-auth__submit:hover { opacity: .88; }
.rl-auth__submit:focus-visible { outline: 2px solid var(--rl-auth-border-focus); outline-offset: 2px; }

.rl-auth__or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--rl-auth-muted);
  font-size: 14px;
}
.rl-auth__or::before,
.rl-auth__or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--rl-auth-border);
}

.rl-auth__google,
.rl-auth__google:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rl-auth-border);
  border-radius: 10px;
  background: var(--rl-auth-bg);
  color: var(--rl-auth-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.rl-auth__google:hover,
.rl-auth__google:focus { border-color: var(--rl-auth-border-focus); color: var(--rl-auth-text); text-decoration: none; }
.rl-auth__google svg { width: 20px; height: 20px; flex: 0 0 auto; }

.rl-auth__telegram {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  min-height: 0;
}
.rl-auth__telegram iframe { max-width: 100%; }

.rl-auth__signup {
  margin: 20px 0 0;
  text-align: center;
  font-size: 15px;
  color: var(--rl-auth-text);
}
.rl-auth__signup .rl-auth__link { font-weight: 600; }

/* Popup: Bootstrap's .modal-content keeps the behaviour; the card supplies
   the look. */
#login-modal .modal-dialog { max-width: 440px; }
#login-modal .modal-content.rl-auth { padding: 28px 28px 24px; border-radius: 16px; }

@media (max-width: 480px) {
  .rl-auth-page { padding: 16px 16px 96px; }
  .rl-auth,
  #login-modal .modal-content.rl-auth { padding: 22px 18px 20px; border-radius: 14px; }
  .rl-auth__title { font-size: 22px; }
  #login-modal .modal-dialog { margin: 12px; }
}
