/* =============================================================================
   PCNET-IT Connect · Login
   Linguagem visual adotada do Portal de Atendimento PCNet-IT (192.168.114.18):
   malha low-poly animada, cartão com domo, lente divisória e paleta do portal.
   Assets (bgmesh.js, cardshards.js, Outfit) servidos localmente — sem CDN.

   O botão usa --pk-green-ink (#356c16) do Blueprint PCNet: 6,35:1 com texto
   branco, contra 3,75:1 do --pk-green-dark. É o token que o próprio design
   system reserva para texto e ações.
   ============================================================================= */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* --- Paleta do Portal de Atendimento --- */
  --bg-primary:      #eef1f6;
  --bg-surface:      #ffffff;
  --pcnet-green:     #8CC63F;   /* decorativo: malha, lente */
  --pcnet-green-dark:#459535;   /* títulos grandes (3,75:1 — AA para texto grande) */
  --green-action:    #356c16;   /* --pk-green-ink do Blueprint (6,35:1 — AA) */
  --green-action-hi: #2a5711;
  --text-primary:    #1d2433;
  --text-secondary:  #5b6678;
  --border-default:  #e3e8ef;
  --danger:          #b3261e;
  --danger-bg:       #fdf2f1;
  --danger-border:   #f2c9c5;

  --font-display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --shadow-md: 0 2px 6px rgba(16,24,40,.06), 0 8px 20px rgba(16,24,40,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  font-family: var(--font-display);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ===== Fundo: malha poligonal animada ===== */
#fw-bg-mesh {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: -1;
  pointer-events: none;
  display: block;
  opacity: .45;
  -webkit-mask-image: radial-gradient(ellipse 32% 34% at 50% 24%,
                      transparent 0%, transparent 22%, rgba(0,0,0,.55) 45%, #000 70%);
          mask-image: radial-gradient(ellipse 32% 34% at 50% 24%,
                      transparent 0%, transparent 22%, rgba(0,0,0,.55) 45%, #000 70%);
}
#fw-bg-mesh .fw-mesh-wire { fill: none; stroke: #6aa832; stroke-width: 1.3; stroke-opacity: .5; }
#fw-bg-mesh .fw-mesh-tri,
#card-bg-mesh .fw-mesh-tri {
  stroke: none;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
#fw-bg-mesh .fw-mesh-tri--a, #card-bg-mesh .fw-mesh-tri--a { animation-name: fw-mesh-tw-a; }
#fw-bg-mesh .fw-mesh-tri--b, #card-bg-mesh .fw-mesh-tri--b { animation-name: fw-mesh-tw-b; }
#fw-bg-mesh .fw-mesh-tri--c, #card-bg-mesh .fw-mesh-tri--c { animation-name: fw-mesh-tw-c; }

@keyframes fw-mesh-tw-a {
  0%, 62%, 100% { opacity: 0;   fill: #6aa832; }
  72%           { opacity: .85; fill: #8CC63F; }
  84%           { opacity: .50; fill: #a8c840; }
}
@keyframes fw-mesh-tw-b {
  0%, 58%, 100% { opacity: 0;   fill: #78b840; }
  70%           { opacity: .75; fill: #b2d977; }
  82%           { opacity: .45; fill: #8CC63F; }
}
@keyframes fw-mesh-tw-c {
  0%, 65%, 100% { opacity: 0;   fill: #a8c840; }
  75%           { opacity: .80; fill: #d0e7ad; }
  88%           { opacity: .40; fill: #78b840; }
}

/* ===== Palco e cartão ===== */
.hero {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(90px, 10vh, 120px) clamp(20px, 5vw, 64px) clamp(24px, 6vh, 64px);
}

.card {
  position: relative;
  width: min(560px, 92vw);
  background: var(--bg-surface);
  border-radius: 25px;
  box-shadow: 0 0 60px -15px rgba(0,0,0,.25);
  padding: 143px 0 0 0;
  display: flex;
  flex-direction: column;
  text-align: center;
}

/* véu verde gaussiano acima da lente, a respirar */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 155px;
  z-index: 0;
  pointer-events: none;
  border-radius: 25px 25px 0 0;
  background: radial-gradient(ellipse 82% 100% at 50% 100%,
              rgba(140,198,63,.05) 0%, rgba(140,198,63,.02) 45%, rgba(140,198,63,0) 72%);
  filter: blur(6px);
  animation: veil-breathe 4s ease-in-out infinite;
}
@keyframes veil-breathe { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }

.card-bg-mesh {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 165px;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
  opacity: .32;
}
#card-bg-mesh .fw-mesh-wire { fill: none; stroke: #6aa832; stroke-width: .8; stroke-opacity: .08; }

.card-shards {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 165px;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
.card-shards .shard {
  position: absolute;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  opacity: 0;
  animation-name: shard-rise;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}
@keyframes shard-rise {
  0%   { opacity: 0;   transform: translate(0,0) rotate(0) scale(.5); }
  14%  { opacity: .85; }
  70%  { opacity: .35; }
  100% { opacity: 0;   transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1.05); }
}

/* ===== Domo com o logótipo ===== */
.avatar {
  position: absolute;
  z-index: 1;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--bg-surface);
  box-shadow: 0 10px 20px -8px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.avatar-img { width: 162px; height: auto; }

/* ===== Lente divisória ===== */
.colorband {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  opacity: .5;
}

/* ===== Texto do cartão ===== */
.card h2, .card .desc, .card .form, .card .foot { position: relative; z-index: 1; }
.card h2 {
  padding: 1.25rem 1rem .25rem;
  font-size: clamp(1.3rem, 3.8vw, 1.6rem);
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--pcnet-green-dark);
  text-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.card .desc {
  padding: .25rem 1.75rem 1.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ===== Formulário ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 2.25rem 1.75rem;
  text-align: left;
}
.alert {
  font-size: 14px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  padding: 10px 13px;
}
.alert[hidden] { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.control { position: relative; display: flex; align-items: center; }
.control input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.control input:hover { border-color: #ccd4e0; }
.control input:focus {
  border-color: var(--green-action);
  box-shadow: 0 0 0 3px rgba(53,108,22,.14);
}
.control:has(.eye) input { padding-right: 44px; }
.eye {
  position: absolute; right: 6px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-secondary); border-radius: 8px;
  transition: color .15s, background .15s;
}
.eye:hover { color: var(--text-primary); background: #f1f4f8; }

.row { display: flex; align-items: center; justify-content: space-between; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 17px; height: 17px; flex: none;
  border: 1px solid var(--border-default); border-radius: 5px;
  background: var(--bg-surface); position: relative;
  transition: background .15s, border-color .15s;
}
.check input:checked + .box { background: var(--green-action); border-color: var(--green-action); }
.check input:checked + .box::after {
  content: ''; position: absolute; left: 5.5px; top: 2px;
  width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(53,108,22,.16); }
.link { font-size: 14px; color: var(--green-action); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

.btn {
  height: 46px;
  margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  color: #fff;
  background: var(--green-action);
  border: none; border-radius: 12px; cursor: pointer;
  transition: background .18s, transform .18s;
}
.btn:hover:not(:disabled)  { background: var(--green-action-hi); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .65; cursor: default; }
.btn-spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn-spin[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg) } }

.foot {
  padding: 1rem;
  border-top: 1px solid var(--border-default);
  background: #fafafa;
  border-radius: 0 0 25px 25px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Acessibilidade ===== */
:focus-visible { outline: 2px solid var(--green-action); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .card::before { animation: none; opacity: .8 }
  .card-shards { display: none }
  #fw-bg-mesh .fw-mesh-tri, #card-bg-mesh .fw-mesh-tri { animation: none; opacity: 0 }
}
@media (max-width: 480px) {
  .card { padding-top: 120px }
  .avatar { width: 160px; height: 160px; top: -48px }
  .avatar-img { width: 128px }
  .form { padding: 0 1.5rem 1.5rem }
}
