/*
 * AEB Transporte — camada visual 2026
 * Mantém os componentes funcionais do sistema e concentra a nova linguagem
 * da página principal e da autenticação em um arquivo pequeno e removível.
 */

:root {
  --primary-950: #071a2d;
  --primary-900: #0a2742;
  --primary-800: #0b3a61;
  --primary-700: #075f96;
  --primary-600: #087bb8;
  --primary-500: #1598ce;
  --bg-app: #f3f5f7;
  --bg-secondary: #f7f8fa;
  --text-primary: #14212e;
  --text-secondary: #425466;
  --text-tertiary: #6d7d8d;
  --border-color: #dce2e7;
  --border-color-light: #e9edf0;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 46, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 33, 46, 0.07);
  --shadow-xl: 0 24px 70px rgba(4, 20, 35, 0.22);
}

body {
  padding: 28px 24px 72px;
  font-size: 14px;
  line-height: 1.55;
  background-color: var(--bg-app);
  background-image:
    linear-gradient(rgba(7, 95, 150, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 95, 150, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

.wrap {
  max-width: 1280px;
  padding: 0;
}

button,
input,
select {
  font: inherit;
}

:where(button, input, select, a):focus-visible {
  outline: 3px solid rgba(21, 152, 206, 0.28);
  outline-offset: 2px;
}

/* Autenticação */
#login-modal.modal-backdrop {
  padding: 28px;
  background: #e9eef2 !important;
  background-image:
    linear-gradient(120deg, rgba(7, 95, 150, 0.055), transparent 48%),
    linear-gradient(rgba(10, 39, 66, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 39, 66, 0.035) 1px, transparent 1px) !important;
  background-size: auto, 36px 36px, 36px 36px !important;
}

#login-modal .auth-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(390px, 1.12fr);
  width: min(900px, 100%);
  max-width: 900px;
  max-height: calc(100vh - 56px);
  border: 1px solid rgba(10, 39, 66, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

#login-modal .modal-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 540px;
  padding: 54px 44px;
  text-align: left;
  background: #0a2f50;
  color: #fff;
}

#login-modal .modal-head::after {
  content: '';
  width: 42px;
  height: 3px;
  margin-top: 30px;
  background: #39a9d6;
}

.auth-eyebrow,
.auth-form-kicker,
.section-eyebrow {
  display: block;
  color: #57b7dd;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-modal-logo-wrap {
  margin: 20px 0 34px;
  padding: 9px 16px;
  border-radius: 7px;
  box-shadow: none;
}

.auth-modal-logo {
  width: 150px;
  max-width: 100%;
}

#login-modal .modal-head h2 {
  max-width: 310px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

#login-modal .modal-head p {
  max-width: 310px;
  margin-top: 14px;
  color: #c7d7e4;
  font-size: 14px;
  line-height: 1.6;
}

.auth-benefits {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 34px;
  color: #dce8f0;
  font-size: 12px;
  font-weight: 600;
}

.auth-benefits span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.auth-benefits span::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #54bde3;
}

#login-modal .auth-body {
  align-self: stretch;
  padding: 48px 52px;
  overflow-y: auto;
  background: #fff;
}

.auth-form-intro {
  margin-bottom: 28px;
}

.auth-form-kicker {
  color: var(--primary-700);
}

.auth-form-intro p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

#login-modal .form-group {
  margin-bottom: 18px;
}

#login-modal .form-group label {
  margin-bottom: 7px;
  color: #2d3c49;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
}

#login-modal .input-wrap input,
#login-modal .auth-select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #cfd8df;
  border-radius: 7px;
  background: #fff !important;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  box-shadow: inset 0 1px 1px rgba(20, 33, 46, 0.025);
}

#login-modal .input-wrap input::placeholder {
  color: #91a0ad;
  font-weight: 400;
}

#login-modal .input-wrap input:hover,
#login-modal .auth-select:hover {
  border-color: #aebcc7;
}

#login-modal .input-wrap input:focus,
#login-modal .auth-select:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(8, 123, 184, 0.12);
}

#login-modal .toggle-pwd {
  right: 9px;
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

#login-modal .toggle-pwd:hover {
  background: #eef5f8;
}

#login-modal .btn-block {
  min-height: 46px;
  margin-top: 7px;
  border-radius: 7px;
  font-size: 13px;
  letter-spacing: 0.015em;
  text-transform: none;
  box-shadow: none;
}

#login-modal .btn.primary:hover {
  background: #064f7e;
  box-shadow: none;
  transform: none;
}

.auth-switch-row {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color-light);
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}

.auth-switch-btn {
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: var(--primary-700);
  font-weight: 700;
  cursor: pointer;
}

