/* Entrada do painel (app_login_v2).
 *
 * É o mesmo desenho do login anterior (ecrã dividido: fotografia da sede
 * com a marca à esquerda, cartão de entrada à direita), trazido para
 * dentro da app. O original vivia em
 * `_lib/libraries/grp/fo_panel_login/login/css/login_modern.css`, e o
 * `_lib/` desaparece quando o ScriptCase sair — por isso o CSS e as
 * imagens passaram a viver aqui.
 *
 * Foram retirados os seletores que só existiam para domar o HTML gerado
 * pelo ScriptCase (`.scFormObjectOdd`, `.sc-ui-pwd-toggle-icon`, captcha,
 * `#id_error_display_fixed`): o formulário agora é nosso e não precisa de
 * `!important` nenhum.
 */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --fo-navy: #0b1f33;
  --fo-navy-deep: #061524;
  --fo-cyan: #3db8e8;
  --fo-teal: #0d6e7a;
  --fo-ink: #102033;
  --fo-muted: #5b6b7c;
  --fo-line: #d7e0ea;
  --fo-panel: #f7f9fc;
  --fo-danger: #c62828;
  --fo-ok: #0f9f6e;
  --fo-radius: 14px;
  --fo-radius-sm: 10px;
  --fo-shadow: 0 24px 60px rgba(6, 21, 36, 0.28);
  --fo-font: "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body.fo-login {
  font-family: var(--fo-font);
  color: var(--fo-ink);
  background: var(--fo-navy-deep);
  overflow-x: hidden;
}

.fo-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* —— Lado da fotografia —— */
.fo-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 4vw, 3.5rem);
  overflow: hidden;
  color: #fff;
}

.fo-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(160deg, rgba(6, 21, 36, 0.55) 0%, rgba(6, 21, 36, 0.25) 42%, rgba(6, 21, 36, 0.72) 100%),
    url("img/photo_nova_sede.jpg") center / cover no-repeat;
  transform: scale(1.04);
  animation: fo-ken 28s ease-in-out infinite alternate;
}

.fo-hero__glow {
  position: absolute;
  inset: auto -10% -20% auto;
  width: 55%;
  height: 55%;
  z-index: -1;
  background: radial-gradient(circle, rgba(61, 184, 232, 0.28), transparent 68%);
  pointer-events: none;
}

.fo-hero__brand {
  max-width: 28rem;
  animation: fo-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fo-hero__logo {
  display: block;
  width: min(220px, 55vw);
  height: auto;
  margin-bottom: 1.75rem;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.fo-hero__kicker {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fo-cyan);
}

.fo-hero__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.fo-hero__text {
  margin: 0;
  max-width: 26rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}

.fo-hero__footer {
  margin-top: 2.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  animation: fo-rise 0.9s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* —— Lado do formulário —— */
.fo-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(61, 184, 232, 0.1), transparent 55%),
    linear-gradient(180deg, #eef3f8 0%, var(--fo-panel) 48%, #e8eef5 100%);
  animation: fo-panel-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fo-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: clamp(1.6rem, 3vw, 2.35rem);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: calc(var(--fo-radius) + 4px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--fo-shadow);
  backdrop-filter: blur(10px);
}

.fo-card__head { margin-bottom: 1.75rem; }

.fo-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--fo-navy);
}

.fo-card__subtitle {
  margin: 0;
  color: var(--fo-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 500;
}

.fo-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fo-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fo-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fo-muted);
}

.fo-input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--fo-line);
  border-radius: var(--fo-radius-sm);
  background: #fff;
  color: var(--fo-ink);
  font: 500 0.98rem/1.3 var(--fo-font);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fo-input:focus {
  outline: none;
  border-color: rgba(61, 184, 232, 0.85);
  box-shadow: 0 0 0 4px rgba(61, 184, 232, 0.18);
}

/* Campo da password com o "Mostrar" encostado à direita, dentro da caixa. */
.fo-pwd { position: relative; }
.fo-pwd .fo-input { padding-right: 5rem; }

.fo-pwd-toggle {
  position: absolute;
  right: 0.55rem;
  bottom: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--fo-muted);
  font: 700 0.78rem/1 var(--fo-font);
  letter-spacing: 0.03em;
  cursor: pointer;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
}
.fo-pwd-toggle:hover { color: var(--fo-navy); background: rgba(11, 31, 51, 0.06); }

.fo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.fo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.25rem;
  border: 0;
  border-radius: var(--fo-radius-sm);
  background: linear-gradient(135deg, var(--fo-navy) 0%, #143a5c 55%, var(--fo-teal) 140%);
  color: #fff;
  font: 700 1rem/1 var(--fo-font);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(11, 31, 51, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.fo-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(11, 31, 51, 0.34);
}
.fo-btn:active { transform: translateY(0); }

.fo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-top: 0.25rem;
}

.fo-links a {
  color: var(--fo-teal);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.fo-links a:hover { color: var(--fo-navy); text-decoration: underline; }

.fo-remember {
  display: inline-flex;
  align-items: center;
  color: var(--fo-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.fo-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--fo-teal);
  vertical-align: middle;
  margin-right: 0.35rem;
}

/* —— Mensagens —— */
.fo-msg {
  margin-bottom: 1.1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--fo-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}
.fo-msg--erro { background: rgba(198, 40, 40, 0.08); border: 1px solid rgba(198, 40, 40, 0.25); color: var(--fo-danger); }
.fo-msg--ok   { background: rgba(15, 159, 110, 0.08); border: 1px solid rgba(15, 159, 110, 0.25); color: var(--fo-ok); }

.fo-rules {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fo-muted);
}
.fo-rules li { padding-left: 0.9rem; position: relative; }
.fo-rules li::before { content: "·"; position: absolute; left: 0.25rem; }

/* —— Animações —— */
@keyframes fo-ken {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}
@keyframes fo-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fo-panel-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .fo-hero__media,
  .fo-hero__brand,
  .fo-hero__footer,
  .fo-panel { animation: none !important; }
  .fo-hero__media { transform: none; }
}

/* —— Ecrãs estreitos: a fotografia passa a faixa no topo —— */
@media (max-width: 960px) {
  .fo-shell { grid-template-columns: 1fr; }

  .fo-hero {
    min-height: 34vh;
    padding: 1.5rem 1.35rem 1.75rem;
  }
  .fo-hero__media { animation: none; transform: none; }
  .fo-hero__logo { width: 160px; margin-bottom: 1rem; }
  .fo-hero__title { font-size: 1.45rem; }
  .fo-hero__text,
  .fo-hero__footer { display: none; }

  .fo-panel {
    align-items: flex-start;
    padding: 1.25rem 1.1rem 2rem;
    animation: fo-rise 0.55s ease both;
  }
  .fo-card {
    max-width: none;
    box-shadow: 0 12px 32px rgba(6, 21, 36, 0.14);
  }
}

@media (max-width: 480px) {
  .fo-meta { flex-direction: column; align-items: flex-start; }
}
