:root {
  --cma-teal: #0a4f5c;
  --cma-teal-deep: #063943;
  --cma-blue: #2563eb;
  --cma-blue-dark: #1d4ed8;
  --cma-green: #059669;
  --cma-orange: #ea580c;
  --cma-bg: #f3f5f7;
  --cma-card: #fff;
  --cma-text: #0f172a;
  --cma-muted: #64748b;
  --cma-border: #e2e8f0;
  --cma-field-bg: #f8fafc;
  --cma-radius: 16px;
  --cma-radius-sm: 10px;
  --cma-font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --cma-shadow: 0 24px 48px rgba(0, 20, 24, 0.28);
  --cma-focus: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.conjur-myarea-auth-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--cma-font);
  color: var(--cma-text);
  background-color: #0a4f5c;
  background-image: url("../img/auth-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.cma-auth-bg-overlay {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  background-color: #003032;
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.cma-auth-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.cma-auth-logo {
  display: flex;
  justify-content: center;
  width: 100%;
}

.cma-auth-logo img {
  display: block;
  margin: 0 auto 22px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.cma-auth-footer {
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  text-align: center;
  width: 100%;
  letter-spacing: 0.01em;
}

.cma-card {
  width: 100%;
  background: var(--cma-card);
  border-radius: var(--cma-radius);
  padding: 32px 30px 26px;
  box-shadow: var(--cma-shadow);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.cma-card-head {
  margin-bottom: 22px;
}

.cma-card h1 {
  margin: 0 0 6px;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--cma-blue);
  line-height: 1.15;
}

.cma-sub {
  margin: 0;
  color: var(--cma-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.cma-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cma-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cma-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cma-form label,
.cma-field > label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
  margin: 0;
}

.cma-form input,
.cma-form select,
.cma-form textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--cma-border);
  border-radius: var(--cma-radius-sm);
  font: inherit;
  font-size: 0.95rem;
  color: var(--cma-text);
  box-sizing: border-box;
  background: var(--cma-field-bg);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  outline: none;
  appearance: none;
}

.cma-form input::placeholder,
.cma-form textarea::placeholder {
  color: #94a3b8;
}

.cma-form input:hover,
.cma-form select:hover,
.cma-form textarea:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.cma-password-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.cma-password-wrap input {
  padding-right: 46px !important;
}

.conjur-myarea-auth-body .cma-password-toggle,
.cma-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none !important;
  color: #64748b !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  line-height: 0;
}

.conjur-myarea-auth-body .cma-password-toggle:hover,
.cma-password-toggle:hover {
  color: #2f6fed !important;
  background: rgba(47, 111, 237, 0.08) !important;
}

.cma-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  flex-wrap: nowrap;
}

.conjur-myarea-auth-body .cma-btn,
.conjur-myarea-auth-body button.cma-btn,
.conjur-myarea-auth-body .cma-form .cma-btn,
.conjur-myarea-auth-body .cma-actions .cma-btn-primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 8px !important;
  padding: 11px 28px !important;
  min-height: 42px !important;
  min-width: 112px !important;
  font-family: var(--cma-font) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  cursor: pointer;
  text-decoration: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #2f6fed !important;
  background-image: none !important;
  box-shadow: none !important;
  width: auto !important;
  max-width: none !important;
}

.conjur-myarea-auth-body .cma-btn:hover,
.conjur-myarea-auth-body button.cma-btn:hover,
.conjur-myarea-auth-body .cma-actions .cma-btn-primary:hover {
  background: #1e5ad9 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.cma-resend {
  margin: 4px 0 0;
  text-align: center;
}

.conjur-myarea-auth-body .cma-text-btn,
.cma-text-btn {
  display: inline !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #2f6fed !important;
  -webkit-text-fill-color: #2f6fed !important;
  font-family: var(--cma-font) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  cursor: pointer;
  line-height: 1.4 !important;
}

.conjur-myarea-auth-body .cma-text-btn:hover {
  color: #1e5ad9 !important;
}

.cma-form input:focus,
.cma-form select:focus,
.cma-form textarea:focus {
  border-color: var(--cma-blue);
  background: #fff;
  box-shadow: var(--cma-focus);
}

.cma-form input.is-invalid,
.cma-form input.is-invalid:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.cma-field-msg {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.cma-field-msg.is-error {
  color: #b91c1c;
}

.cma-field-msg.is-ok {
  color: #047857;
}

.cma-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.cma-form input:disabled,
.cma-form select:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  background: #eef2f6;
}

.cma-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.cma-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cma-blue);
  text-decoration: none;
}

.cma-link:hover {
  text-decoration: underline;
}

.cma-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.cma-form-row-end {
  justify-content: flex-end;
}

.cma-form-row-center {
  justify-content: center;
  margin-top: 20px;
}