.auth-switch-btn:hover {
  color: var(--primary-900);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#login-modal .register-access-note {
  margin: 3px 0 18px;
  padding: 12px 14px;
  border: 1px solid #d8e7ee;
  border-left: 3px solid var(--primary-600);
  border-radius: 6px;
  background: #f5f9fb;
  color: #31566b;
  font-size: 12px;
  line-height: 1.5;
}

#login-modal .login-error {
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 0;
  border-left: 3px solid var(--danger-600);
  border-radius: 5px;
}

/* Cabeçalho principal */
.app-header {
  margin-bottom: 18px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #0a2f50;
  color: #fff;
  box-shadow: 0 12px 30px rgba(8, 40, 67, 0.14);
}

.header-main {
  min-height: 88px;
  padding: 18px 22px;
  gap: 24px;
}

.header-branding {
  gap: 15px;
}

.aeb-header-logo-wrap {
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.aeb-header-logo {
  height: 40px;
  max-width: 118px;
}

.header-title {
  color: #fff;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.header-subtitle {
  color: #bcd0df;
  font-size: 12px;
}

.header-user-panel {
  gap: 14px;
}

.user-info-card {
  padding: 7px 14px 7px 0;
  border-right-color: rgba(255, 255, 255, 0.2);
}

.user-name {
  color: #fff;
  font-weight: 700;
}

.user-role-tag {
  border-color: rgba(111, 208, 239, 0.32);
  border-radius: 4px;
  background: rgba(67, 184, 223, 0.16);
  color: #8bdcf5;
}

.nav-action-btn {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #d7e5ee;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.nav-action-btn:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-action-btn.logout {
  border: 1px solid rgba(255, 196, 196, 0.28);
  color: #ffc7c7;
}

.nav-action-btn.logout:hover {
  border-color: rgba(255, 196, 196, 0.45);
  background: rgba(200, 45, 45, 0.2);
  color: #fff;
}

.header-context-bar {
  padding: 9px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #082743;
  color: #c8dae6;
}

.context-item svg {
  color: #62c4e7;
}

.context-divider {
  background: rgba(255, 255, 255, 0.18);
}

/* Conteúdo e controles */
.route-panel-card {
  margin-bottom: 14px;
  border-color: var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.route-overview-row {
  padding: 17px 20px;
  border-bottom-color: var(--border-color-light);
}

.card-section-title h2 {
  color: var(--primary-950);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-transform: none;
}

.route-personnel-group {
  gap: 12px;
}

.personnel-pill {
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-color-light);
  border-radius: 6px;
  background: #fafbfc;
  font-size: 12px;
}

.route-controls-row {
  padding: 13px 20px;
  background: #fff;
}

.seg {
  padding: 2px;
  border-color: var(--border-color);
  border-radius: 7px;
  background: #eef2f4;
}

.seg button {
  min-width: 76px;
  padding: 7px 13px;
  border-radius: 5px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.seg button.active {
  color: var(--primary-800);
  box-shadow: 0 1px 2px rgba(20, 33, 46, 0.1);
}

.btn {
  min-height: 36px;
  border-radius: 7px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.btn.primary {
  padding: 8px 16px;
  border-radius: 7px;
  background: var(--primary-700);
  box-shadow: none;
}

.btn.primary:hover {
  background: var(--primary-800);
  box-shadow: none;
  transform: none;
}

.btn.ghost {
  padding: 7px 11px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-secondary);
}

.btn.ghost:hover {
  border-color: #a9c6d6;
  background: #f2f8fb;
  color: var(--primary-700);
}

.btn-ver-mapa-action {
  border-color: #b9dce9 !important;
  background: #eef8fc !important;
  color: #075f96 !important;
  font-weight: 700;
}

.btn-ver-mapa-action:hover {
  border-color: #75bad4 !important;
  background: #e2f4fa !important;
}

.controls-right .btn {
  min-height: 38px;
}

.summary {
  gap: 10px;
  margin-bottom: 22px;
}

.sum-card {
  min-height: 72px;
  padding: 12px 14px;
  border-color: var(--border-color);
  border-radius: 9px;
  box-shadow: none;
}

.sum-card:hover {
  border-color: #bfcbd3;
  box-shadow: var(--shadow-sm);
}

.sum-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 7px;
}

.sum-card .num {
  color: var(--primary-950);
  font-size: 22px;
  font-weight: 750;
}

.sum-card .lbl {
  color: var(--text-tertiary);
  font-size: 10px;
  letter-spacing: 0.055em;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 12px;
}

.section-eyebrow {
  margin-bottom: 4px;
  color: var(--primary-700);
  font-size: 10px;
}

.section-title {
  color: var(--primary-950);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-transform: none;
}

.section-caption {
  margin: 0 0 1px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.stop-card {
  margin-bottom: 9px;
  border-color: var(--border-color);
  border-radius: 9px;
  box-shadow: none;
}

.stop-card:hover {
  border-color: #b8c6cf;
  box-shadow: 0 3px 12px rgba(20, 33, 46, 0.045);
}

.stop-head {
  min-height: 58px;
  padding: 11px 14px;
}

.stop-head:hover {
  background: #fafbfc;
}

.stop-idx {
  min-width: 29px;
  min-height: 29px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--primary-700);
}

.stop-name {
  color: #21303d;
  font-size: 14px;
  font-weight: 700;
}

.badge-count-pill,
.btn-select-ponto {
  border-radius: 6px;
}

.stop-body {
  background: #f7f9fa;
}

.student-row {
  border-color: #dfe5e9;
  border-radius: 6px;
  box-shadow: none;
}

.student-row.present {
  border-color: #cce6d4;
  background: #f3faf5;
}

.add-stop {
  margin-top: 14px;
  border: 1px dashed #becbd4;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
}

.aeb-footer {
  margin-top: 38px;
  border-top: 1px solid var(--border-color);
}

.social-icon-btn {
  border-radius: 8px;
  box-shadow: none;
}

/* Responsividade */
@media (max-width: 820px) {
  body {
    padding: 12px 10px 48px;
    background-size: 28px 28px;
  }

  #login-modal.modal-backdrop {
    align-items: flex-start;
    padding: 14px;
    overflow-y: auto;
  }

  #login-modal .auth-card {
    display: block;
    width: min(520px, 100%) !important;
    max-height: none !important;
    margin: auto;
    border-radius: 14px;
  }

  #login-modal .modal-head {
    min-height: 0;
    padding: 28px 28px 26px;
  }

  #login-modal .modal-head::after,
  .auth-benefits {
    display: none;
  }

  .auth-modal-logo-wrap {
    margin: 16px 0 22px;
  }

  #login-modal .modal-head h2 {
    font-size: 26px;
  }

  #login-modal .auth-body {
    padding: 28px;
    overflow: visible;
  }

  .header-main {
    align-items: stretch;
    padding: 15px;
  }

  .header-user-panel {
    padding-top: 12px;
    border-top-color: var(--border-color-light);
  }

  .user-info-card {
    border-right: 0;
  }

  .route-overview-row,
  .route-controls-row {
    padding: 14px;
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 520px) {
  #login-modal.modal-backdrop {
    padding: 0;
    background: #fff !important;
  }

  #login-modal .auth-card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #login-modal .modal-head {
    padding: 24px 22px;
  }

  .auth-eyebrow {
    font-size: 10px;
  }

  .auth-modal-logo-wrap {
    margin: 14px 0 18px;
    padding: 7px 12px;
  }

  .auth-modal-logo {
    width: 126px;
  }

  #login-modal .modal-head h2 {
    font-size: 23px;
  }

  #login-modal .modal-head p {
    margin-top: 8px;
    font-size: 12.5px;
  }

  #login-modal .auth-body {
    width: 100%;
    min-width: 0;
    padding: 26px 22px 34px !important;
  }

  #login-modal form,
  #login-modal .input-wrap,
  #login-modal .input-wrap input,
  #login-modal .auth-select,
  #login-modal .btn-block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .auth-form-intro {
    margin-bottom: 22px;
  }

  .app-header {
    border-radius: 9px;
  }

  .header-main {
    min-height: 0;
    padding: 12px 14px;
    gap: 10px;
  }

  .header-branding {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
  }

  .header-title-block {
    align-items: flex-start;
    text-align: left;
  }

  .header-title {
    font-size: 17px;
    text-align: left;
  }

  .header-subtitle {
    text-align: left;
  }

  .aeb-header-logo {
    height: 30px;
    max-width: 82px;
  }

  .aeb-header-logo-wrap {
    padding: 3px 7px;
  }

  .header-user-panel {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 9px;
    border-top-color: rgba(255, 255, 255, 0.14);
  }

  .user-info-card {
    width: auto;
    padding: 0;
  }

  .user-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .user-name {
    font-size: 11.5px;
  }

  .header-nav-actions {
    width: auto;
    justify-content: flex-end;
    gap: 3px;
  }

  .nav-action-btn {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 10.5px;
  }

  #btn-open-install-guide span {
    display: none;
  }

  #btn-open-install-guide::after {
    content: 'Instalar';
  }

  .header-context-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 12px;
    padding: 8px 14px;
  }

  .header-context-bar .context-item:first-child {
    grid-column: 1 / -1;
  }

  .personnel-pill {
    width: 100%;
  }

  .controls-right {
    grid-template-columns: 1fr;
  }

  .btn-ver-mapa-action,
  #expand-all,
  #gen-report {
    grid-column: 1 !important;
  }

  .summary {
    grid-template-columns: 1fr 1fr;
  }

  .section-caption {
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
