/*
 * Login — Design System aplicado (Fase 3).
 * Fonte: design_system/css/login.css. Único ajuste vs original: caminho da
 * imagem de fundo (../images/background.png em vez de ../../_img/…), pra
 * bater com o public/ do Laravel.
 */
:root {
  --ds-brand-500: #204fa2;
  --ds-brand-700: #0d1b57;
  --ds-surface: #fff;
  --ds-text: #333;
  --ds-text-input: #555;
  --ds-border: #ccc;
  --ds-danger: #c0392b;
  --ds-danger-bg: #fdecea;
  --ds-focus: 0 0 0 3px rgba(32, 79, 162, 0.35);
  --ds-font: "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html { height: 100%; }

body {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: var(--ds-text);
  background: #d4e1f4 url(../images/background.png) left top repeat fixed;
  font-family: var(--ds-font);
  font-size: 14px;
}

button, input { font: inherit; }

#container {
  display: grid;
  grid-template-columns: 304px 304px;
  width: 608px;
  min-height: 304px;
  text-align: center;
}

#cabecalho {
  display: grid;
  place-items: center;
  min-height: 304px;
  background: linear-gradient(var(--ds-brand-500), var(--ds-brand-700));
  border-radius: 25px 0 0 25px;
}

#cabecalho img {
  display: block;
  width: 168px;
  height: 150px;
  object-fit: contain;
}

#contend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 304px;
  padding: 32px 36px;
  background: var(--ds-surface);
  border: 2px solid var(--ds-brand-700);
  border-left: 0;
  border-radius: 0 25px 25px 0;
}

#login { width: 100%; }

.group_form { min-height: 70px; text-align: left; }

label { display: block; margin-bottom: 6px; font-weight: bold; }

input[type="text"],
input[type="password"] {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 9px;
  color: var(--ds-text-input);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

input:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ds-focus); }
input[aria-invalid="true"] { border-color: var(--ds-danger); }

.field-error {
  display: block;
  min-height: 16px;
  margin-top: 3px;
  color: var(--ds-danger);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 22px;
  border: 1px solid var(--ds-brand-700);
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.btn--primary {
  color: #fff;
  background: linear-gradient(var(--ds-brand-500), var(--ds-brand-700));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.btn--primary:hover { background: linear-gradient(#2a60bd, #142573); }
.btn--primary:active { transform: translateY(1px); }
.btn--lg { font-size: 17px; }

.alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-left: 4px solid var(--ds-danger);
  border-radius: 4px;
  text-align: left;
}

.alert[hidden] { display: none; }
.alert--danger { color: #81261d; background: var(--ds-danger-bg); }

@media (max-width: 680px) {
  body {
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: 20px;
  }

  #container {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, 30vh) auto;
    width: min(100%, 360px);
    min-height: 0;
    margin: auto;
  }

  #cabecalho { min-height: 150px; border-radius: 25px 25px 0 0; }
  #cabecalho img { width: 140px; height: 125px; }

  #contend {
    min-height: 300px;
    padding: 28px 32px 32px;
    border: 2px solid var(--ds-brand-700);
    border-top: 0;
    border-radius: 0 0 25px 25px;
  }

  input[type="text"], input[type="password"] { height: 44px; font-size: 16px; }
  .group_form { min-height: 80px; }
  .btn { width: 100%; min-height: 44px; }
}

@media (max-width: 380px) {
  body { padding: 12px; }
  #contend { padding-right: 24px; padding-left: 24px; }
}
