/* ============================================================
   assets/css/auth.css — Telas de autenticação Omni3
   HealthTech premium · glass · mobile-first
   ============================================================ */

.hidden { display: none !important; }

.auth-page {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-body, "Outfit", system-ui, sans-serif);
  color: var(--omni-ink, #0B1F3A);
  background: var(--omni-mist, #F4F7FB);
}

/* ---- Fundo imersivo (CSS only, sem stock médico) ---- */
.auth-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-bg__base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 12% 8%, rgba(31, 166, 160, 0.28), transparent 55%),
    radial-gradient(ellipse 80% 60% at 92% 88%, rgba(107, 107, 201, 0.22), transparent 50%),
    radial-gradient(ellipse 50% 40% at 70% 20%, rgba(11, 31, 58, 0.08), transparent 60%),
    linear-gradient(160deg, #E8F4F3 0%, #F4F7FB 42%, #EEF0F8 100%);
}

.auth-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: auth-float 14s ease-in-out infinite;
}

.auth-bg__orb--a {
  width: min(42vw, 380px);
  height: min(42vw, 380px);
  top: -8%;
  left: -6%;
  background: radial-gradient(circle, rgba(31, 166, 160, 0.35), transparent 70%);
}

.auth-bg__orb--b {
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  bottom: -12%;
  right: -8%;
  background: radial-gradient(circle, rgba(107, 107, 201, 0.28), transparent 70%);
  animation-delay: -4s;
}

.auth-bg__orb--c {
  width: min(28vw, 240px);
  height: min(28vw, 240px);
  top: 42%;
  left: 48%;
  background: radial-gradient(circle, rgba(11, 31, 58, 0.12), transparent 70%);
  animation-delay: -8s;
}

.auth-bg__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(11, 31, 58, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 31, 58, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.auth-bg__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(244, 247, 251, 0.15) 0%,
    rgba(244, 247, 251, 0.55) 100%
  );
}

@keyframes auth-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -18px) scale(1.04); }
}

