/**
 * Gensys Auth UI â€” proporÃ§Ã£o, ritmo e logo
 * Escala: 8px Â· CartÃ£o ~380px Â· Logo ~168px
 */
:root {
  --gs-navy: #0a2342;
  --gs-navy-mid: #143a66;
  --gs-red: #d61f26;
  --gs-red-soft: rgba(214, 31, 38, 0.08);
  --gs-bg: #f4f6f9;
  --gs-text: #0f1c2e;
  --gs-muted: #667789;
  --gs-line: #e4ebf2;
  --gs-card: #ffffff;
  --gs-shadow: 0 18px 40px rgba(10, 35, 66, 0.07);
  --gs-shadow-btn: 0 10px 20px rgba(10, 35, 66, 0.16);
  --gs-radius-card: 20px;
  --gs-radius-ctl: 999px;
  --gs-font: "Manrope", "Segoe UI", sans-serif;
  --gs-space: 8px;
  --gs-logo-w: 168px;
  --gs-card-w: 380px;
  --gs-pad-x: 36px;
  --gs-pad-y: 32px;
  --gs-control-h: 46px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.gs-auth {
  min-height: 100%;
}

body.gs-auth {
  margin: 0;
  font-family: var(--gs-font);
  color: var(--gs-text);
  background-color: var(--gs-bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(20, 58, 102, 0.035), transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--gs-space) * 4) calc(var(--gs-space) * 2);
  position: relative;
  overflow-x: hidden;
}

body.gs-auth::before,
body.gs-auth::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
}

body.gs-auth::before {
  left: -80px;
  top: 14%;
  width: 240px;
  height: 240px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%230a2342' stroke-width='1' opacity='0.4'%3E%3Ccircle cx='30' cy='42' r='2.5' fill='%230a2342'/%3E%3Ccircle cx='86' cy='28' r='2' fill='%230a2342'/%3E%3Ccircle cx='66' cy='94' r='2.5' fill='%230a2342'/%3E%3Ccircle cx='128' cy='72' r='2' fill='%230a2342'/%3E%3Cpath d='M30 42L86 28L66 94L30 42M86 28L128 72L66 94'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
}

body.gs-auth::after {
  right: -50px;
  bottom: 14%;
  width: 200px;
  height: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%230a2342' stroke-width='1' opacity='0.35'%3E%3Cpath d='M20 100h28l12-28 18 54 14-34h36'/%3E%3Cpath d='M126 48c0-14 11-26 26-26s26 12 26 26c0 22-26 40-26 40s-26-18-26-40z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
}

@keyframes gs-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.gs-auth-shell {
  width: 100%;
  max-width: var(--gs-card-w);
  position: relative;
  z-index: 1;
  animation: gs-rise 0.5s ease-out both;
}

.gs-auth-card {
  background: var(--gs-card);
  border-radius: var(--gs-radius-card);
  box-shadow: var(--gs-shadow);
  padding: var(--gs-pad-y) var(--gs-pad-x) calc(var(--gs-pad-y) - 4px);
  border: 1px solid var(--gs-line);
  display: flex;
  flex-direction: column;
}

/* â€”â€” Logo: hero controlado â€”â€” */
.gs-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 calc(var(--gs-space) * 2.5);
  padding: 0;
  line-height: 0;
}

.gs-brand img {
  display: block;
  width: var(--gs-logo-w);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
}

/* â€”â€” TÃ­tulo â€”â€” */
.gs-welcome {
  text-align: center;
  margin: 0 0 calc(var(--gs-space) * 3);
  padding: 0;
  font-size: 1.125rem; /* 18px */
  line-height: 1.35;
  font-weight: 700;
  color: var(--gs-navy);
  letter-spacing: -0.02em;
}

.gs-welcome small {
  display: block;
  margin-top: calc(var(--gs-space) * 0.75);
  font-size: 0.8125rem; /* 13px */
  line-height: 1.4;
  font-weight: 500;
  color: var(--gs-muted);
  letter-spacing: 0;
}

.gs-alert {
  border-radius: 10px;
  padding: calc(var(--gs-space) * 1.25) calc(var(--gs-space) * 1.5);
  margin: 0 0 calc(var(--gs-space) * 2);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-align: center;
}

.gs-alert-error {
  background: var(--gs-red-soft);
  color: #9a151b;
  border: 1px solid rgba(214, 31, 38, 0.16);
}

.gs-alert-ok {
  background: rgba(15, 118, 70, 0.07);
  color: #0d6a3e;
  border: 1px solid rgba(15, 118, 70, 0.14);
}

/* â€”â€” FormulÃ¡rio: ritmo vertical consistente â€”â€” */
.gs-auth-card form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.gs-field {
  margin: 0 0 calc(var(--gs-space) * 2);
}

.gs-field:last-of-type {
  margin-bottom: calc(var(--gs-space) * 1.25);
}

