:root {
  color-scheme: light;
  --auth-bg: #f6f8fb;
  --auth-bg-soft: #eef3f8;
  --auth-surface: #ffffff;
  --auth-surface-soft: #f7f9fb;
  --auth-text: #102033;
  --auth-text-soft: #2f4357;
  --auth-muted: #526274;
  --auth-line: #d8e0e9;
  --auth-line-strong: #b7c4d1;
  --auth-cyan: #00758f;
  --auth-cyan-soft: rgba(0, 117, 143, .1);
  --auth-orange: #c94716;
  --auth-orange-hover: #ad3b12;
  --auth-green: #16784a;
  --auth-green-soft: rgba(22, 120, 74, .1);
  --auth-red: #b63851;
  --auth-red-soft: rgba(182, 56, 81, .1);
  --auth-focus: rgba(0, 117, 143, .18);
  --auth-shadow: 0 24px 70px rgba(15, 32, 51, .14);
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--auth-bg);
}

body.o2-auth-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding: 34px;
  background:
    radial-gradient(circle at 14% -8%, rgba(90, 196, 211, .2), transparent 34rem),
    radial-gradient(circle at 100% 38%, rgba(128, 203, 177, .13), transparent 38rem),
    linear-gradient(145deg, #f3f8f8 0%, var(--auth-bg) 48%, #f2f7f9 100%);
  color: var(--auth-text);
  font: 15px/1.58 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.o2-auth-page::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 32, 51, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 32, 51, .025) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  pointer-events: none;
}

/*
 * A autenticacao administrativa continua isolada da sessao do cliente, mas
 * recebe um ambiente visual proprio. O formulario permanece claro para manter
 * contraste, autofill e legibilidade previsiveis em todos os navegadores.
 */
body.o2-auth-page--admin {
  background:
    radial-gradient(circle at 14% -8%, rgba(0, 171, 203, .22), transparent 34rem),
    radial-gradient(circle at 100% 42%, rgba(30, 91, 125, .2), transparent 38rem),
    linear-gradient(145deg, #07111f 0%, #0b1727 50%, #071320 100%);
  color: #eaf3fa;
}

body.o2-auth-page--admin::before {
  background-image:
    linear-gradient(rgba(195, 223, 239, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(195, 223, 239, .045) 1px, transparent 1px);
}

.o2-auth-page--admin .o2-auth-brand-mark {
  border-color: rgba(91, 215, 235, .28);
  background: rgba(14, 169, 197, .14);
  color: #68d8ea;
}

.o2-auth-page--admin .o2-auth-brand-copy strong,
.o2-auth-page--admin .o2-auth-context h1 {
  color: #f5f9fc;
}

.o2-auth-page--admin .o2-auth-brand-copy small,
.o2-auth-page--admin .o2-auth-context-copy {
  color: #adc0d0;
}

.o2-auth-page--admin .o2-auth-eyebrow {
  color: #68d8ea;
}

.o2-auth-page--admin .o2-auth-card {
  border-color: rgba(203, 219, 232, .82);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 30px 90px rgba(0, 5, 14, .42);
}

.o2-auth-page--admin .o2-auth-card .o2-auth-eyebrow {
  color: var(--auth-cyan);
}

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

.o2-auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 1040px);
  min-height: calc(100vh - 68px);
  grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
  align-items: center;
  gap: clamp(44px, 7vw, 92px);
  margin: 0 auto;
}

.o2-auth-context {
  min-width: 0;
  padding: 28px 0;
}

.o2-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 54px;
}

.o2-auth-brand-mark {
  display: inline-flex;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 117, 143, .18);
  border-radius: 14px;
  background: var(--auth-cyan-soft);
  color: var(--auth-cyan);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.o2-auth-brand-logo {
  display: block;
  width: auto;
  max-width: 148px;
  height: 44px;
  object-fit: contain;
}

.o2-auth-brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.o2-auth-brand-copy strong {
  color: var(--auth-text);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.015em;
}

.o2-auth-brand-copy small {
  color: var(--auth-muted);
  font-size: 11px;
  font-weight: 650;
}

