:root {
  --bg-1: #020917;
  --bg-2: #081d3e;
  --text: #eef7ff;
  --muted: #a7bfdc;
  --cyan: #27d7ff;
  --blue: #1989ff;
  --green: #44e9a0;
  --yellow: #ffd15c;
  --red: #ef5a67;
  --line: rgba(59, 155, 255, 0.32);
  --line-soft: rgba(112, 172, 230, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: #031126;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

/* ================= LOGIN v1.0.1 ================= */

.exact-login {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
  background: #031126;
}

/* Fundo já sem formulário e sem Wi-Fi estático. */
.login-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("/login-bg-v1.0.1.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

/* Formulário real dentro do painel vazio da imagem. */
.exact-form {
  position: absolute;
  z-index: 5;
  left: 63.15%;
  top: 25.2%;
  width: 28.4%;
  height: 55.5%;
}

.exact-form .field-label {
  display: block;
  margin: 0 0 10px 2px;
  color: #fff;
  font-size: clamp(14px, .95vw, 18px);
  font-weight: 700;
}

.exact-form .field-label:first-of-type {
  position: absolute;
  top: 0;
  left: 0;
}

.input-wrap {
  position: absolute;
  left: 0;
  width: 100%;
}

.input-wrap:first-of-type {
  top: 8.5%;
}

.senha-group {
  position: absolute;
  left: 0;
  top: 30.7%;
  width: 100%;
}

.senha-group .field-label {
  margin-bottom: 10px;
}

.senha-group .input-wrap {
  position: relative;
  top: 0;
}

.text-input {
  width: 100%;
  height: 68px;
  border-radius: 12px;
  border: 1px solid rgba(54, 173, 255, .72);
  background: rgba(7, 28, 58, .93);
  color: #f2f9ff;
  padding: 0 54px 0 52px;
  outline: none;
  font-size: clamp(14px, .95vw, 18px);
  box-shadow: inset 0 0 24px rgba(5, 20, 45, .35);
}

.text-input::placeholder {
  color: #86a4c8;
}

.text-input:focus {
  border-color: #2fd0ff;
  box-shadow:
    0 0 0 3px rgba(47, 208, 255, .10),
    inset 0 0 24px rgba(5, 20, 45, .35);
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  color: #8ecbff;
  font-size: 15px;
  pointer-events: none;
}

.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  border: 0;
  background: transparent;
  color: #98c8ff;
  cursor: pointer;
  font-size: 17px;
}

.remember-line {
  position: absolute;
  left: 0;
  top: 57%;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-size: clamp(13px, .9vw, 16px);
  cursor: pointer;
}

.remember-line input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #2bc9ff;
}

.primary-button {
  position: absolute;
  left: 0;
  top: 68%;
  width: 100%;
  height: 68px;
  border: 1px solid rgba(75, 225, 255, .60);
  border-radius: 12px;
  color: white;
  cursor: pointer;
  font-size: clamp(16px, 1.05vw, 20px);
  font-weight: 800;
  letter-spacing: .03em;
  background: linear-gradient(95deg, #23c7ec 0%, #178fff 55%, #0c6eff 100%);
  box-shadow: 0 12px 28px rgba(15, 127, 255, .28);
}

.primary-button:hover { filter: brightness(1.05); }
.primary-button span { margin-left: 12px; }

.login-footer-chip {
  position: absolute;
  left: 50%;
  top: 84%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #afc1d8;
  font-size: 13px;
}

.login-footer-brand {
  position: absolute;
  left: 0;
  top: 91%;
  width: 100%;
  text-align: center;
  color: #eef6ff;
  font-size: 14px;
}

.login-footer-link {
  position: absolute;
  left: 0;
  top: 96.5%;
  width: 100%;
  text-align: center;
  color: #18c7ff;
  font-size: 13px;
  font-weight: 600;
}

.login-error {
  position: absolute;
  left: 0;
  top: -9%;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  color: #ffc3c8;
  background: rgba(183, 42, 55, .94);
  border: 1px solid rgba(255, 132, 142, .34);
  font-size: 12px;
}

/* Wi-Fi animado: ponto -> barra 1 -> barra 2 -> barra 3. */
.wifi-animation {
  position: absolute;
  z-index: 4;
  left: 5.15%;
  top: 35.8%;
  width: 15.2%;
  aspect-ratio: 1 / 1;
  pointer-events: none;
}

.wifi-dot-live {
  position: absolute;
  left: 50%;
  bottom: 5%;
  width: 12%;
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #72f6ff, #1dd3ff 52%, #0879ff 100%);
  box-shadow: 0 0 22px rgba(36, 218, 255, .95);
  animation: wifi-dot 2.15s infinite ease-in-out;
}

.wifi-live {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-style: solid;
  border-color: transparent;
  border-bottom-color: #25d9ff;
  border-radius: 0 0 999px 999px;
  filter: drop-shadow(0 0 14px rgba(37, 217, 255, .88));
  opacity: .05;
}

.wifi-live-1 {
  width: 42%;
  height: 20%;
  bottom: 19%;
  border-width: 0 0 13px 0;
  animation: wifi-arc-live 2.15s infinite ease-in-out .25s;
}

.wifi-live-2 {
  width: 67%;
  height: 33%;
  bottom: 27%;
  border-width: 0 0 14px 0;
  animation: wifi-arc-live 2.15s infinite ease-in-out .55s;
}

.wifi-live-3 {
  width: 92%;
  height: 46%;
  bottom: 35%;
  border-width: 0 0 15px 0;
  animation: wifi-arc-live 2.15s infinite ease-in-out .85s;
}

@keyframes wifi-dot {
  0%, 100% { opacity: .35; transform: translateX(-50%) scale(.82); }
  12%, 82% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes wifi-arc-live {
  0%, 16% { opacity: .04; }
  28%, 76% { opacity: 1; }
  93%, 100% { opacity: .05; }
}

/* Mobile / tablet */
@media (max-width: 980px) {
  .login-background {
    background-position: 35% center;
  }

  .wifi-animation {
    display: none;
  }

  .exact-form {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, 90vw);
    height: 520px;
    padding: 26px;
    border-radius: 22px;
    background: rgba(4, 22, 48, .96);
    border: 1px solid rgba(47, 176, 255, .54);
    box-shadow: 0 22px 60px rgba(0,0,0,.38);
  }

  .exact-form .field-label:first-of-type {
    top: 26px;
    left: 26px;
  }

  .input-wrap:first-of-type {
    top: 58px;
    left: 26px;
    width: calc(100% - 52px);
  }

  .senha-group {
    top: 158px;
    left: 26px;
    width: calc(100% - 52px);
  }

  .remember-line {
    top: 270px;
    left: 26px;
  }

  .primary-button {
    top: 320px;
    left: 26px;
    width: calc(100% - 52px);
  }

  .login-footer-chip { top: 405px; }
  .login-footer-brand { top: 448px; }
  .login-footer-link { top: 478px; }
}

/* ================= DASHBOARDS ================= */


.topbar {
    height: 78px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(5, 20, 42, .94);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 17px;
}

.brand-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.brand-title {
    font-weight: 800;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #c9d7e8;
    font-size: 13px;
}

.logout-link {
    color: #8fb2d7;
}

.dashboard {
    width: min(1240px, 94%);
    margin: 30px auto 50px;
}

.hero-card,
.module-card,
.stat-card {
    background: linear-gradient(180deg, rgba(12, 32, 59, .97), rgba(7, 24, 47, .97));
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    box-shadow: 0 16px 44px rgba(0,0,0,.13);
}

.hero-card {
    padding: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 22px;
}

.company-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.company-logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    border-radius: 13px;
}

.company-title {
    margin: 0;
    font-size: 25px;
}

.company-meta {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.role-chip {
    padding: 8px 11px;
    border-radius: 999px;
    color: #70caff;
    background: rgba(20, 135, 255, .11);
    border: 1px solid rgba(40, 170, 255, .20);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 21px;
}

.stat-label {
    color: #8da5c3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.stat-value {
    margin-top: 7px;
    font-size: 38px;
    font-weight: 800;
}

.green { color: var(--green); }
.blue { color: #3bb7ff; }
.yellow { color: var(--yellow); }

.module-card {
    overflow: hidden;
    margin-bottom: 22px;
}

.module-head {
    padding: 18px 21px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
}

.module-title {
    font-weight: 800;
}

.status-online {
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--green);
    background: rgba(69, 226, 154, .08);
    font-size: 11px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 13px 17px;
    text-align: left;
    color: #8199b8;
    background: rgba(2, 13, 28, .46);
    font-size: 11px;
}

td {
    padding: 14px 17px;
    border-top: 1px solid rgba(106, 157, 211, .10);
    font-size: 13px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.admin-link {
    min-height: 155px;
    padding: 22px;
    border-radius: 15px;
    border: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(13, 37, 70, .94), rgba(7, 25, 49, .94));
}

.admin-link h3 {
    margin: 0 0 8px;
}

.admin-link p {
    color: var(--muted);
    line-height: 1.55;
    font-size: 13px;
}

.notice {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 10px;
    color: #6be6a6;
    background: rgba(69, 226, 154, .07);
    border: 1px solid rgba(69, 226, 154, .22);
}

.action-btn {
    border: 0;
    padding: 9px 13px;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    background: #128df0;
    font-weight: 700;
    font-size: 12px;
}

.action-btn.danger {
    background: #d94754;
}

.footer {
    text-align: center;
    color: #607a9b;
    font-size: 11px;
    padding: 15px 0;
}

@media (max-width: 980px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-hero {
        display: none;
    }

    .login-side {
        padding: 25px;
    }

    .login-card {
        min-height: auto;
    }

    .stats,
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .login-card {
        padding: 42px 24px 30px;
    }

    .topbar {
        padding: 0 15px;
    }

    .hero-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard {
        width: 96%;
    }

    th, td {
        padding: 10px 8px;
    }
}
