:root {
  --pink-bg: #ffe0ea;
  --lavender: #c9b3e8;
  --neon: #efff52;
  --coral: #ff9da5;
  --ink: #101015;
  --muted: #4c4b57;
  --paper: #fffdfb;
  --line: #1b1b1f;
  --cyan: #66d9ef;
  --magenta: #e91e8c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.login-page {
  min-height: 100vh;
  max-width: 100vw;
}

.login-card {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.login-panel {
  min-width: 0;
  display: grid;
  align-content: center;
  padding: clamp(2rem, 6vw, 5.5rem);
  color: #fff;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(135deg, #e91e8c 0%, #8c45c8 52%, #5cc8df 100%);
}

.login-kicker {
  width: fit-content;
  margin-bottom: 0.85rem;
  border: 1.5px solid var(--line);
  padding: 0.22rem 0.65rem;
  color: var(--ink);
  background: var(--neon);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 rgba(16, 16, 21, 0.45);
}

.login-panel h1 {
  width: min(720px, 100%);
  max-width: none;
  justify-self: center;
  font-size: clamp(1.85rem, 2.85vw, 2.7rem);
  font-weight: 950;
  line-height: 0.95;
  text-align: left;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(16, 16, 21, 0.38);
}

.login-panel h1 span {
  display: inline;
}

.login-copy {
  width: min(720px, 100%);
  justify-self: center;
  margin: 1rem 0 1.4rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.access-switch {
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  justify-self: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.access-tab[data-mode="coordenacao"] {
  display: none;
}

.access-tab {
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1.5px solid var(--line);
  padding: 0 0.7rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 3px 3px 0 rgba(16, 16, 21, 0.38);
  font-size: clamp(0.7rem, 1.12vw, 0.85rem);
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  text-transform: uppercase;
}

.access-tab i {
  flex: 0 0 auto;
}

.access-label-short {
  display: none;
}

.role-label-short {
  display: none;
}

.access-tab.active {
  background: var(--pink-bg);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(16, 16, 21, 0.45);
}

.access-form {
  display: none;
  width: min(720px, 100%);
  min-width: 0;
  justify-self: center;
  border: 1.5px solid var(--line);
  padding: 1.15rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 8px 8px 0 rgba(16, 16, 21, 0.22);
}

.access-form.active {
  display: block;
}

.form-heading {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 1rem;
}

.form-heading > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--lavender);
}

.form-heading h2 {
  margin-bottom: 0.3rem;
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1.05;
  text-transform: uppercase;
}

.form-heading p {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.student-form,
.credential-form {
  min-width: 0;
  display: grid;
  gap: 0.85rem;
}

.student-form label,
.credential-form label {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
  color: var(--ink);
  font-weight: 900;
}

.name-autocomplete,
.school-combobox {
  position: relative;
  min-width: 0;
}

.name-dropdown,
.school-dropdown {
  position: absolute;
  z-index: 99;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  border: 1.5px solid rgba(16, 16, 21, 0.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(16, 16, 21, 0.14);
  padding: 6px;
}

.name-dropdown::-webkit-scrollbar,
.school-dropdown::-webkit-scrollbar {
  width: 10px;
}

.name-dropdown::-webkit-scrollbar-thumb,
.school-dropdown::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 999px;
  background: #9a9a9a;
}

.name-dropdown li,
.school-dropdown li {
  border-radius: 8px;
  padding: 10px 14px;
  color: #101015;
  font-size: 0.97rem;
  font-weight: 650;
  cursor: pointer;
  text-transform: uppercase;
  transition: background .1s;
}

.school-dropdown li {
  font-weight: 850;
  line-height: 1.25;
  text-transform: none;
  white-space: normal;
}

.name-dropdown li:hover,
.name-dropdown li.active,
.school-dropdown li:hover,
.school-dropdown li.active,
.school-dropdown li[aria-selected="true"] {
  background: #f4f0ff;
  color: #8c45c8;
}

.name-dropdown li.no-match {
  color: #888;
  font-style: italic;
  cursor: default;
}

.name-dropdown li.no-match:hover {
  background: transparent;
  color: #888;
}

.student-form select,
.student-form input,
.credential-form input {
  min-width: 0;
  width: 100%;
  min-height: 54px;
  border: 1.5px solid rgba(16, 16, 21, 0.22);
  border-radius: 14px;
  padding: 0 1rem;
  color: var(--ink);
  background: #f4f8ff;
  font-weight: 750;
  outline: none;
}

.student-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position:
    calc(100% - 1.35rem) 50%,
    calc(100% - 0.95rem) 50%;
  background-repeat: no-repeat;
  background-size: 0.42rem 0.42rem, 0.42rem 0.42rem;
  cursor: pointer;
  padding-right: 2.6rem;
}

.student-form .school-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.school-select-button {
  min-width: 0;
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1.5px solid rgba(16, 16, 21, 0.22);
  border-radius: 14px;
  padding: 0.55rem 1rem;
  color: var(--ink);
  background: #f4f8ff;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.school-select-button span {
  min-width: 0;
  flex: 1;
}

.school-select-button i {
  flex: 0 0 auto;
  font-size: 0.8em;
  transition: transform 0.12s ease;
}

.school-select-button[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.school-select-button.is-placeholder {
  color: #6f6a78;
}

.student-form select option {
  color: var(--ink);
  background: #fff5fb;
  font-weight: 750;
}

.student-form select option:checked {
  color: #fff;
  background: #e91e8c;
}

.student-form select:focus,
.student-form input:focus,
.credential-form input:focus,
.school-select-button:focus-visible {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.2);
}

.form-message {
  min-height: 1.3rem;
  color: #9b155d;
  font-size: 0.9rem;
  font-weight: 850;
}

.forgot-password {
  width: fit-content;
  justify-self: end;
  border: 0;
  padding: 0.1rem 0;
  color: #7b257f;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.forgot-password:hover,
.forgot-password:focus-visible {
  color: var(--magenta);
}

.forgot-password:disabled {
  opacity: 0.6;
  cursor: wait;
}

.reset-copy {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
}

.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--magenta);
  cursor: pointer;
}

