/*
 * Ecossistema de Governança Interna de Nájela Maurício — Módulo Login.
 * Paleta canônica: preto, marrom, #534D44, #E1DBCF, #A9763D e branco pontual.
 * sopro.applied=true | sopro.name=SOPRO Wilker | sopro.version=2.6
 */
:root {
  --nm-danger: #7e302a;
  --nm-line: rgba(83, 77, 68, .24);
  --nm-radius: var(--radius-sm);
  --nm-shadow: var(--shadow-liquid);
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--nm-black);
  background: var(--nm-beige);
  font-family: var(--font-interface);
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 1rem;
  left: 1rem;
  padding: .75rem 1rem;
  color: var(--nm-white);
  background: var(--nm-black);
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.identity { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; }
.identity--light { color: var(--nm-beige); }
.identity--dark, .identity--mobile { color: var(--nm-black); }
.identity:hover { color: var(--nm-gold); }
.identity--mobile { display: none; margin-bottom: 4.5rem; }
.identity-name { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nm-signature {
  display: inline-grid;
  width: 3.1rem;
  height: 3.1rem;
  place-items: center;
  border: 1px solid currentColor;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-style: italic;
  letter-spacing: -.16em;
  line-height: 1;
}
.nm-signature--small { width: 2.6rem; height: 2.6rem; font-size: 1rem; }

.overline, .card-kicker {
  margin: 0 0 1.2rem;
  color: var(--nm-gold);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .2em;
}
.overline--dark, .card-kicker--dark { color: var(--nm-gray); }

.login-shell {
  display: grid;
  grid-template-columns: minmax(430px, .95fr) minmax(520px, 1.05fr);
  min-height: 100svh;
}
.executive-panel {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  color: var(--nm-beige);
  background: linear-gradient(145deg, var(--nm-black), var(--nm-brown));
}
.executive-panel__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  min-height: 100%;
  padding: clamp(2.5rem, 5vw, 5rem);
}
.executive-message { margin: auto 0; padding: 5rem 0; }
.executive-message h1 {
  max-width: 700px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.2vw, 6.2rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.055em;
}
.executive-message > p:last-child {
  max-width: 540px;
  margin: 2rem 0 0;
  color: rgba(225, 219, 207, .7);
  font-size: 1rem;
  line-height: 1.75;
}
.system-line { display: flex; align-items: center; gap: .8rem; color: rgba(225, 219, 207, .58); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; }
.system-line i { width: 2.5rem; height: 1px; background: rgba(169, 118, 61, .75); }
.orbit { position: absolute; border: 1px solid rgba(169, 118, 61, .24); border-radius: 50%; }
.orbit--outer { right: -19rem; bottom: -22rem; width: 48rem; height: 48rem; }
.orbit--inner { right: -8rem; bottom: -11rem; width: 28rem; height: 28rem; }
.orbit-point { position: absolute; right: 10.7rem; bottom: 13.7rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--nm-gold); box-shadow: 0 0 0 .45rem rgba(169, 118, 61, .12); }