/* Variantes de atmosfera */
.auth-page--paciente .auth-bg__base {
  background:
    radial-gradient(ellipse 90% 70% at 10% 0%, rgba(31, 166, 160, 0.34), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(88, 214, 207, 0.18), transparent 50%),
    linear-gradient(165deg, #E6F6F5 0%, #F4F7FB 50%, #F0F4FA 100%);
}

.auth-page--profissional .auth-bg__base {
  background:
    radial-gradient(ellipse 85% 65% at 8% 10%, rgba(31, 166, 160, 0.22), transparent 55%),
    radial-gradient(ellipse 75% 55% at 95% 90%, rgba(11, 31, 58, 0.16), transparent 50%),
    linear-gradient(165deg, #E9EEF5 0%, #F4F7FB 48%, #E8EDF4 100%);
}

.auth-page--admin .auth-bg__base {
  background:
    radial-gradient(ellipse 80% 60% at 15% 5%, rgba(11, 31, 58, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 55% at 90% 95%, rgba(107, 107, 201, 0.2), transparent 50%),
    linear-gradient(165deg, #E4EAF2 0%, #F0F3F8 45%, #E8EBF5 100%);
}

.auth-page--admin .auth-bg__orb--a {
  background: radial-gradient(circle, rgba(11, 31, 58, 0.22), transparent 70%);
}

/* ---- Layout ---- */
.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  animation: auth-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---- Card glass ---- */
.auth-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 20px;
  box-shadow:
    0 4px 6px rgba(11, 31, 58, 0.03),
    0 18px 48px rgba(11, 31, 58, 0.1);
  padding: 1.75rem 1.5rem 1.5rem;
}

@media (min-width: 480px) {
  .auth-card {
    padding: 2.25rem 2rem 1.85rem;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .auth-card {
    background: rgba(255, 255, 255, 0.96);
  }
}

/* ---- Brand header ---- */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand__mark {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.9rem;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(11, 31, 58, 0.12);
  margin-bottom: 0.85rem;
}

.auth-brand__mark img {
  width: 72%;
  height: 72%;
  display: block;
}

.auth-brand__name {
  font-family: var(--font-display, "Syne", sans-serif);
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--omni-ink, #0B1F3A);
  line-height: 1;
}

.auth-brand__name .n3 {
  color: var(--omni-teal, #1FA6A0);
}

.auth-brand__tag {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--omni-muted, #5A6B7D);
}

.auth-brand__portal {
  margin-top: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--omni-teal-2, #168F8A);
  background: rgba(31, 166, 160, 0.1);
  border: 1px solid rgba(31, 166, 160, 0.18);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}

.auth-page--profissional .auth-brand__portal {
  color: var(--omni-navy, #0B1F3A);
  background: rgba(11, 31, 58, 0.06);
  border-color: rgba(11, 31, 58, 0.1);
}

.auth-page--admin .auth-brand__portal {
  color: var(--omni-purple-2, #5555B0);
  background: rgba(107, 107, 201, 0.1);
  border-color: rgba(107, 107, 201, 0.2);
}

/* ---- Headings ---- */
.auth-title {
  font-family: var(--font-display, "Syne", sans-serif);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--omni-ink, #0B1F3A);
  margin: 0 0 0.35rem;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--omni-muted, #5A6B7D);
  margin: 0 0 1.35rem;
  line-height: 1.45;
}

/* ---- Alerts ---- */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.4;
  margin-bottom: 1.1rem;
}

.auth-alert svg {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.1rem;
}

.auth-alert--error {
  background: rgba(229, 72, 77, 0.08);
  border: 1px solid rgba(229, 72, 77, 0.22);
  color: #9F1D23;
}

.auth-alert--ok {
  background: rgba(31, 166, 160, 0.1);
  border: 1px solid rgba(31, 166, 160, 0.22);
  color: #0E5C56;
}

/* ---- Fields ---- */
.auth-field {
  margin-bottom: 1rem;
}

.auth-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--omni-muted, #5A6B7D);
  margin-bottom: 0.4rem;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  appearance: none;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--omni-line, #D7E0EA);
  border-radius: 12px;
  padding: 0.78rem 1rem;
  font-size: 0.95rem;
  color: var(--omni-ink, #0B1F3A);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  min-height: 48px;
}

.auth-input::placeholder {
  color: #94A3B8;
}

.auth-input:hover {
  border-color: #C5D0DC;
}

.auth-input:focus {
  outline: none;
  border-color: var(--omni-teal, #1FA6A0);
  box-shadow: 0 0 0 3px rgba(31, 166, 160, 0.2);
  background: #fff;
}

.auth-input--password {
  padding-right: 2.85rem;
}

.auth-input-error {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--omni-danger, #E5484D);
}

.auth-input-error.is-visible {
  display: block;
}

.auth-toggle-pass {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--omni-muted, #5A6B7D);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.auth-toggle-pass:hover,
.auth-toggle-pass:focus-visible {
  color: var(--omni-teal, #1FA6A0);
  background: rgba(31, 166, 160, 0.08);
  outline: none;
}

.auth-toggle-pass svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ---- Buttons ---- */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  text-decoration: none;
}

.auth-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.auth-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--omni-teal, #1FA6A0) 0%, var(--omni-teal-2, #168F8A) 55%, #0F6E6A 100%);
  box-shadow: 0 8px 22px rgba(31, 166, 160, 0.28);
}

.auth-btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(31, 166, 160, 0.34);
}

.auth-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.auth-page--admin .auth-btn--primary {
  background: linear-gradient(135deg, var(--omni-navy, #0B1F3A) 0%, #163A5E 60%, var(--omni-purple, #6B6BC9) 120%);
  box-shadow: 0 8px 22px rgba(11, 31, 58, 0.28);
}

.auth-page--admin .auth-btn--primary:hover:not(:disabled) {
  box-shadow: 0 12px 28px rgba(11, 31, 58, 0.36);
}

.auth-btn--ghost {
  color: var(--omni-teal-2, #168F8A);
  background: transparent;
  border: 1.5px solid rgba(31, 166, 160, 0.28);
  box-shadow: none;
}

.auth-btn--ghost:hover {
  background: rgba(31, 166, 160, 0.07);
  border-color: rgba(31, 166, 160, 0.4);
}

.auth-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  display: none;
}

.auth-btn.is-loading .auth-spinner {
  display: inline-block;
}

.auth-btn.is-loading .auth-btn__label {
  opacity: 0.92;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* ---- Links / footer ---- */
.auth-links {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--omni-muted, #5A6B7D);
}

.auth-links a {
  color: var(--omni-teal, #1FA6A0);
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-divider {
  margin: 1.35rem 0 1.1rem;
  border: 0;
  border-top: 1px solid rgba(215, 224, 234, 0.85);
}

.auth-footer-nav {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--omni-muted, #5A6B7D);
}

.auth-footer-nav a {
  color: var(--omni-teal, #1FA6A0);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-copy {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.72rem;
  color: #94A3B8;
}

/* ---- Demo box (dev) ---- */
.auth-demo {
  margin-top: 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(244, 247, 251, 0.85);
  border: 1px solid var(--omni-line, #D7E0EA);
  font-size: 0.75rem;
  color: var(--omni-muted, #5A6B7D);
}

.auth-demo__title {
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--omni-ink, #0B1F3A);
  margin-bottom: 0.45rem;
}

.auth-demo__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.auth-demo button {
  border: none;
  background: transparent;
  color: var(--omni-teal, #1FA6A0);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.auth-demo button:hover {
  color: var(--omni-teal-2, #168F8A);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .auth-shell,
  .auth-bg__orb,
  .auth-btn,
  .auth-input {
    animation: none !important;
    transition: none !important;
  }
}
