/*
 * Login and password recovery under the Grupo Reina Madre umbrella, editorial split:
 * form side on the left (clinic logo, form, group footer), panel with the system
 * name on the right. Document order matches.
 * Spec: grm-pml docs/plans/2026-10-08-login-sombrilla-grm-design.md (ERM uses the
 * Reina Madre pink tokens; only token values differ from grm-pml).
 * Flat by design: no shadows, gradients, animations or transitions.
 */
.auth {
  --auth-accent: #C2457A;
  --auth-accent-strong: #A3355F;
  --auth-panel: #FBEEF3;
  --auth-panel-ink: #4A1F33;
  --auth-page: #FFFFFF;
  --auth-border: #E6E1EB;
  --auth-input-border: #D9D3DF;
  --auth-ink: #2B2433;
  --auth-muted: #5C5466;
  --auth-subtle: #6E6678;

  box-sizing: border-box;
  min-height: 100vh;
  margin: 0;
  display: flex;
  background: var(--auth-page);
  color: var(--auth-ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.auth *,
.auth *::before,
.auth *::after {
  box-sizing: border-box;
}

/* Brand panel */
.auth-brand {
  flex: 0 0 46%;
  max-width: 600px;
  min-height: 100vh;
  padding: 64px 72px;
  background: var(--auth-panel);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-logo {
  display: block;
  align-self: flex-start;
  height: 56px;
  width: auto;
  max-width: 100%;
}

.auth-headline {
  margin: 0;
  font-size: 60px;
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--auth-panel-ink);
}

.auth-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  font-size: 12px;
  color: var(--auth-subtle);
}

.auth-footer img {
  display: block;
  height: 32px;
  width: auto;
}

/* Form side: clinic logo top left, form centered, group footer bottom left. */
.auth-main {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 64px 72px;
}

.auth-panel-body {
  align-self: center;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.auth-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-intro h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--auth-ink);
}

.auth-intro p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--auth-muted);
}

.auth-intro strong {
  color: var(--auth-ink);
  overflow-wrap: anywhere;
}

.auth-form {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-field label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-ink);
}

.auth-field input {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
  background: #FFFFFF;
  color: var(--auth-ink);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
}

.auth-field input.auth-code {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.auth-field input::placeholder {
  color: var(--auth-subtle);
  letter-spacing: normal;
  font-weight: 400;
  font-size: 15px;
}

.auth-hint {
  font-size: 12px;
  color: var(--auth-subtle);
}

.auth a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth a:hover {
  color: var(--auth-accent-strong);
}

.auth-forgot {
  font-size: 13px;
}

.auth-button {
  width: 100%;
  height: 54px;
  margin: 6px 0 0;
  border: 0;
  border-radius: 12px;
  background: var(--auth-accent);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.auth-button:hover {
  background: var(--auth-accent-strong);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--auth-subtle);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--auth-border);
}

.auth .auth-button-outline {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
  background: #FFFFFF;
  color: var(--auth-ink);
  font-size: 15px;
  font-weight: 700;
}

.auth .auth-button-outline:hover {
  color: var(--auth-ink);
  border-color: var(--auth-subtle);
}

.auth-back {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.auth input:focus-visible,
.auth button:focus-visible,
.auth a:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
}

/* Phones and narrow tablets: the panel becomes a band with the system name above
   the form side, which keeps the logo on top and the group footer at the end. */
@media (max-width: 900px) {
  .auth {
    flex-direction: column;
  }

  .auth-brand {
    order: -1;
    flex: none;
    max-width: none;
    min-height: 0;
    padding: 24px;
  }

  .auth-headline {
    font-size: 28px;
  }

  .auth-main {
    min-height: 0;
    justify-content: flex-start;
    gap: 32px;
    padding: 28px 24px 40px;
  }

  .auth-logo {
    height: 44px;
  }
}

/*
 * ERM: Bootstrap stays loaded for the login's super admin modal, and the recovery
 * pages keep input[type="button"] and input[type="submit"] because RecoveryPass()
 * and the set-password validation are wired to them. Bootstrap styles those
 * inputs with a higher specificity than a single class, so these rules win.
 */
.auth .auth-button {
  -webkit-appearance: none;
  appearance: none;
}

.auth input.auth-button {
  padding: 0;
  line-height: 54px;
}

.auth .auth-field input:disabled {
  background: #F5F3F7;
  color: var(--auth-muted);
}
