@import url('/css/rotaplus-tokens.css');

* { box-sizing: border-box; }
body {
  font-family: var(--ob-font);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #f3f4f6;
  color: #0f172a;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.login-card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.10);
  padding: 22px 22px 18px;
}

.login-card-split {
  max-width: 920px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.15fr);
  padding: 0;
  overflow: hidden;
}

.login-brand-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 55%, #fef3c7 100%);
  border-right: 1px solid #e5e7eb;
  min-height: 440px;
}

.login-brand-inner {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.empresa-logo-brand {
  max-width: min(320px, 100%);
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
  display: block;
  padding: 8px 12px;
  box-sizing: border-box;
}

.login-brand-panel:not(.has-logo) {
  background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 100%);
}

.login-brand-panel:not(.has-logo) .empresa-logo-brand {
  display: none !important;
}

.login-form-panel {
  padding: 22px 22px 18px;
}

.login-header-compact {
  display: grid;
  place-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.system-logo-sm {
  width: min(200px, 72%);
  height: auto;
  display: block;
  background: transparent;
}

.system-logo-icon {
  width: auto;
  height: auto;
  max-height: 60px;
  max-width: min(240px, 100%);
  display: block;
  margin: 0 auto;
  background: transparent;
  object-fit: contain;
}

.login-header {
  display: grid;
  place-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.system-logo {
  width: min(360px, 92%);
  height: auto;
  display: block;
  background: transparent;
}

.logo-rotaplus {
  width: min(150px, 56%);
  height: auto;
  display: block;
  margin-top: -2px;
  opacity: 0.95;
}

.login-subtitle {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  text-align: center;
}

.empresa-logo-inline {
  width: 100%;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
  display: none; /* escondido por padrão — JS mostra quando logo carrega */
  justify-items: center;
}

.mx-auto { margin-left: auto; margin-right: auto; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px 0;
}

.tab {
  text-align: center;
  padding: 12px 10px;
  cursor: pointer;
  font-weight: 800;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: 0.2s ease;
  background: #ffffff;
  font-size: 15px;
}

.tab.active {
  border-color: #0ea5e9;
  background: #e0f2fe;
  color: #0c4a6e;
}

.tab:hover:not(.active) {
  background: #f8fafc;
}

.hint-contexto {
  font-size: 14px;
  color: #475569;
  margin: 8px 0 12px;
  line-height: 1.45;
  text-align: center;
}

.input-group { margin-bottom: 14px; }

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.input-group input {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 17px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.campo-senha-wrap {
  position: relative;
}
.campo-senha-wrap input {
  padding-right: 76px;
}
.btn-mostrar-senha {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  padding: 6px 4px;
  font-family: inherit;
  text-transform: none;
}
.btn-mostrar-senha:hover { color: #334155; }

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
}

.remember {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: #334155;
}

.remember input { width: 14px; height: 14px; }

.forgot {
  font-size: 14px;
  color: #0ea5e9;
  text-decoration: none;
  font-weight: 800;
}

.forgot:hover { text-decoration: underline; }

.btn-login {
  width: 100%;
  background: var(--ob-orange, #f37421);
  color: white;
  border: none;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 900;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s ease;
  margin-top: 6px;
}

.btn-login:hover { filter: brightness(0.95); background: #d4621a; }
.btn-login:disabled { background: #94a3b8; cursor: not-allowed; }

.empresa-logo {
  max-width: 300px;
  max-height: 88px;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 1;
}

.alert {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
  display: none;
  text-align: center;
}

.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.login-footnote {
  margin-top: 14px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.4;
}

.login-link-extra {
  display: block;
  margin-bottom: 8px;
  color: #4f46e5;
  font-weight: 600;
}

.login-link-parceiro {
  color: #6b21a6 !important;
}

.login-legal {
  margin: 10px 0 0;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
}

@media (max-width: 980px) {
  .login-card { padding: 20px 16px 16px; }
  .login-card-split { grid-template-columns: 1fr; max-width: 520px; }
  .login-brand-panel {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 16px;
  }
  .login-form-panel { padding: 20px 16px 16px; }
}

@media (max-width: 520px) {
  .tabs { grid-template-columns: 1fr; }
  .system-logo { width: min(300px, 90%); }
  .system-logo-sm { width: min(180px, 78%); }
  .system-logo-icon { max-height: 100px; max-width: min(280px, 90%); }
  .empresa-logo-brand { max-height: 200px; }
}