@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Rajdhani:wght@600;700&display=swap");

:root {
  --bg-main: #020819;
  --bg-soft: #0b1934;
  --bg-card: #ffffff;
  --text-main: #0d1424;
  --text-light: #f7f9ff;
  --text-muted: #6e7789;
  --brand-red: #df111f;
  --brand-red-dark: #b80e19;
  --brand-navy: #03112d;
  --line: #e8ebf2;
  --good: #0d9b5b;
  --warning: #ed8c00;
  --alert: #d62828;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 18px 30px rgba(3, 12, 33, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, #1f355f, transparent 40%),
    radial-gradient(circle at 85% 90%, #551018, transparent 38%),
    linear-gradient(165deg, #01040d 0%, #041735 52%, #020818 100%);
  color: var(--text-main);
  padding: 20px;
}

a {
  color: inherit;
  text-decoration: none;
}

.screen-grid {
  max-width: 1200px;
  margin: 0 auto;
}

.screen-grid h1 {
  color: var(--text-light);
  font-family: "Rajdhani", sans-serif;
  font-size: 2.1rem;
  margin: 0 0 8px;
}

.screen-grid p {
  color: #d2dae9;
  margin: 0 0 24px;
}

.preview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.preview-card {
  background: linear-gradient(170deg, #f6f8ff 0%, #ffffff 55%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(232, 235, 242, 0.7);
  padding: 18px;
  box-shadow: 0 14px 24px rgba(3, 17, 45, 0.17);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.preview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 28px rgba(3, 17, 45, 0.24);
}

.preview-card h3 {
  margin: 0 0 6px;
}

.preview-card p {
  margin: 0;
  color: var(--text-muted);
}

.device-wrap {
  width: 100%;
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
}

.device {
  width: min(390px, 100%);
  min-height: 844px;
  background: #f4f6fb;
  border-radius: 34px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  position: relative;
}

.device::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% -8%, rgba(255, 88, 102, 0.2), transparent 36%);
  opacity: 0.9;
}

.device.login {
  background: radial-gradient(circle at 10% 15%, #213e77, transparent 36%),
    radial-gradient(circle at 80% 86%, #88232d, transparent 40%),
    linear-gradient(185deg, #04112b 0%, #070f23 100%);
}

.hero {
  color: var(--text-light);
  padding: 34px 24px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-red);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.brand-name {
  margin: 0;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.07;
}

.hero h1 span {
  color: #ff4a59;
}

.hero p {
  margin: 12px 0 0;
  max-width: 250px;
  color: #dce5ff;
  line-height: 1.5;
}

.login-sheet {
  margin: 28px 12px 10px;
  background: #ffffff;
  border-radius: 24px;
  padding: 18px;
}

.center-logo {
  width: 56px;
  height: 56px;
  margin: -46px auto 14px;
  border-radius: 12px;
  background: var(--brand-red);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: "Rajdhani", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  border: 4px solid #fff;
}

.sheet-title {
  margin: 0;
  text-align: center;
  font-size: 1.7rem;
  line-height: 1;
}

.sheet-subtitle {
  margin: 8px 0 14px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.93rem;
  margin-bottom: 10px;
}

.forgot {
  display: block;
  color: var(--brand-red);
  font-size: 0.82rem;
  text-align: center;
  margin-bottom: 14px;
}

.btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, #ee1a28, #cc101d);
  color: #fff;
}

.btn-secondary {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #dfe4ed;
  color: #273149;
}

.or-sep {
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 12px 0;
}

.sheet-footer {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.sheet-footer a {
  color: var(--brand-red);
  font-weight: 700;
}

.page {
  padding: 12px 14px 84px;
}

.page-header {
  padding: 16px 12px 12px;
}

.home-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notify-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notify-icon {
  color: #f7fbff;
  font-size: 1rem;
  line-height: 1;
}

.notify-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ef1f2e;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 1px solid #fff;
}

.page-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.1rem;
}

.page-header p {
  margin: 4px 0 0;
  color: #c7d0e4;
  font-size: 0.84rem;
}

.panel {
  background: #f6f8fc;
  border-radius: 18px 18px 0 0;
  min-height: 760px;
  padding: 16px 16px 112px;
  animation: panel-in 320ms ease-out both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.select {
  width: 100%;
  border: 1px solid #e0e6f0;
  border-radius: 10px;
  padding: 11px;
  margin-bottom: 14px;
  background: #fff;
  font-size: 0.9rem;
}

.field-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: #697792;
}

.section-title {
  margin: 10px 0;
  font-size: 0.96rem;
  color: #17233d;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ecf0f5;
  padding: 10px;
}

.stat-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-value {
  margin: 4px 0 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.75rem;
  line-height: 1;
}

.tone-good .stat-value {
  color: var(--good);
}

.tone-alert .stat-value {
  color: var(--alert);
}

.tone-warning .stat-value {
  color: var(--warning);
}

.shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.shortcut-btn {
  border-radius: 10px;
  border: 1px solid #ebeff6;
  background: #fff;
  padding: 9px 6px 8px;
  font-size: 0.7rem;
  color: #24314e;
  font-weight: 600;
  min-height: 64px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
}

.shortcut-label {
  line-height: 1.1;
}

.shortcut-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #ef2a38;
  background: #fff3f4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.96rem;
}

.compliance {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #ebeff6;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.ring {
  --value: 92%;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: conic-gradient(var(--brand-red) var(--value), #ecf0f8 0);
  display: grid;
  place-items: center;
}

.ring::after {
  content: "";
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.ring strong {
  position: relative;
  z-index: 2;
  font-size: 0.8rem;
  color: var(--brand-red);
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search {
  flex: 1;
  padding: 11px;
  border: 1px solid #dce2ee;
  border-radius: 10px;
}

.icon-btn {
  width: 42px;
  border-radius: 10px;
  border: 1px solid #dce2ee;
  background: #fff;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 10px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #e4e9f3;
  background: #fff;
  white-space: nowrap;
  font-size: 0.78rem;
}

.chip.active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.list-stack {
  display: grid;
  gap: 8px;
}

.equipment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid #ebeff6;
  background: #fff;
  padding: 11px;
}

.equipment-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f7dde0;
  color: var(--brand-red);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.equipment-meta {
  flex: 1;
}

.equipment-name {
  margin: 0;
  font-weight: 700;
}

.equipment-count {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-good {
  background: #def7e8;
  color: #17724a;
}

.status-alert {
  background: #ffe0e0;
  color: #aa1826;
}

.detail-head {
  border: 1px solid #e9edf5;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-id {
  margin: 0;
  color: #5a657b;
  font-size: 0.8rem;
}

.info-table {
  margin-top: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e9edf5;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f8;
  font-size: 0.85rem;
}

.info-row:last-child {
  border-bottom: none;
}

.action-list {
  margin-top: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e9edf5;
}

.action-item {
  display: flex;
  justify-content: space-between;
  padding: 11px 12px;
  border-bottom: 1px solid #eef2f8;
  font-size: 0.89rem;
}

.action-item:last-child {
  border-bottom: none;
}

.qr-card {
  border-radius: 20px;
  background: linear-gradient(180deg, #09182f 0%, #0b1f3e 100%);
  color: #edf2ff;
  text-align: center;
  padding: 20px 16px;
  margin-top: 14px;
}

.qr-box {
  width: 228px;
  height: 228px;
  margin: 14px auto;
  border-radius: 12px;
  background: #fff;
  border: 6px solid #f4f6fb;
  display: grid;
  place-items: center;
  color: #111;
  font-family: "Rajdhani", sans-serif;
  font-size: 3.2rem;
}

.timeline {
  margin-top: 12px;
  border-left: 2px solid #d6deeb;
  padding-left: 12px;
  display: grid;
  gap: 12px;
}

.history-item {
  position: relative;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e9edf5;
  padding: 10px;
}

.history-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  left: -19px;
  top: 18px;
  background: #1ea65d;
}

.history-date {
  margin: 0;
  font-size: 0.75rem;
  color: #4f607f;
}

.history-title {
  margin: 4px 0;
  color: #0f3056;
  font-size: 0.92rem;
}

.history-text {
  margin: 0;
  color: #4a556e;
  font-size: 0.8rem;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tab {
  border-radius: 999px;
  border: 1px solid #e5eaf4;
  background: #fff;
  padding: 8px 11px;
  font-size: 0.78rem;
}

.tab.active {
  background: #ffe9eb;
  border-color: #ffd4d9;
  color: #ad1420;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid #ebeff6;
  background: #fff;
  padding: 10px;
}

.doc-icon {
  min-width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #ffe8ea;
  color: var(--brand-red);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.doc-meta {
  flex: 1;
}

.doc-name {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.doc-subtitle {
  margin: 4px 0 0;
  font-size: 0.73rem;
  color: #6b7488;
}

.ghost-btn {
  border: 1px solid #dde4f0;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  font-size: 0.74rem;
}

.bottom-nav {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(370px, calc(100% - 20px));
  background: linear-gradient(165deg, #000d2a 0%, #04193f 72%, #03112d 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid #1a3159;
  border-radius: 22px;
  box-shadow: 0 16px 28px rgba(1, 10, 30, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  z-index: 3;
}

.bottom-nav a {
  color: #dde5f8;
  font-size: 0.65rem;
  text-align: center;
  min-height: 68px;
  padding: 8px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: color 180ms ease, transform 180ms ease;
}

.bottom-nav a.active {
  color: #ff4f59;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 79, 89, 0.25);
}

.bottom-nav a.active .nav-icon {
  transform: translateY(-1px);
  text-shadow: 0 0 10px rgba(255, 79, 89, 0.35);
}

.nav-icon {
  font-size: 1rem;
  line-height: 1;
  color: currentColor;
}

.bottom-nav a:hover {
  transform: translateY(-1px);
}

/* QR Code button — center floating circle */
.nav-qr-btn {
  position: relative;
}
.nav-qr-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #df111f 0%, #a50c18 100%);
  box-shadow: 0 4px 16px rgba(223, 17, 31, .5);
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px;
  border: 3px solid #000d2a;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.nav-qr-btn:hover .nav-qr-circle {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 22px rgba(223, 17, 31, .65);
}

/* Botão de logout flutuante — aparece em todas as páginas */
.logout-fab {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 200;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  text-decoration: none;
  transition: background 180ms, transform 180ms;
}
.logout-fab:hover {
  background: rgba(223,17,31,.75);
  transform: scale(1.1);
  color: #fff;
}

@media (min-width: 461px) {
  body {
    padding: 0;
    background: #f4f6fb;
  }

  .device-wrap {
    align-items: stretch;
    min-height: 100vh;
  }

  .device {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .device::before {
    display: none;
  }

  .page-header {
    border-radius: 0;
  }

  .panel {
    min-height: auto;
    border-radius: 0;
  }

  .bottom-nav {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    transform: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: 0 -10px 22px rgba(1, 10, 30, 0.28);
  }
}

@media (max-width: 460px) {
  body {
    padding: 0;
    background: #060f24;
  }

  .device {
    min-height: 100vh;
    width: 100%;
    border-radius: 0;
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    bottom: 8px;
    width: calc(100% - 16px);
    transform: translateX(-50%);
    border-radius: 20px;
  }

  .device-wrap {
    min-height: 100vh;
  }
}

/* -------------------------------------------------------
   SPLASH SCREEN
   ------------------------------------------------------- */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    url('/assets/img/payload.png') center center / cover no-repeat,
    radial-gradient(circle at 15% 12%, #1a3568 0%, transparent 42%),
    radial-gradient(circle at 82% 80%, #7a1824 0%, transparent 46%),
    radial-gradient(circle at 50% 100%, rgba(200,20,30,.22) 0%, transparent 38%),
    linear-gradient(175deg, #010610 0%, #040f22 55%, #010509 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 28px 44px;
  opacity: 1;
  transition: opacity 700ms ease;
  overflow: hidden;
}

.splash-bg-glow {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 200px;
  background: radial-gradient(ellipse at center, rgba(223,17,31,.30) 0%, transparent 68%);
  pointer-events: none;
}

.splash-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.splash-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.splash-logo {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 2px solid var(--brand-red);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
}

.splash-brand-text {
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #c9d6f0;
  line-height: 1.4;
}

.splash-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 0 28px;
}

.splash-hero h1 {
  font-size: 2.55rem;
  font-weight: 800;
  line-height: 1.06;
  color: #fff;
  margin: 0 0 18px;
}

.splash-hero h1 em {
  font-style: normal;
  color: #ef2a38;
}

.splash-hero p {
  font-size: 0.98rem;
  color: #8fa4c8;
  line-height: 1.65;
  margin: 0;
}

.splash-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.splash-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255,255,255,.10);
  border-top-color: var(--brand-red);
  border-radius: 50%;
  animation: splash-spin 750ms linear infinite;
}

@keyframes splash-spin {
  to { transform: rotate(360deg); }
}

.splash-progress {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  overflow: hidden;
}

.splash-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #cc0e1a, #ef2a38);
  border-radius: 999px;
  transition: width 5000ms linear;
}

.splash-red-line {
  position: absolute;
  bottom: 0;
  left: -10%;
  width: 120%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #ef2a38 30%, #ff6b77 50%, #ef2a38 70%, transparent 100%);
  filter: blur(1px);
  box-shadow: 0 0 12px 2px rgba(239,42,56,.6);
}