.editorial-panel { display: grid; place-items: center; padding: clamp(2rem, 7vw, 8rem); background: var(--nm-beige); }
.login-card { width: min(100%, 470px); }
.login-card h2, .welcome-block h1, .architecture-copy h2, .error-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -.04em;
}
.login-card h2 { font-size: clamp(2.6rem, 4vw, 3.9rem); }
.security-title { margin: 0; font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 4.2rem); font-weight: 400; letter-spacing: -.04em; }
.code-input { font-size: 1.65rem; letter-spacing: .28em; text-align: center; }
.security-progress { padding: 1rem 1.2rem; border: 1px solid var(--nm-line); background: rgba(255, 255, 255, .35); }
.form-intro { margin: 1rem 0 2.7rem; color: var(--nm-gray); line-height: 1.65; }
.form-label { margin-bottom: .55rem; color: var(--nm-brown); font-size: .78rem; font-weight: 700; }
.form-control {
  min-height: 3.65rem;
  padding: .9rem 1rem;
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  color: var(--nm-black);
  background: rgba(255, 255, 255, .48);
  box-shadow: none;
}
.form-control::placeholder { color: rgba(83, 77, 68, .56); }
.form-control:focus { border-color: var(--nm-gold); box-shadow: 0 0 0 .22rem rgba(169, 118, 61, .15); background: rgba(255, 255, 255, .7); }
.support-note { margin: 0 0 1.8rem; color: var(--nm-gray); font-size: .73rem; text-align: right; }
.btn-najela {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 3.65rem;
  padding: .8rem 1.5rem;
  border: 1px solid var(--nm-black);
  border-radius: var(--nm-radius);
  color: var(--nm-white);
  background: var(--nm-black);
  font-weight: 700;
}
.btn-najela:hover, .btn-najela:focus { color: var(--nm-white); background: var(--nm-brown); border-color: var(--nm-brown); }
.btn-najela:focus-visible, .btn-outline-najela:focus-visible { box-shadow: 0 0 0 .25rem rgba(169, 118, 61, .3); }
.privacy-note { margin: 2rem 0 0; color: rgba(83, 77, 68, .72); font-size: .7rem; line-height: 1.55; text-align: center; }
.alert-danger { border: 1px solid rgba(126, 48, 42, .2); border-radius: var(--nm-radius); color: var(--nm-danger); background: rgba(255, 255, 255, .38); font-size: .86rem; }
.alert-mark { display: inline-grid; flex: 0 0 1.25rem; width: 1.25rem; height: 1.25rem; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-weight: 700; }