.gs-field label {
  display: block;
  margin: 0 0 calc(var(--gs-space) * 0.75) 4px;
  font-size: 0.75rem; /* 12px */
  line-height: 1.3;
  font-weight: 650;
  color: var(--gs-muted);
  letter-spacing: 0.02em;
  text-transform: none;
}

.gs-field input {
  width: 100%;
  height: var(--gs-control-h);
  border: 1px solid var(--gs-line);
  border-radius: var(--gs-radius-ctl);
  padding: 0 18px;
  font-size: 0.875rem; /* 14px */
  line-height: 1.2;
  font-family: inherit;
  color: var(--gs-text);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(10, 35, 66, 0.03);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.gs-field input::placeholder {
  color: #9aa8b6;
  font-style: italic;
  font-size: 0.8125rem;
}

.gs-field input:focus {
  border-color: var(--gs-navy-mid);
  box-shadow: 0 0 0 3px rgba(20, 58, 102, 0.1);
}

.gs-row-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 2px calc(var(--gs-space) * 2.5);
  min-height: 20px;
}

.gs-link {
  color: var(--gs-navy-mid);
  font-size: 0.75rem;
  line-height: 1.3;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.18s ease;
}

.gs-link:hover,
.gs-link:focus {
  color: var(--gs-red);
  text-decoration: none;
}

.gs-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin: 0;
  border: 0;
  border-radius: var(--gs-radius-ctl);
  background: var(--gs-navy);
  color: #fff;
  font-family: inherit;
  font-size: 0.9375rem; /* 15px */
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--gs-shadow-btn);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gs-btn:hover,
.gs-btn:focus {
  background: var(--gs-navy-mid);
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(10, 35, 66, 0.2);
  color: #fff;
  outline: none;
}

.gs-btn:active {
  transform: translateY(0);
  background: var(--gs-navy);
}

.gs-footer-link {
  text-align: center;
  margin-top: calc(var(--gs-space) * 3);
  padding-top: calc(var(--gs-space) * 2.25);
  border-top: 1px solid var(--gs-line);
}

.gs-footer-link a {
  color: var(--gs-navy);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.3;
  text-decoration: none;
}

.gs-footer-link a:hover {
  color: var(--gs-red);
}

.gs-meta {
  text-align: center;
  margin: calc(var(--gs-space) * 2.5) 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #8b97a6;
  position: relative;
  z-index: 1;
}

.gs-meta a {
  color: var(--gs-navy-mid);
  font-weight: 600;
  text-decoration: none;
}

/* Desktop largo: manter cartÃ£o compacto e centrado */
@media (min-width: 1100px) {
  :root {
    --gs-card-w: 400px;
    --gs-logo-w: 176px;
    --gs-pad-x: 40px;
    --gs-pad-y: 36px;
  }
}

/* Tablet / telemÃ³vel */
@media (max-width: 480px) {
  :root {
    --gs-card-w: 100%;
    --gs-logo-w: 148px;
    --gs-pad-x: 22px;
    --gs-pad-y: 26px;
    --gs-control-h: 44px;
  }

  body.gs-auth {
    align-items: flex-start;
    padding-top: calc(var(--gs-space) * 5);
  }

  .gs-auth-card {
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(10, 35, 66, 0.06);
  }

  .gs-welcome {
    font-size: 1.0625rem;
    margin-bottom: calc(var(--gs-space) * 2.5);
  }

  .gs-brand {
    margin-bottom: calc(var(--gs-space) * 2);
  }
}

/* Telas baixas: reduzir logo e paddings para caber sem scroll excessivo */
@media (max-height: 700px) {
  :root {
    --gs-logo-w: 140px;
    --gs-pad-y: 24px;
  }

  .gs-brand {
    margin-bottom: calc(var(--gs-space) * 1.5);
  }

  .gs-welcome {
    margin-bottom: calc(var(--gs-space) * 2);
  }

  .gs-footer-link {
    margin-top: calc(var(--gs-space) * 2);
    padding-top: calc(var(--gs-space) * 1.75);
  }
}

/* ——— Estado a processar (login) ——— */
.gs-btn {
  position: relative;
}

.gs-btn.is-loading {
  pointer-events: none;
  cursor: wait;
  opacity: 0.92;
}

.gs-btn.is-loading .gs-btn-label {
  visibility: hidden;
}

.gs-btn .gs-btn-spinner {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gs-spin 0.7s linear infinite;
}

.gs-btn.is-loading .gs-btn-spinner {
  display: block;
}

.gs-auth-card.is-busy {
  pointer-events: none;
}

.gs-auth-card.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.35);
}

.gs-auth-card {
  position: relative;
}

.gs-processing {
  display: none;
  margin-top: 12px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gs-muted);
}

.gs-auth-card.is-busy .gs-processing {
  display: block;
}

@keyframes gs-spin {
  to { transform: rotate(360deg); }
}