.consent-label strong {
  color: var(--neon);
}

.primary-action {
  width: fit-content;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1.5px solid var(--line);
  padding: 0 1.1rem;
  color: #fff;
  background: var(--magenta);
  box-shadow: 5px 5px 0 rgba(16, 16, 21, 0.42);
  font-weight: 950;
  cursor: pointer;
  text-transform: uppercase;
}

.primary-action:hover,
.primary-action:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(16, 16, 21, 0.42);
}

.primary-action:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.brand-panel {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 5rem);
  background: #fff;
  border-left: 2px solid rgba(16, 16, 21, 0.12);
}

.brand-scene {
  position: relative;
  width: min(680px, 100%);
  display: grid;
  justify-items: center;
  text-align: center;
}

.brand-scene img {
  width: min(430px, 86%);
  height: auto;
  object-fit: contain;
}

.brand-scene h2 {
  margin-top: -2rem;
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  font-weight: 950;
  line-height: 0.95;
  text-transform: uppercase;
}

.brand-scene h2 span {
  display: block;
}

.brand-title-nordestinas {
  color: #56189a;
}

.brand-title-digitais {
  color: #e85c98;
}

.brand-scene p {
  max-width: 420px;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.5;
}

.mobile-login-footer {
  display: none;
}

@media (max-width: 900px) {
  .login-card {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    order: 1;
  }

  .login-panel {
    order: 2;
  }

  .brand-panel {
    min-height: 360px;
    border-left: 0;
    border-bottom: 2px solid rgba(16, 16, 21, 0.12);
  }
}