.app-container { max-width: 1320px; padding-right: 1.5rem; padding-left: 1.5rem; }
.app-header { padding: 1.25rem 0; border-bottom: 1px solid var(--nm-line); background: rgba(225, 219, 207, .96); }
.app-header .nm-signature { width: 2.55rem; height: 2.55rem; font-size: 1rem; }
.btn-outline-najela { min-width: 5.5rem; border-color: var(--nm-gray); border-radius: var(--nm-radius); color: var(--nm-black); }
.btn-outline-najela:hover { color: var(--nm-white); background: var(--nm-black); border-color: var(--nm-black); }
.dashboard-main { min-height: calc(100vh - 148px); padding: clamp(4rem, 8vw, 7rem) 0; background: var(--nm-beige); }
.welcome-block { max-width: 800px; margin-bottom: 3.5rem; }
.welcome-block h1 { font-size: clamp(3.2rem, 6vw, 6rem); }
.welcome-block > p:last-child { max-width: 690px; margin: 1.2rem 0 0; color: var(--nm-gray); font-size: 1.05rem; line-height: 1.7; }
.architecture-card, .account-card { height: 100%; padding: clamp(2rem, 4vw, 3.2rem); border-radius: var(--radius-md); box-shadow: var(--nm-shadow); }
.architecture-card { color: var(--nm-beige); background: linear-gradient(135deg, var(--nm-black), var(--nm-brown)); }
.architecture-copy { max-width: 580px; }
.architecture-copy h2 { font-size: clamp(2.6rem, 4vw, 4.2rem); }
.architecture-copy > p:last-child { margin: 1rem 0 0; color: rgba(225, 219, 207, .68); line-height: 1.7; }
.service-map { display: grid; grid-template-columns: 1fr auto 1.25fr auto 1.25fr; align-items: center; gap: .9rem; margin-top: 3.5rem; }
.service-map > i { width: 2.2rem; height: 1px; background: var(--nm-gold); }
.service-node { min-height: 7.8rem; padding: 1rem; border: 1px solid rgba(225, 219, 207, .24); }
.service-node span, .service-node strong, .service-node small { display: block; }
.service-node span { margin-bottom: 1.6rem; color: var(--nm-gold); font-size: .68rem; letter-spacing: .1em; }
.service-node strong { font-family: Georgia, serif; font-size: 1.25rem; font-weight: 400; }
.service-node small { margin-top: .25rem; color: rgba(225, 219, 207, .52); font-size: .65rem; }
.service-node--user { align-self: center; min-height: auto; }
.account-card { border: 1px solid var(--nm-line); background: rgba(255, 255, 255, .46); }
.account-avatar { margin-bottom: 1.25rem; }
.account-card dl { margin: 0; }
.account-card dl > div { padding: 1rem 0; border-bottom: 1px solid var(--nm-line); }
.account-card dl > div:last-child { padding-bottom: 0; border-bottom: 0; }
.account-card dt { margin-bottom: .3rem; color: var(--nm-gray); font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.account-card dd { margin: 0; overflow-wrap: anywhere; }
.positioning-band { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; padding: 1.3rem 0; border-top: 1px solid var(--nm-line); }
.positioning-band p { max-width: 560px; margin: 0; color: var(--nm-gray); font-family: var(--font-display); font-size: .95rem; }
.app-footer { padding: 1.25rem 0; color: var(--nm-gray); border-top: 1px solid var(--nm-line); background: var(--nm-beige); font-size: .75rem; }
.app-footer__content { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.app-footer strong { color: var(--nm-brown); font-weight: 700; }
.profile-main { min-height: calc(100svh - 72px); }
.profile-intro { max-width: 760px; }
.profile-intro h1 { margin: 0; font-family: var(--font-display); font-size: clamp(3rem, 6vw, 5rem); font-weight: 400; letter-spacing: -.04em; }
.profile-intro > p:last-child { margin: 1rem 0 0; color: var(--nm-gray); }
.profile-card { height: 100%; }
.profile-card h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 400; letter-spacing: -.03em; }
.profile-card__intro { margin: .8rem 0 0; color: var(--nm-gray); line-height: 1.6; }
.profile-photo-current { display: flex; align-items: center; gap: 1rem; }
.profile-photo-current .nm-avatar { width: 6rem; height: 6rem; font-size: 1.8rem; }
.profile-photo-current p { margin: .35rem 0 0; color: var(--nm-gray); }
.profile-file { padding: .65rem; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; border: 0; }
.theme-option { position: relative; display: grid; min-width: 0; gap: .75rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast); }
.theme-option:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent); }
.theme-option input { position: absolute; top: 1rem; right: 1rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.theme-option input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-option > span:last-child { display: grid; gap: .25rem; color: var(--text-primary); }
.theme-option small { color: var(--text-secondary); font-size: .72rem; }
.theme-option__preview { display: grid; height: 5rem; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: .35rem; padding: .55rem; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.theme-option__preview i { display: block; border-radius: 4px; }
.theme-option__preview i:first-child { grid-row: 1 / -1; }
.theme-option__preview--original { background: #e1dbcf; }
.theme-option__preview--original i:first-child { background: #2e241d; }
.theme-option__preview--original i:nth-child(2) { background: #fff; }
.theme-option__preview--original i:nth-child(3) { background: #a9763d; }
.theme-option__preview--dark { background: #080706; }
.theme-option__preview--dark i:first-child { background: #171210; border: 1px solid rgba(169,118,61,.35); }
.theme-option__preview--dark i:nth-child(2) { background: #211a15; }
.theme-option__preview--dark i:nth-child(3) { background: #a9763d; }
.evaluation-main { min-height: calc(100svh - 72px); }
.evaluation-intro { max-width: 900px; }
.evaluation-intro h1 { margin: 0; }
.evaluation-intro h2 { margin: 1rem 0 .6rem; font-family: var(--font-display); }
.evaluation-intro > p:last-child { max-width: 780px; color: var(--nm-gray); }
.evaluation-tabs { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0; }
.evaluation-steps { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.evaluation-step { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.evaluation-step__number { color: var(--nm-gold); font-size: .72rem; font-weight: 700; letter-spacing: .12em; }
.evaluation-step__content h3 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; }
.evaluation-step__content p { margin: .65rem 0 0; color: var(--nm-gray); line-height: 1.65; }
.evaluation-step__checks { display: grid; gap: .7rem; margin: 1rem 0 0; }
.evaluation-step__checks div { display: grid; grid-template-columns: minmax(110px, 150px) 1fr; gap: .75rem; padding-top: .7rem; border-top: 1px solid var(--nm-line); }
.evaluation-step__checks dt { color: var(--nm-brown); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.evaluation-step__checks dd { margin: 0; color: var(--nm-gray); line-height: 1.55; }
.error-page { display: grid; min-height: 100svh; place-items: center; padding: 2rem; background: var(--nm-beige); }
.error-card { width: min(100%, 600px); padding: clamp(2rem, 7vw, 5rem); border: 1px solid var(--nm-line); border-radius: var(--nm-radius); background: rgba(255, 255, 255, .42); box-shadow: var(--nm-shadow); }
.error-overline { margin-top: 4rem; }
.error-card h1 { margin-bottom: 1rem; font-size: clamp(2.5rem, 5vw, 4rem); }
.error-card > p:not(.overline) { margin-bottom: 2rem; color: var(--nm-gray); }

.ui-kit-main { min-height: calc(100svh - 72px); background: var(--canvas); }
.ui-kit-intro { max-width: 760px; }
.ui-kit-intro h1 { margin: 0; }
.ui-kit-intro > p:last-child { margin: 1rem 0 0; }
.ui-kit-section { padding: 2rem 0 5rem; scroll-margin-top: 90px; border-top: 1px solid var(--border); }
.ui-kit-section__heading { margin-bottom: 2rem; }
.ui-kit-section__heading h2 { margin: 0; }

@media (max-width: 1000px) {
  .login-shell { display: block; }
  .executive-panel { display: none; }
  .editorial-panel { min-height: 100svh; padding: 2rem; }
  .identity--mobile { display: inline-flex; }
}
@media (max-width: 767px) {
  .service-map { grid-template-columns: 1fr; }
  .service-map > i { width: 1px; height: 1.5rem; margin-left: 2rem; }
  .service-node { min-height: auto; }
  .service-node span { margin-bottom: .75rem; }
  .identity-name { display: none; }
  .evaluation-step__checks div { grid-template-columns: 1fr; gap: .25rem; }
}
@media (max-width: 575px) {
  .editorial-panel { place-items: start stretch; padding: 2rem 1.25rem; }
  .login-card { margin: auto 0; }
  .identity--mobile { margin-bottom: 3.5rem; }
  .app-container { padding-right: 1rem; padding-left: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.recovery-code {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--nm-copper, #b77d38);
  border-radius: 0.5rem;
  background: rgba(183, 125, 56, 0.08);
  color: var(--nm-ink, #201a17);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.82rem, 2.4vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  text-align: center;
  user-select: all;
}

html[data-theme="dark"] {
  --nm-line: var(--border);
  --nm-danger: #e58b82;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .editorial-panel,
html[data-theme="dark"] .dashboard-main,
html[data-theme="dark"] .app-footer,
html[data-theme="dark"] .error-page { color: var(--text-primary); background: var(--canvas); }
html[data-theme="dark"] .app-header { border-color: var(--border); background: rgba(21, 18, 16, .96); }
html[data-theme="dark"] .identity--dark,
html[data-theme="dark"] .identity--mobile { color: var(--text-primary); }
html[data-theme="dark"] .overline--dark,
html[data-theme="dark"] .card-kicker--dark,
html[data-theme="dark"] .form-intro,
html[data-theme="dark"] .support-note,
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .welcome-block > p:last-child,
html[data-theme="dark"] .account-card dt,
html[data-theme="dark"] .positioning-band p,
html[data-theme="dark"] .profile-intro > p:last-child,
html[data-theme="dark"] .profile-card__intro,
html[data-theme="dark"] .profile-photo-current p,
html[data-theme="dark"] .evaluation-intro > p:last-child,
html[data-theme="dark"] .evaluation-step__content p,
html[data-theme="dark"] .evaluation-step__checks dd,
html[data-theme="dark"] .error-card > p:not(.overline) { color: var(--text-secondary); }
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .evaluation-step__checks dt { color: var(--text-primary); }
html[data-theme="dark"] .form-control { border-color: var(--border); color: var(--text-primary); background: var(--surface); }
html[data-theme="dark"] .form-control::placeholder { color: var(--text-secondary); }
html[data-theme="dark"] .form-control:focus { border-color: var(--accent); color: var(--text-primary); background: var(--surface-raised); }
html[data-theme="dark"] .security-progress,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .error-card { border-color: var(--border); color: var(--text-primary); background: var(--surface); }
html[data-theme="dark"] .btn-outline-najela { border-color: var(--border); color: var(--text-primary); }
html[data-theme="dark"] .btn-outline-najela:hover { border-color: var(--accent); color: var(--nm-black); background: var(--accent); }
html[data-theme="dark"] .app-footer strong { color: var(--text-primary); }
html[data-theme="dark"] .recovery-code { color: var(--text-primary); background: rgba(169,118,61,.12); }

@media (max-width: 575px) {
  .theme-options { grid-template-columns: 1fr; }
}
