:root {
  color-scheme: dark;
  --brand: #e40a14;
  --brand-strong: #ba0811;
  --brand-soft: rgba(228, 10, 20, 0.14);
  --brand-ring: rgba(228, 10, 20, 0.2);
  --bg: #070707;
  --surface: rgba(16, 16, 16, 0.94);
  --surface-2: rgba(22, 22, 22, 0.94);
  --surface-3: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-soft: #d0d0d0;
  --text-muted: #8d8d8d;
  --success: #22c55e;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --shadow-brand: 0 20px 45px rgba(228, 10, 20, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(228, 10, 20, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.05), transparent 24%),
    linear-gradient(180deg, #050505 0%, #0a0a0a 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.portal-page {
  padding: 28px 20px;
}

.portal-shell {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.portal-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.portal-login-shell {
  width: 100%;
  max-width: 1080px;
}

.portal-shell-wide {
  max-width: 1180px;
}

.menu-hero {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
}

.hero-card,
.catalog-card,
.hub-header,
.app-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
  gap: 18px;
  padding: 26px;
}

.login-hero-card {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  align-items: stretch;
}

.hero-kicker,
.catalog-label,
.app-tag,
.lock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(228, 10, 20, 0.24);
  border-radius: 999px;
  background: rgba(228, 10, 20, 0.1);
  color: #ffb4bb;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1,
.hub-header h1 {
  margin: 12px 0 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.96;
}

.brand-stage {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(145deg, #7f040b 0%, #a60710 28%, #c50812 62%, #e40a14 100%);
  box-shadow: 0 28px 80px rgba(110, 0, 8, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(145deg, #7f040b 0%, #a60710 28%, #c50812 62%, #e40a14 100%);
  box-shadow: 0 28px 80px rgba(110, 0, 8, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-brand-panel::before {
  content: '';
  position: absolute;
  inset: auto -50px -56px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  filter: blur(16px);
  pointer-events: none;
}

.menu-brand-mark,
.menu-brand-title {
  position: relative;
  z-index: 1;
}

.menu-brand-mark {
  display: grid;
  place-items: center;
  min-height: 180px;
}

.brand-orb-small {
  width: min(170px, 38vw);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 18px 44px rgba(57, 0, 0, 0.28);
}

.menu-brand-title {
  display: block;
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(1.08rem, 1.8vw, 1.3rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.brand-stage::before {
  content: '';
  position: absolute;
  inset: 24px 24px auto auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  filter: blur(14px);
  pointer-events: none;
}

.brand-stage-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 320px;
}

.brand-orb {
  position: relative;
  width: min(240px, 52vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 24px 55px rgba(57, 0, 0, 0.28);
}

.brand-flame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 58%;
  transform: translate(-50%, -48%);
  background: #c40612;
  border-radius: 58% 58% 68% 68% / 32% 32% 78% 78%;
  clip-path: polygon(50% 0%, 71% 13%, 88% 32%, 93% 53%, 84% 73%, 65% 91%, 49% 100%, 32% 91%, 15% 74%, 8% 54%, 13% 33%, 30% 14%);
}

.brand-flame::before {
  content: '';
  position: absolute;
  left: 12%;
  top: 16%;
  width: 48%;
  height: 68%;
  background: #ffffff;
  border-radius: 54% 54% 66% 66% / 26% 26% 78% 78%;
  transform: rotate(8deg);
  clip-path: polygon(50% 0%, 68% 16%, 84% 35%, 84% 57%, 69% 80%, 51% 100%, 34% 82%, 21% 60%, 22% 37%, 35% 16%);
}

.brand-flame::after {
  content: '';
  position: absolute;
  right: 8%;
  top: 34%;
  width: 28%;
  height: 36%;
  background: #e40a14;
  border-radius: 56% 56% 66% 66% / 32% 32% 78% 78%;
  transform: rotate(7deg);
  clip-path: polygon(50% 0%, 72% 20%, 84% 42%, 77% 67%, 50% 100%, 25% 68%, 18% 43%, 30% 20%);
}

.brand-stage-title {
  position: relative;
  z-index: 1;
  display: block;
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.hero-copy p,
.hub-header p,
.app-card p,
.login-head p {
  margin: 14px 0 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.login-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(14, 14, 14, 0.96);
  box-shadow: var(--shadow-brand);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-head h2 {
  margin: 12px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.field-label {
  display: block;
  margin: 22px 0 10px;
  color: var(--text-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(12, 12, 12, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-input:focus {
  border-color: rgba(228, 10, 20, 0.54);
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.login-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
}

.login-actions-split {
  gap: 12px;
  flex-wrap: wrap;
}

.login-actions-split .btn {
  flex: 1 1 220px;
}

.inline-message {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.inline-message.is-error {
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
}

.inline-message.is-success {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.1);
  color: #bbf7d0;
}

.catalog-card {
  padding: 24px;
}

.catalog-head h2 {
  margin: 12px 0 0;
  font-size: 1.5rem;
}

.catalog-grid,
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.mini-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-3);
}

.mini-card strong,
.app-card h2 {
  display: block;
  font-size: 1.12rem;
}

.mini-card span {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
  line-height: 1.55;
}

.hub-header {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
  padding: 32px;
  background:
    radial-gradient(circle at 88% 18%, rgba(228, 10, 20, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    var(--surface);
}

.hub-header::after {
  content: '';
  position: absolute;
  inset: auto auto -80px -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 10, 20, 0.14), rgba(228, 10, 20, 0));
  filter: blur(8px);
  pointer-events: none;
}

.hub-copy,
.hub-meta {
  position: relative;
  z-index: 1;
}

.hub-copy {
  max-width: 720px;
}

.hub-copy p {
  max-width: 360px;
}

.hub-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.hub-meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  padding: 24px;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--surface);
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: rgba(228, 10, 20, 0.28);
  box-shadow: var(--shadow-brand);
}

.app-card::before {
  content: '';
  position: absolute;
  inset: auto -50px -46px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--card-glow, rgba(228, 10, 20, 0.16));
  filter: blur(10px);
  opacity: 0.95;
  pointer-events: none;
}

.app-watermark {
  position: absolute;
  top: 14px;
  right: 18px;
  color: rgba(255, 255, 255, 0.05);
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(3.4rem, 7vw, 5.8rem);
  line-height: 1;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}

.app-card-top,
.app-card-body,
.app-cta {
  position: relative;
  z-index: 1;
}

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.84rem;
}

.app-card h2 {
  margin: 18px 0 0;
  font-size: clamp(1.45rem, 2vw, 1.8rem);
}

.app-card-body {
  max-width: 320px;
}

.app-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 26px;
  color: #ffb4bb;
  font-weight: 600;
}

.service-caldeira {
  --card-glow: radial-gradient(circle, rgba(228, 10, 20, 0.22), rgba(228, 10, 20, 0));
}

.service-fluidos {
  --card-glow: radial-gradient(circle, rgba(255, 126, 45, 0.18), rgba(255, 126, 45, 0));
}

.service-queimadores {
  --card-glow: radial-gradient(circle, rgba(255, 82, 82, 0.18), rgba(255, 82, 82, 0));
}

.service-geral {
  --card-glow: radial-gradient(circle, rgba(220, 220, 220, 0.14), rgba(220, 220, 220, 0));
}

.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  box-shadow: var(--shadow-brand);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
}

.btn-ghost:hover {
  color: var(--text);
}

@media (max-width: 920px) {
  .menu-hero,
  .hero-card {
    grid-template-columns: 1fr;
  }

  .brand-stage {
    min-height: 380px;
  }

  .menu-brand-panel {
    min-height: 260px;
  }

  .hub-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .catalog-grid,
  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .portal-page {
    padding: 16px 12px calc(18px + env(safe-area-inset-bottom));
  }

  .hero-card,
  .catalog-card,
  .hub-header,
  .app-card,
  .login-card {
    padding: 20px;
  }

  .brand-stage,
  .menu-brand-panel {
    padding: 20px;
    border-radius: 24px;
  }

  .brand-stage {
    min-height: 300px;
  }

  .brand-stage-mark {
    min-height: 200px;
  }

  .hub-copy p,
  .app-card-body {
    max-width: none;
  }

  .hub-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-meta .btn,
  .login-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .app-watermark {
    top: 18px;
    right: 16px;
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }
}

@media (max-width: 640px) {
  .portal-page {
    padding: 18px 12px;
  }

  .hero-card,
  .catalog-card,
  .hub-header,
  .app-card {
    border-radius: 20px;
  }

  .hero-card,
  .catalog-card,
  .hub-header,
  .app-card,
  .login-card {
    padding: 18px;
  }

  .menu-brand-panel {
    padding: 20px;
  }

  .login-hero-card {
    padding: 0;
  }

  .brand-stage {
    min-height: 320px;
    padding: 20px;
  }

  .brand-stage-mark {
    min-height: 220px;
  }

  .menu-brand-mark {
    min-height: 120px;
  }

  .app-card {
    min-height: 220px;
  }

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

@media (max-width: 480px) {
  .portal-page {
    padding: 12px 10px calc(16px + env(safe-area-inset-bottom));
  }

  .hero-card,
  .catalog-card,
  .hub-header,
  .app-card,
  .login-card {
    padding: 16px;
    border-radius: 18px;
  }

  .brand-stage,
  .menu-brand-panel {
    min-height: auto;
    padding: 18px;
    border-radius: 20px;
  }

  .brand-stage-mark {
    min-height: 160px;
  }

  .menu-brand-mark {
    min-height: 96px;
  }

  .brand-orb {
    width: min(180px, 58vw);
  }

  .brand-orb-small {
    width: min(132px, 34vw);
  }

  .hub-header h1,
  .hero-copy h1 {
    line-height: 1;
  }

  .hub-meta-badge,
  .hero-kicker,
  .app-tag,
  .lock-badge {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }

  .app-card {
    min-height: 0;
  }

  .app-card h2 {
    margin-top: 14px;
  }

  .app-cta {
    margin-top: 18px;
  }
}