@media (max-width: 900px) {
  body {
    background:
      radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.28), transparent 26%),
      linear-gradient(160deg, #e91e8c 0%, #8c45c8 55%, #43c5dd 100%);
  }

  .login-page {
    min-height: 100svh;
    position: relative;
    display: grid;
    place-items: center;
    padding: 1rem 1rem 3.4rem;
    background:
      radial-gradient(circle at 84% 8%, rgba(239, 255, 82, 0.32), transparent 23%),
      linear-gradient(160deg, #e91e8c 0%, #8c45c8 55%, #43c5dd 100%);
  }

  .mobile-login-footer {
    position: absolute;
    right: auto;
    bottom: calc(0.9rem + env(safe-area-inset-bottom));
    left: 50%;
    width: min(300px, calc(100% - 2rem));
    display: block;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 2px rgba(16, 16, 21, 0.2);
  }

  .login-card {
    width: min(360px, calc(100vw - 2rem));
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 1.5px solid rgba(16, 16, 21, 0.16);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(16, 16, 21, 0.28);
  }

  .brand-panel {
    min-height: 0;
    padding: 1.35rem 1rem 0.55rem;
    border: 0;
    border-radius: 20px 20px 0 0;
    background: #fff;
  }

  .brand-scene img {
    width: min(140px, 48vw);
  }

  .brand-scene h2 {
    margin-top: -0.35rem;
    font-size: 1.35rem;
    line-height: 0.96;
  }

  .brand-scene p {
    max-width: 250px;
    margin-top: 0.45rem;
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .login-panel {
    align-content: start;
    padding: 0.55rem 1.25rem 1.25rem;
    border-radius: 0 0 20px 20px;
    color: var(--ink);
    background: #fff;
  }

  .login-panel h1 {
    max-width: none;
    color: var(--ink);
    font-size: 1.32rem;
    line-height: 1.05;
    text-align: center;
    text-shadow: none;
  }

  .login-panel h1 span {
    display: block;
  }

  .login-copy {
    margin: 0.5rem 0 0.8rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: center;
  }

  .brand-scene p,
  .login-panel h1,
  .login-copy {
    display: none;
  }

  .access-switch {
    width: min(300px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.9rem;
    padding: 0;
    background: transparent;
  }

  .access-tab[data-mode="coordenacao"] {
    display: none;
  }

  .access-label-full {
    display: none;
  }

  .access-label-short {
    display: inline;
  }

  .role-label-full {
    display: none;
  }

  .role-label-short {
    display: inline;
  }

  .access-tab {
    min-height: 38px;
    flex-direction: row;
    gap: 0.3rem;
    border: 1.5px solid var(--line);
    border-radius: 0;
    padding: 0.35rem 0.45rem;
    background: #fff5fb;
    box-shadow: 3px 3px 0 rgba(16, 16, 21, 0.22);
    color: var(--ink);
    font-size: 0.6rem;
  }

  .access-tab.active {
    color: var(--ink);
    border-color: var(--line);
    background: #ffcfe2;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 rgba(16, 16, 21, 0.24);
  }

  .access-form {
    max-width: none;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .name-dropdown,
  .school-dropdown {
    max-height: min(230px, 35vh);
    border-color: #f3bdd8;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(16, 16, 21, 0.18);
  }

  .name-dropdown li,
  .school-dropdown li {
    padding: 0.78rem 1rem;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .primary-action {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: 0;
    background: var(--magenta);
    box-shadow: none;
  }

  .primary-action:hover,
  .primary-action:focus-visible {
    transform: none;
    box-shadow: none;
  }

  .student-form select,
  .student-form input,
  .credential-form input {
    border-color: #d8d0e6;
    background-color: #fff;
  }

  .school-select-button {
    min-height: 44px;
    border-color: #d8d0e6;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    background-color: #fff;
    font-size: 0.72rem;
    font-weight: 850;
  }

  .school-select-button span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }

  .form-message {
    min-height: 0.9rem;
    font-size: 0.76rem;
  }
}

@media (max-width: 480px) {
  .login-page {
    padding: 0.75rem 0.75rem 3.25rem;
  }

  .login-card {
    width: min(340px, calc(100vw - 1.5rem));
  }

  .login-panel {
    padding: 0.5rem 1rem 1.1rem;
  }

  .login-panel h1 {
    font-size: 1.18rem;
  }

  .login-copy {
    margin: 0.45rem 0 0.75rem;
    font-size: 0.72rem;
  }

  .access-switch {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .access-tab {
    min-height: 36px;
    font-size: 0.56rem;
    box-shadow: 3px 3px 0 rgba(16, 16, 21, 0.22);
  }

  .access-tab.active {
    box-shadow: 4px 4px 0 rgba(16, 16, 21, 0.24);
  }

  .access-form {
    padding: 0;
  }

  .student-form,
  .credential-form {
    gap: 0.7rem;
  }

  .student-form label,
  .credential-form label {
    font-size: 0.84rem;
  }

  .student-form select,
  .student-form input,
  .credential-form input {
    min-height: 44px;
    border-radius: 10px;
    padding: 0 0.75rem;
    font-size: 0.78rem;
  }

  .student-form select {
    padding-left: 0.55rem;
    padding-right: 1.55rem;
    font-size: 0.62rem;
    font-weight: 850;
    background-position:
      calc(100% - 0.95rem) 50%,
      calc(100% - 0.62rem) 50%;
    background-size: 0.34rem 0.34rem, 0.34rem 0.34rem;
  }

  .school-select-button {
    min-height: 44px;
    padding: 0.45rem 0.65rem;
    font-size: 0.66rem;
  }

  .school-dropdown li {
    font-size: 0.8rem;
  }

  .primary-action {
    min-height: 44px;
    padding: 0 0.75rem;
    font-size: 0.74rem;
  }

  .brand-panel {
    min-height: 0;
    padding: 1.15rem 1rem 0.45rem;
  }

  .brand-scene img {
    width: min(118px, 46vw);
  }

  .brand-scene h2 {
    margin-top: -0.25rem;
    font-size: 1.08rem;
  }

  .brand-scene p {
    max-width: 230px;
    font-size: 0.64rem;
  }
}

@media (max-width: 360px) {
  .login-panel {
    padding-inline: 0.85rem;
  }

  .access-switch {
    gap: 0.38rem;
  }

  .access-tab {
    padding-inline: 0.35rem;
    font-size: 0.5rem;
  }

  .student-form select {
    font-size: 0.56rem;
  }

  .school-select-button {
    font-size: 0.6rem;
  }
}