.o2-auth-eyebrow {
  margin: 0 0 10px;
  color: var(--auth-cyan);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.o2-auth-context h1 {
  max-width: 610px;
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(42px, 5vw, 62px);
  line-height: .99;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.o2-auth-context-copy {
  max-width: 590px;
  margin: 20px 0 0;
  color: var(--auth-text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.o2-auth-card {
  width: 100%;
  border: 1px solid var(--auth-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  padding: 38px;
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(18px);
}

.o2-auth-card-heading {
  margin-bottom: 26px;
}

.o2-auth-card-heading h2,
.o2-auth-card-heading h1 {
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(27px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.o2-auth-card-intro {
  margin: 11px 0 0;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.65;
}

.o2-auth-notice,
.o2-auth-alert,
.reset-alert {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0 0 22px;
  border: 1px solid var(--auth-line);
  border-radius: 11px;
  background: var(--auth-surface-soft);
  color: var(--auth-muted);
  padding: 13px 14px;
  font-size: 13px;
  line-height: 1.55;
}

.o2-auth-notice::before,
.o2-auth-alert::before,
.reset-alert::before {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--auth-cyan-soft);
  color: var(--auth-cyan);
  content: "i";
  font-size: 12px;
  font-weight: 900;
}

.o2-auth-alert.success,
.reset-alert.success {
  border-color: rgba(22, 120, 74, .3);
  background: var(--auth-green-soft);
  color: var(--auth-green);
}

.o2-auth-alert.success::before,
.reset-alert.success::before {
  background: rgba(22, 120, 74, .12);
  color: var(--auth-green);
  content: "✓";
}

.o2-auth-alert.error,
.reset-alert.error {
  border-color: rgba(182, 56, 81, .32);
  background: var(--auth-red-soft);
  color: var(--auth-red);
}

.o2-auth-alert.error::before,
.reset-alert.error::before {
  background: rgba(182, 56, 81, .12);
  color: var(--auth-red);
  content: "!";
}

.o2-auth-form {
  display: grid;
  gap: 18px;
}

.o2-auth-field {
  min-width: 0;
}

.o2-auth-field label,
.o2-auth-card form > label {
  display: block;
  margin: 0 0 7px;
  color: var(--auth-text-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.o2-auth-field input,
.o2-auth-card form > input:not([type="hidden"]) {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: var(--auth-surface);
  color: var(--auth-text);
  padding: 12px 14px;
  font: inherit;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.o2-auth-field input::placeholder,
.o2-auth-card form > input::placeholder {
  color: #748295;
}

.o2-auth-field input:focus,
.o2-auth-card form > input:not([type="hidden"]):focus {
  border-color: var(--auth-cyan);
  background: #fff;
  box-shadow: 0 0 0 3px var(--auth-focus);
}

.o2-auth-field input:-webkit-autofill,
.o2-auth-field input:-webkit-autofill:hover,
.o2-auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-text);
  -webkit-box-shadow: 0 0 0 1000px var(--auth-surface) inset;
}

.o2-auth-form-actions {
  display: grid;
  gap: 13px;
  margin-top: 2px;
}

.o2-auth-submit,
.o2-auth-card button[type="submit"] {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--auth-orange);
  border-radius: 10px;
  background: var(--auth-orange);
  color: #fff;
  cursor: pointer;
  padding: 12px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(201, 71, 22, .17);
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.o2-auth-submit:hover,
.o2-auth-submit:focus-visible,
.o2-auth-card button[type="submit"]:hover,
.o2-auth-card button[type="submit"]:focus-visible {
  border-color: var(--auth-orange-hover);
  background: var(--auth-orange-hover);
  box-shadow: 0 12px 28px rgba(201, 71, 22, .22);
  transform: translateY(-1px);
}

.o2-auth-link,
.o2-auth-forgot,
.reset-back {
  color: var(--auth-cyan);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.o2-auth-link:hover,
.o2-auth-link:focus-visible,
.o2-auth-forgot:hover,
.o2-auth-forgot:focus-visible,
.reset-back:hover,
.reset-back:focus-visible {
  color: #005f74;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.o2-auth-forgot {
  justify-self: end;
  margin-top: -7px;
}

.o2-auth-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 24px;
  border-top: 1px solid var(--auth-line);
  padding-top: 20px;
  color: var(--auth-muted);
  font-size: 11px;
  text-align: center;
}

.o2-auth-card-footer::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--auth-green);
  content: "";
}

.o2-auth-return,
.reset-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
}

.o2-auth-return::before,
.reset-back::before {
  content: "←";
}

.o2-auth-help,
.reset-help {
  margin: 20px 0 0;
  border-top: 1px solid var(--auth-line);
  padding-top: 18px;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.65;
}

/* Compatibilidade temporaria com os nomes historicos da recuperacao. */
.reset-shell {
  display: contents;
}

.reset-panel {
  width: 100%;
}

@media (max-width: 860px) {
  body.o2-auth-page {
    padding: 26px 20px 38px;
  }

  .o2-auth-shell {
    width: min(100%, 540px);
    min-height: auto;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 30px;
  }

  .o2-auth-context {
    padding: 10px 4px 0;
    text-align: center;
  }

  .o2-auth-brand {
    justify-content: center;
    margin-bottom: 28px;
    text-align: left;
  }

  .o2-auth-context h1 {
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(36px, 9vw, 48px);
  }

  .o2-auth-context-copy {
    margin-right: auto;
    margin-left: auto;
  }

}

@media (max-width: 520px) {
  body.o2-auth-page {
    padding: 20px 14px 30px;
  }

  .o2-auth-context {
    padding-top: 0;
  }

  .o2-auth-brand {
    margin-bottom: 22px;
  }

  .o2-auth-brand-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 12px;
  }

  .o2-auth-context h1 {
    font-size: 36px;
  }

  .o2-auth-context-copy {
    margin-top: 14px;
    font-size: 14px;
  }

  .o2-auth-card {
    border-radius: 16px;
    padding: 27px 22px;
  }

  .o2-auth-card-heading h2,
  .o2-auth-card-heading h1 {
    font-size: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .o2-auth-page *,
  .o2-auth-page *::before,
  .o2-auth-page *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