.cma-alert {
  border-radius: 6px;
  padding: 16px 18px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.cma-alert p {
  margin: 0 0 12px;
}

.cma-alert p:last-child {
  margin-bottom: 0;
}

.cma-alert-success {
  background: #d1e7dd;
  border: 1px solid #a3cfbb;
  color: #0a3622;
}

.cma-alert-success a {
  color: #2f6fed;
  font-weight: 600;
  text-decoration: none;
}

.cma-alert-success a:hover {
  text-decoration: underline;
}

.cma-check {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: #475569;
  margin: 0 !important;
  cursor: pointer;
  user-select: none;
}

.cma-check input {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cma-check-ui {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.cma-check input:checked + .cma-check-ui {
  background: var(--cma-blue);
  border-color: var(--cma-blue);
}

.cma-check input:checked + .cma-check-ui::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cma-check input:focus-visible + .cma-check-ui {
  box-shadow: var(--cma-focus);
}

.cma-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 11px 28px;
  min-height: 42px;
  min-width: 112px;
  font-family: var(--cma-font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  color: #fff !important;
  background: #2f6fed;
  box-shadow: none;
  transition: background 0.15s ease, filter 0.15s ease;
}

.cma-btn:hover,
.cma-btn:focus,
.cma-btn:active {
  color: #fff !important;
  text-decoration: none;
  transform: none;
}

.cma-btn-primary {
  background: #2f6fed;
  box-shadow: none;
}

.cma-btn-primary:hover,
.cma-btn-primary:focus {
  background: #1e5ad9;
  box-shadow: none;
  transform: none;
}

.cma-btn-primary:active {
  background: #184db8;
  transform: none;
}

.cma-btn-success {
  background: #2e9e6a;
  box-shadow: none;
}

.cma-btn-success:hover {
  background: #248555;
}

.cma-btn-teal {
  background: #0d9488;
  box-shadow: none;
}

.cma-btn-teal:hover {
  background: #0f766e;
}

.cma-switch {
  text-align: center;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid #eef2f6;
  color: var(--cma-muted);
  font-size: 0.9rem;
}

.cma-switch a {
  color: var(--cma-blue);
  font-weight: 700;
  text-decoration: none;
}

.cma-switch a:hover {
  text-decoration: underline;
}

.cma-hint {
  margin: 0;
  color: var(--cma-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  background: #f1f5f9;
  border-radius: var(--cma-radius-sm);
  padding: 12px 14px;
}

.cma-msg {
  margin: 0;
  font-size: 0.88rem;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 8px;
  padding: 10px 12px;
}

.cma-msg.is-ok {
  color: #047857;
  background: #ecfdf5;
}

.cma-dev-link {
  margin: 10px 0 0;
  text-align: center;
}

.cma-dev-link a {
  color: #047857;
  font-weight: 700;
  font-size: 0.9rem;
  word-break: break-all;
}

@media (max-width: 520px) {
  .cma-field-row {
    grid-template-columns: 1fr;
  }

  .cma-card {
    padding: 26px 20px 22px;
  }

  .cma-actions {
    flex-wrap: wrap;
  }

  .cma-actions .cma-btn {
    margin-left: auto;
  }
}

/* App shell — Bootstrap-first (tema descarregado nestas páginas) */
.conjur-myarea-app-body {
  min-height: 100vh;
}

.conjur-myarea-app-body .display-6 {
  font-size: 1.75rem;
}

.conjur-myarea-app-body .navbar-brand {
  color: var(--cma-text);
}

.conjur-myarea-app-body .cma-icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b !important;
  text-decoration: none !important;
  border-radius: 8px;
}

.conjur-myarea-app-body .cma-icon-btn:hover,
.conjur-myarea-app-body .cma-icon-btn:focus,
.conjur-myarea-app-body .cma-icon-btn.show {
  color: #2563eb !important;
  background: #eff6ff;
}

.conjur-myarea-app-body .cma-notif-badge {
  font-size: 0.65rem;
  min-width: 1.1rem;
}

.conjur-myarea-app-body .cma-notif-menu {
  width: min(320px, 92vw);
  padding: 0;
  margin-top: 8px !important;
  border-radius: 10px;
  overflow: hidden;
}

.conjur-myarea-app-body .cma-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #eef2f7;
}

.conjur-myarea-app-body .cma-notif-head strong {
  font-size: 1rem;
  color: #1e293b;
}

.conjur-myarea-app-body .cma-notif-mark {
  font-size: 0.8rem;
  color: #2563eb !important;
  text-decoration: none !important;
}

.conjur-myarea-app-body .cma-notif-list {
  max-height: 320px;
  overflow: auto;
  padding: 8px 0;
}

.conjur-myarea-app-body .cma-notif-empty {
  padding: 18px 16px 22px;
  color: #94a3b8;
  font-size: 0.92rem;
}

.conjur-myarea-app-body .cma-notif-item {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
}

.conjur-myarea-app-body .cma-notif-item:hover {
  background: #f8fafc;
}

.conjur-myarea-app-body .cma-notif-item.is-unread {
  background: #f8fbff;
  border-left-color: #3b82f6;
}

.conjur-myarea-app-body .cma-notif-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.conjur-myarea-app-body .cma-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.conjur-myarea-app-body .cma-user-avatar-fallback {
  display: inline-block;
}

.conjur-myarea-app-body .cma-user-chip {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.conjur-myarea-app-body .cma-nav-home {
  opacity: 0.75;
}

.conjur-myarea-app-body .cma-hero-card {
  background-color: #3b82f6;
  background-image:
    radial-gradient(circle at 12% 28%, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.1) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 40% 72%, rgba(255, 255, 255, 0.1) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 68%, rgba(255, 255, 255, 0.08) 0 1.5px, transparent 2.5px),
    linear-gradient(135deg, #3b82f6, #2563eb);
  background-size: 48px 48px, 36px 36px, 42px 42px, 30px 30px, auto;
  min-height: 180px;
}

.conjur-myarea-app-body .cma-stat-card {
  position: relative;
  overflow: hidden;
}

.conjur-myarea-app-body .cma-stat-card::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.conjur-myarea-app-body .cma-stat-card-blue::after { background: #60a5fa; }
.conjur-myarea-app-body .cma-stat-card-green::after { background: #34d399; }
.conjur-myarea-app-body .cma-stat-card-orange::after { background: #fb923c; }

.conjur-myarea-app-body .cma-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.conjur-myarea-app-body .cma-stat-blue {
  background: #dbeafe;
  color: #2563eb;
}

.conjur-myarea-app-body .cma-stat-green {
  background: #d1fae5;
  color: #059669;
}

.conjur-myarea-app-body .cma-stat-orange {
  background: #ffedd5;
  color: #ea580c;
}

.conjur-myarea-app-body .cma-stat-num {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 700;
}

.conjur-myarea-app-body .cma-stat-delta {
  font-weight: 600;
  margin-bottom: 2px;
}

.conjur-myarea-app-body .cma-chart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.conjur-myarea-app-body .cma-chart-toggle button {
  border: 1px solid transparent;
  background: transparent;
  color: #3b82f6;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.conjur-myarea-app-body .cma-chart-toggle button.is-active {
  border-color: #e2e8f0;
  background: #fff;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.conjur-myarea-app-body .btn-teal {
  --bs-btn-color: #fff;
  --bs-btn-bg: #0d9488;
  --bs-btn-border-color: #0d9488;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0f766e;
  --bs-btn-hover-border-color: #0f766e;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #115e59;
  --bs-btn-active-border-color: #115e59;
}

.conjur-myarea-app-body .cma-msg {
  margin-top: 0.5rem;
}

.conjur-myarea-app-body #cma-avatar-preview {
  object-fit: cover;
  background: #eef2f7;
}

.cma-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #eef2ff;
}

.cma-stat-blue { background: #dbeafe; }
.cma-stat-green { background: #d1fae5; }
.cma-stat-orange { background: #ffedd5; }

/* Legacy list helpers still used in JS dots */
.cma-list,
.cma-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cma-list li,
.cma-cat-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eef1f4;
  font-size: 0.92rem;
}

.cma-list a {
  color: var(--cma-text);
  text-decoration: none;
}

.cma-empty {
  color: var(--cma-muted) !important;
  border: 0 !important;
}

.cma-mail-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cma-mail-menu {
  width: 28px;
  height: 28px;
  padding: 0 !important;
  line-height: 1;
  font-size: 1.25rem;
  text-decoration: none !important;
  border-radius: 6px;
}

.cma-mail-menu:hover,
.cma-mail-menu:focus {
  background: #f1f5f9 !important;
  color: var(--cma-text) !important;
}

.cma-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0;
}

.cma-dot-yes { background: var(--cma-green); }
.cma-dot-no { background: #e11d48; }

.cma-profile-dl {
  margin: 0;
}

.cma-profile-dl > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
}

.cma-profile-dl dt {
  color: var(--cma-muted);
  font-weight: 600;
}

.cma-profile-dl dd { margin: 0; }

.cma-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.cma-form-grid .cma-field,
.cma-form-grid label {
  margin: 0;
}

.cma-form-grid > label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cma-span-2 { grid-column: span 2; }

.cma-form-grid small {
  display: block;
  margin-top: 4px;
  color: var(--cma-muted);
  font-weight: 400;
  font-size: 0.78rem;
  line-height: 1.4;
}

.cma-panel .cma-form {
  gap: 14px;
}

.cma-panel .cma-btn {
  min-width: 120px;
}

.cma-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8eef2;
  display: block;
  margin: 0 auto 14px;
}

.cma-avatar-panel {
  text-align: center;
}

@media (max-width: 980px) {
  .cma-grid-top,
  .cma-grid-charts,
  .cma-grid-3,
  .cma-grid-2,
  .cma-grid-profile {
    grid-template-columns: 1fr;
  }
}
