:root {
  --md-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --md-primary: #2c5282;
  --md-primary-dark: #1e3a5f;
  --md-primary-container: #ebf4ff;
  --md-on-surface: #1a202c;
  --md-on-surface-variant: #4a5568;
  --md-outline-variant: #e2e8f0;
  --md-surface-dim: #f7fafc;
  --md-shape-lg: 0.75rem;
  --md-touch: 44px;
}

body {
  font-family: var(--md-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.md-header {
  width: 100%;
  align-items: center;
  text-align: center;
}

.md-header__logo,
.md-header__logo--mobile {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.md-header__logo img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.md-header__title {
  font-weight: 600;
  width: 100%;
}

.md-header__subtitle {
  width: 100%;
}

.md-form {
  gap: 22px;
}

.md-field__box {
  min-height: 52px;
  border-color: var(--md-outline-variant);
  overflow: visible;
}

.md-field__box:focus-within {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 1px var(--md-primary);
}

.md-field--filled .md-field__box:not(:focus-within) {
  border-color: var(--md-outline-variant);
  box-shadow: none;
}

.md-field__input {
  height: 52px;
  padding: 16px;
  line-height: 1.4;
  font-size: 1rem;
}

.md-field__input:focus,
.md-field--filled .md-field__input {
  padding-top: 28px;
  padding-bottom: 10px;
}

.md-field__box:has(.md-field__trailing) .md-field__input {
  padding-right: 48px;
}

.md-field__label {
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 1rem;
  line-height: 1.2;
  max-width: calc(100% - 32px);
  transform-origin: left center;
}

.md-field__box:has(.md-field__trailing) .md-field__label {
  max-width: calc(100% - 56px);
}

.md-field__input:focus + .md-field__label,
.md-field--filled .md-field__label {
  top: 10px;
  transform: translateY(0);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--md-primary);
  background: transparent;
  padding: 0;
  left: 16px;
}

.md-field__trailing {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding-right: 6px;
  pointer-events: none;
}

.md-field__trailing .md-icon-btn {
  pointer-events: auto;
}

.md-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: none;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--md-on-surface-variant);
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

.md-icon-btn .bi {
  font-size: 1.125rem;
  line-height: 1;
  display: block;
}

.md-icon-btn:active {
  background: rgba(44, 82, 130, 0.08);
}

.md-btn {
  border-radius: var(--md-shape-lg);
}

.md-btn--filled {
  background: var(--md-primary);
  margin-top: 4px;
}

.md-btn--filled:hover:not(:disabled) {
  background: var(--md-primary-dark);
}

.md-text-btn {
  color: var(--md-primary);
}

.md-install {
  background: var(--md-primary-container);
}

@media (min-width: 600px) {
  body {
    background: var(--md-surface-dim);
  }

  .md-app__main {
    width: 100%;
    max-width: 420px;
    padding: 48px 20px;
    gap: 24px;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
  }

  .md-brand {
    display: none;
  }

  .md-panel {
    width: 100%;
    background: var(--md-surface);
    border-radius: var(--md-shape-lg);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: 24px 20px 28px;
  }

  .md-header__logo--mobile,
  .md-header__title,
  .md-header__subtitle {
    display: block;
  }
}

@media (min-width: 1200px) {
  .md-app__main {
    max-width: 960px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 40px;
    padding: 56px 32px;
  }

  .md-brand {
    display: flex;
    flex: 1 1 0;
    max-width: 440px;
    min-width: 0;
    padding-right: 0;
    align-items: flex-start;
    text-align: left;
  }

  .md-panel {
    flex: 0 0 380px;
    width: 380px;
    max-width: 380px;
  }

  .md-header__logo--mobile,
  .md-header__title,
  .md-header__subtitle {
    display: none;
  }
}

@media (max-width: 899px) {
  .md-app__main {
    width: 100%;
    max-width: 420px;
    align-items: center;
  }

  .md-panel {
    width: 100%;
    max-width: 100%;
    align-items: stretch;
  }

  .md-header,
  .md-form,
  .md-actions,
  .md-footer {
    width: 100%;
  }

  .md-header {
    padding-bottom: 24px;
  }

  .md-header__logo {
    margin-bottom: 20px;
  }

  .md-actions {
    margin-bottom: 4px;
  }

  .md-footer {
    margin-top: 20px;
    padding-top: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .md-footer__links {
    order: 1;
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }

  .md-footer__links a {
    display: inline-flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-height: 48px;
    padding: 10px 6px;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    color: var(--md-primary);
    background: #fff;
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--md-shape-lg);
    text-decoration: none;
    box-sizing: border-box;
  }

  .md-footer__links a .bi {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
  }

  .md-footer__links a:active {
    background: var(--md-primary-container);
    border-color: var(--md-primary);
  }

  .md-footer__secure {
    order: 2;
    margin: 4px 0 0;
    font-size: 0.8125rem;
  }
}

/* === Saudação da marca no login (formatação do nome da empresa) === */
.md-brand__tagline {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 400;
  color: var(--md-on-surface-variant);
}

.md-brand__org {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--md-primary);
  overflow-wrap: break-word;
}

/* === Remove o botao nativo de revelar/limpar senha (Edge/IE) === */
/* Evita olho duplicado: mantemos apenas o toggle proprio do app. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
.md-field__input::-ms-reveal,
.md-field__input::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
