/* ------------------------------------------------------------------
   mir-login.css — Mir authentication pages (sign in + password recovery).
   Loaded by layouts/mir_auth.html.erb. Self-contained: no Bootstrap, no
   AdminKit, no third-party toast lib. Everything is namespaced so it
   cannot leak into the rest of the app.
   ------------------------------------------------------------------ */

.mir-auth-body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
}

/* Scoped reset — this layout no longer loads the app-wide stylesheets, so
   padding must count inside each element's declared width (border-box),
   otherwise the padded inputs overflow their column. */
.mir-auth,
.mir-auth *,
.mir-auth *::before,
.mir-auth *::after {
  box-sizing: border-box;
}

.mir-auth {
  --mir-violet: #7B5CF0;
  --mir-violet-dark: #5B3FD6;
  --mir-violet-soft: #EEEBFE;
  --mir-ink: #14142B;
  --mir-muted: #7A7A93;
  --mir-border: #E8E8F2;

  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  overflow-y: auto;
  background: #fff;
  color: var(--mir-ink);
  font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------------------------------------------------------------- left */

.mir-auth__form-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.mir-auth__form-inner {
  width: 100%;
  max-width: 340px;
}

.mir-auth__brand {
  display: block;
  width: 74px;
  height: auto;
  margin: 0 auto 26px;
  border-radius: 14px;
}

.mir-auth__title {
  margin: 0;
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--mir-ink);
}

.mir-auth__subtitle {
  margin: 6px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--mir-muted);
}

/* keeps the gap above the form identical with or without a subtitle */
.mir-auth__form-inner form { margin-top: 30px; }

/* fields */

.mir-auth__field {
  position: relative;
  margin-bottom: 14px;
}

.mir-auth__field-icon {
  position: absolute;
  top: 26px;                  /* half the input height, so an inline error below cannot shift it */
  left: 18px;
  transform: translateY(-50%);
  display: flex;
  color: var(--mir-ink);
  pointer-events: none;
}

.mir-auth__input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 48px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--mir-violet-soft);
  font-size: 14px;
  color: var(--mir-ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.mir-auth__input::placeholder { color: #8E8CA8; opacity: 1; }

.mir-auth__input:focus {
  outline: 0;
  background: #fff;
  border-color: var(--mir-violet);
  box-shadow: 0 0 0 4px rgba(123, 92, 240, .16);
}

/* the password eye toggle */
.mir-auth__reveal {
  position: absolute;
  top: 26px;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mir-muted);
  cursor: pointer;
}

.mir-auth__reveal:hover { color: var(--mir-ink); }

/* remember / forgot row */

.mir-auth__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
  font-size: 12.5px;
}

.mir-auth__remember {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--mir-muted);
  cursor: pointer;
}

.mir-auth__remember input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--mir-violet);
  cursor: pointer;
}

.mir-auth__link {
  color: var(--mir-violet-dark);
  font-weight: 500;
  text-decoration: none;
}

.mir-auth__link:hover { text-decoration: underline; }

/* submit */

.mir-auth__submit-row {
  display: flex;
  justify-content: center;
}

.mir-auth__submit {
  min-width: 132px;
  height: 46px;
  padding: 0 26px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(120deg, #9B8CF7 0%, var(--mir-violet) 45%, #5F42DC 100%);
  box-shadow: 0 10px 22px -8px rgba(91, 63, 214, .75);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}

.mir-auth__submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 26px -8px rgba(91, 63, 214, .85);
}

.mir-auth__submit:active { transform: translateY(1px); }

/* centered link under the form (e.g. "back to sign in") */

.mir-auth__foot {
  margin: 22px 0 0;
  text-align: center;
  font-size: 13px;
}

/* "Login with Others" divider */

.mir-auth__divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 18px;
  font-size: 13px;
  color: var(--mir-muted);
}

.mir-auth__divider::before,
.mir-auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--mir-border);
}

.mir-auth__divider b { color: var(--mir-ink); font-weight: 700; }

.mir-auth__social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  margin-bottom: 12px;
  border: 1px solid var(--mir-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 20, 43, .05);
  font-size: 14px;
  color: var(--mir-ink);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .12s ease;
}

.mir-auth__social:hover {
  color: var(--mir-ink);
  box-shadow: 0 6px 16px rgba(20, 20, 43, .1);
  transform: translateY(-1px);
}

.mir-auth__social b { font-weight: 700; }

/* validation errors — the inline markup comes from
   config/initializers/form_error.rb (field_error_proc) */

.mir-auth__input.is-invalid {
  background: #FDF1F1;
  border-color: #D9534F;
}

.mir-auth__input.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(217, 83, 79, .16);
}

.mir-auth__field .invalid-feedback {
  margin: 7px 0 0 4px;
  font-size: 12.5px;
  color: #C0322E;
}

/* --------------------------------------------------------------- right */

.mir-auth__art-side {
  position: relative;
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  overflow: hidden;
  background: linear-gradient(135deg, #8A6BF3 0%, #7B5CF0 40%, #6544E4 100%);
}

/* the soft concentric waves in the background */
.mir-auth__waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .5;
}

/* ---------------------------------------------------- flash toast (own) */

.mir-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #14142B;
  color: #fff;
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 18px 40px -14px rgba(20, 20, 43, .5);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .25s ease, transform .25s ease;
}

.mir-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.mir-toast--error { background: #D9534F; box-shadow: 0 18px 40px -14px rgba(180, 40, 36, .55); }
.mir-toast--ok    { background: #2FA36B; box-shadow: 0 18px 40px -14px rgba(20, 120, 70, .5); }

/* --------------------------------------------------------- responsive */

@media (max-width: 991.98px) {
  .mir-auth { display: block; }
  .mir-auth__art-side { display: none; }
  .mir-auth__form-side { min-height: 100%; }
}

@media (max-width: 520px) {
  .mir-toast { right: 16px; left: 16px; bottom: 16px; max-width: none; }
}
