/* Portal de acesso — estilo referência (cartão escuro, tabs, azul #3b82f6) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

.auth-portal {
  --auth-bg: #0a0f1e;
  --auth-card: #1e293b;
  --auth-card-border: rgba(148, 163, 184, 0.12);
  --auth-accent: #0066ff;
  --auth-accent-hover: #0052cc;
  --auth-text: #f8fafc;
  --auth-muted: #94a3b8;
  --auth-input-bg: #0f172a;
  --auth-radius: 12px;
  --auth-radius-sm: 8px;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2.5rem 1rem 3rem;
  position: relative;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--auth-bg);
  color: var(--auth-text);
}

.auth-portal-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(59, 130, 246, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(99, 102, 241, 0.08), transparent),
    var(--auth-bg);
  pointer-events: none;
  z-index: 0;
}

.auth-portal-logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.auth-logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  transform: rotate(45deg);
}

.auth-logo-mark span {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--auth-accent), #6366f1);
  opacity: 0.95;
}

.auth-logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--auth-text);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--auth-card);
  border: 1px solid var(--auth-card-border);
  border-radius: var(--auth-radius);
  padding: 1.75rem 1.75rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.auth-tabs {
  display: flex;
  padding: 4px;
  margin-bottom: 1.5rem;
  background: var(--auth-input-bg);
  border-radius: 999px;
  border: 1px solid var(--auth-card-border);
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--auth-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: var(--auth-accent);
  color: #fff;
}

.auth-tab:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
}

.auth-panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

#auth-panel-register > h1 {
  margin-bottom: 1.25rem;
}

.auth-lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e0f2fe;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 999px;
}

.auth-form .field {
  margin-bottom: 1rem;
}

.auth-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--auth-text);
}

.auth-form input:not([type="checkbox"]) {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--auth-text);
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-card-border);
  border-radius: var(--auth-radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-password-wrap {
  position: relative;
  width: 100%;
}

.auth-password-wrap input:not([type="checkbox"]) {
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: none;
  border-radius: var(--auth-radius-sm);
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s, background 0.15s;
}

.auth-password-toggle:hover {
  color: var(--auth-text);
  background: rgba(248, 250, 252, 0.06);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 1px;
}

.auth-pw-icon--hide {
  display: none;
}

.auth-password-wrap.is-visible .auth-pw-icon--show {
  display: none;
}

.auth-password-wrap.is-visible .auth-pw-icon--hide {
  display: block;
}

html[data-theme="light"] .auth-password-toggle:hover {
  background: rgba(15, 23, 42, 0.06);
}

.auth-form input::placeholder {
  color: #64748b;
}

.auth-form input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-form input.auth-input-mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem;
}

.auth-form input[readonly] {
  opacity: 0.95;
  cursor: default;
}

.auth-field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--auth-muted);
  line-height: 1.35;
}

.auth-divider {
  margin: 1.25rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--auth-card-border);
}

.auth-section-title {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--auth-muted);
}

.auth-row-actions {
  display: flex;
  justify-content: flex-end;
  margin: -0.35rem 0 0.85rem;
}

.auth-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--auth-accent);
  cursor: pointer;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--auth-accent);
  border: none;
  border-radius: var(--auth-radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.auth-submit:hover {
  background: var(--auth-accent-hover);
}

.auth-submit:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.auth-footnote {
  margin: 1.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--auth-muted);
  text-align: center;
}

.auth-panel[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.35rem 1.25rem 1.75rem;
  }
}

/* Tema claro: cartão e texto escuros no login ficavam ilegíveis sobre fundo claro herdado. */
html[data-theme="light"] .auth-portal {
  --auth-bg: #f0f4f8;
  --auth-card: #ffffff;
  --auth-card-border: rgba(15, 23, 42, 0.1);
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-input-bg: #f1f5f9;
}

html[data-theme="light"] .auth-portal-bg {
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(59, 130, 246, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(99, 102, 241, 0.08), transparent),
    var(--auth-bg);
}

html[data-theme="light"] .auth-card {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .auth-badge {
  color: #0369a1;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
}

/* Login split — mockup ecrã 13 */
body.auth-split {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

.auth-split-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

@media (max-width: 860px) {
  .auth-split-wrap { grid-template-columns: 1fr; }
  .auth-split-brand { min-height: 220px; }
}

.auth-split-brand {
  position: relative;
  overflow: hidden;
  background: #0a1128;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}

.auth-split-brand-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(10, 17, 40, 0.92) 0%, rgba(0, 102, 255, 0.65) 100%),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1200&q=80") center/cover no-repeat;
  z-index: 0;
}

.auth-split-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.auth-logo-mark--lg {
  width: 52px;
  height: 52px;
}

.auth-logo-mark--lg span {
  width: 18px;
  height: 18px;
}

.auth-logo-mark--sm {
  width: 32px;
  height: 32px;
}

.auth-logo-mark--sm span {
  width: 11px;
  height: 11px;
}

.auth-brand-sub {
  color: #cbd5e1;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.auth-split-brand h1 {
  font-size: 1.85rem;
  margin: 1rem 0 0.35rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.auth-split-brand p {
  color: #cbd5e1;
  margin: 0 0 1.5rem;
}

.auth-split-features {
  margin: 0;
  padding-left: 1.2rem;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.7;
}

.auth-split-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f8fafc;
}

.auth-card--light {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2.25rem 2rem;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

.auth-card-logo {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 860px) {
  .auth-card-logo {
    display: flex;
  }
}

.auth-card-logo strong {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #001f3f;
}

.auth-card--light .auth-form input {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  border-radius: 8px;
  padding: 0.72rem 0.9rem;
}

.auth-card--light .auth-form input:focus {
  border-color: #0066ff;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.auth-card--light .auth-submit {
  background: #0066ff;
  border-radius: 8px;
  padding: 0.82rem 1rem;
  margin-top: 0.5rem;
}

.auth-card--light .auth-submit:hover {
  background: #0052cc;
}

.auth-card--light h2 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
}

.auth-card--light .auth-lead {
  color: #64748b;
  margin-bottom: 1.5rem;
}

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.auth-card--light .auth-link {
  color: #0066ff;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
}

.auth-card--light .auth-footnote {
  margin-top: 1.25rem;
  color: #94a3b8;
  font-size: 0.75rem;
}

