/* Portal STMGO V1. Static interface: no build step or external dependencies. */
:root {
  color-scheme: light;
  --oxford: #072249;
  --flirt: #9f0066;
  --coral: #fe7d53;
  --muted: #5e6e84;
  --line: #dce3ed;
  --surface: #fff;
  --background: #f5f7fa;
  --gradient: linear-gradient(45deg, var(--flirt), var(--coral));
  --shadow: 0 10px 30px rgb(7 34 73 / 6%);
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 10% 80%, #f0f4f8, transparent 70%), var(--background);
  color: var(--oxford);
  font-family: "Lufga", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button:disabled { opacity: 1; cursor: not-allowed; }
img { display: block; max-width: 100%; }
svg { stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--flirt); outline-offset: 6px; border-radius: 4px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; z-index: 50; top: 12px; left: 16px; padding: 14px 20px; background: var(--oxford); color: #fff; }
.topbar { background: #fff; border-bottom: 1px solid #e6ebf2; box-shadow: 0 5px 20px rgb(7 34 73 / 3%); }
.topbar-inner { width: min(1536px, calc(100% - 112px)); min-height: 96px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.brand-logo { width: 192px; height: auto; }
.brand-divider { width: 1px; height: 36px; margin: 0 30px; background: #d1d9e4; flex: none; }
.brand-title { font-weight: 700; font-size: 23px; letter-spacing: -.02em; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 19px; }
.icon-button { border: 0; width: 42px; height: 42px; padding: 10px; display: grid; place-items: center; background: none; color: #65768c; }
.icon-button svg { width: 24px; height: 24px; }
.avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: #e9edf3; font-size: 16px; font-weight: 700; }
.page, .page-width { width: min(1536px, calc(100% - 112px)); margin-inline: auto; }
.page { margin-top: 28px; }
.hero { min-height: 268px; position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); align-items: stretch; background: linear-gradient(105deg, #fff 35%, #fcfafc 63%, #fceaf0 100%); border: 1px solid #f0f2f6; border-radius: 13px; box-shadow: var(--shadow); }
.hero-content { position: relative; z-index: 1; padding: 44px 42px 42px; }
.eyebrow { margin: 0 0 23px; color: #3d5272; font-size: 13px; line-height: 1.5; font-weight: 600; text-transform: uppercase; letter-spacing: .22em; }
h1 { margin: 0; font-size: clamp(40px, 4.08vw, 68px); line-height: 1.07; font-weight: 750; letter-spacing: -.045em; }
.hero-subtitle { margin: 16px 0 0; color: var(--muted); font-size: clamp(17px, 1.42vw, 23px); line-height: 1.5; }
.accent-line { display: block; width: 104px; height: 5px; margin-top: 19px; background: var(--gradient); border-radius: 10px; }
.hero-side { position: relative; min-width: 0; display: flex; align-items: center; padding-left: 9px; }
.hero-tagline { position: relative; z-index: 1; margin: 0; max-width: 210px; color: #3d5272; text-transform: uppercase; font-size: 13px; font-weight: 600; line-height: 2; letter-spacing: .18em; }
.hero-symbol { position: absolute; width: 386px; max-width: none; height: auto; right: -96px; top: -93px; pointer-events: none; }
.apps-section { margin-top: 39px; scroll-margin-top: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 26px; }
.section-head h2 { margin: 0; font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -.03em; }
.section-head p { margin: 6px 0 0; font-size: 17px; color: var(--muted); }
.section-head .count-label { margin: 0; flex: none; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .18em; }
.apps-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.app-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 23px; min-height: 160px; padding: 28px; border: 1px solid #edf0f5; border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.app-icon { width: 98px; height: 100px; display: grid; place-items: center; border-radius: 14px; background: var(--oxford); box-shadow: inset 0 0 0 2px rgb(255 255 255 / 4%); }
.app-icon img { width: 63px; height: auto; }
.app-icon--passbolt svg { width: 48px; height: 48px; color: #fff; stroke-width: 1.7; }
.app-info { min-width: 0; }
.app-info h3 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; }
.app-description { margin: 5px 0 14px; color: var(--muted); font-size: 16px; line-height: 1.4; }
.status { display: inline-flex; align-items: center; gap: 8px; width: fit-content; border-radius: 30px; padding: 6px 12px; background: #d9f8e7; color: #09623e; font-size: 13px; font-weight: 600; line-height: 1.3; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #087449; }
.app-actions { width: 246px; max-width: 100%; }
.primary-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 13px 22px; border-radius: 9px; color: #fff; background: linear-gradient(rgb(7 34 73 / 32%), rgb(7 34 73 / 32%)), var(--gradient); font-size: 16px; font-weight: 700; line-height: 1.5; transition: box-shadow .15s ease, transform .15s ease; }
.primary-btn svg { width: 20px; height: 20px; flex: none; stroke-width: 2; }
.primary-btn:hover { box-shadow: 0 7px 18px rgb(159 0 102 / 18%); transform: translateY(-1px); }
.primary-btn:active { transform: none; }
.route { display: flex; align-items: center; gap: 9px; margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.route svg { width: 18px; height: 18px; flex: none; }
.route span { overflow-wrap: anywhere; }
.placeholder-card { display: flex; align-items: center; gap: 20px; min-width: 0; min-height: 160px; padding: 27px; border: 1px dashed #cdd6e3; border-radius: 13px; background: rgb(255 255 255 / 25%); }
.placeholder-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: #eaf0f5; color: #60738d; flex: none; }
.placeholder-icon svg { width: 28px; height: 28px; }
.placeholder-card h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.35; font-weight: 600; }
.placeholder-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 41px; padding: 26px 0 30px; border-top: 1px solid var(--line); }
.footer-brand { display: flex; align-items: center; gap: 25px; min-width: 0; }
.footer-logo { width: 132px; height: auto; }
.footer-divider { width: 1px; height: 26px; background: #d1d9e4; flex: none; }
.footer-tagline { font-size: 10px; letter-spacing: .17em; text-transform: uppercase; line-height: 1.6; color: var(--muted); }
.footer-links { display: flex; align-items: center; gap: 34px; color: var(--muted); font-size: 13px; line-height: 1.5; white-space: nowrap; }
.pending-label { cursor: default; }
@media (max-width: 1399px) {
  .page, .page-width, .topbar-inner { width: calc(100% - 72px); }
  .hero-content { padding-inline: 34px; }
  .hero-tagline { font-size: 11px; }
  .hero-symbol { width: 338px; right: -110px; top: -66px; }
  .app-card { grid-template-columns: auto minmax(0, 1fr); gap: 18px; padding: 24px; }
  .app-icon { width: 80px; height: 84px; }
  .app-icon img { width: 55px; }
  .app-actions { grid-column: 1 / -1; width: 100%; }
  .primary-btn { padding-inline: 17px; }
  .app-info h3 { font-size: 21px; }
  .placeholder-card { padding: 20px; gap: 14px; }
  .placeholder-icon { width: 52px; height: 52px; }
}
@media (max-width: 1199px) {
  .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-card { grid-column: 1 / -1; }
  .placeholder-card { min-height: 126px; }
  .hero { grid-template-columns: minmax(0, 1fr) 25%; }
  .hero-tagline { display: none; }
  .hero-symbol { right: -110px; }
  .hero-subtitle { max-width: 640px; }
  .footer-links { gap: 22px; }
  .footer-brand { gap: 16px; }
}
@media (max-width: 799px) {
  .page, .page-width, .topbar-inner { width: calc(100% - 40px); }
  .topbar-inner { min-height: 80px; }
  .brand-logo { width: 153px; }
  .brand-divider { margin-inline: 20px; height: 28px; }
  .brand-title { font-size: 18px; }
  .top-actions { gap: 6px; }
  .icon-button { display: none; }
  .avatar { width: 40px; height: 40px; font-size: 14px; }
  .page { margin-top: 20px; }
  .hero { min-height: 274px; grid-template-columns: 1fr; }
  .hero-content { padding: 34px 28px; }
  .eyebrow { font-size: 11px; margin-bottom: 22px; }
  h1 { font-size: clamp(34px, 6vw, 46px); }
  .hero-subtitle { max-width: 470px; font-size: 18px; }
  .hero-side { position: absolute; inset: 0; opacity: .08; pointer-events: none; }
  .hero-symbol { top: -60px; right: -130px; width: 330px; }
  .apps-section { margin-top: 30px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .section-head h2 { font-size: 30px; }
  .section-head p { font-size: 16px; }
  .section-head .count-label { font-size: 10px; }
  .app-card { grid-template-columns: auto minmax(0, 1fr); padding: 24px; gap: 20px; }
  .app-actions { grid-column: 1 / -1; width: 100%; }
  .primary-btn { min-height: 50px; }
  .route { margin-top: 12px; }
  .app-description { margin-bottom: 12px; }
  .placeholder-card { padding: 20px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 24px; margin-top: 30px; }
}
@media (max-width: 499px) {
  .page, .page-width, .topbar-inner { width: calc(100% - 32px); }
  .brand-logo { width: 140px; }
  .brand-divider, .brand-title { display: none; }
  .hero-content { padding: 30px 24px; }
  .eyebrow { font-size: 10px; letter-spacing: .17em; }
  h1 { max-width: 310px; font-size: 38px; line-height: 1.1; }
  .hero-subtitle { font-size: 17px; }
  .apps-grid { grid-template-columns: 1fr; gap: 16px; }
  .app-card { gap: 16px; padding: 20px; }
  .app-icon { width: 66px; height: 72px; border-radius: 11px; }
  .app-icon img { width: 45px; }
  .app-info h3 { font-size: 19px; }
  .app-description { font-size: 14px; }
  .status { font-size: 12px; }
  .route { font-size: 12px; }
  .placeholder-card { min-height: 110px; }
  .placeholder-icon { width: 52px; height: 52px; }
  .footer-brand { flex-wrap: wrap; gap: 16px; }
  .footer-logo { width: 116px; }
  .footer-divider { display: none; }
  .footer-tagline { flex-basis: 100%; font-size: 9px; }
  .footer-links { gap: 24px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: #fff; }
  .top-actions, .placeholder-card, .footer-links { display: none; }
  .hero, .app-card { box-shadow: none; }
  .apps-grid { display: block; }
  .primary-btn { background: #072249; print-color-adjust: exact; }
}

/* =========================================================
   Portal STMGO - melhorias V1.2
   ========================================================= */

button,
input {
  font: inherit;
}


/* ---------- HEADER ---------- */

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.logout-button {
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #65768c;
  cursor: pointer;
  transition:
    background-color .15s ease,
    color .15s ease,
    transform .15s ease;
}

.icon-button svg,
.logout-button svg {
  width: 23px;
  height: 23px;
}

.icon-button:hover,
.logout-button:hover {
  background: #f0f3f7;
  color: var(--oxford);
}

.icon-button:active,
.logout-button:active {
  transform: scale(.96);
}

.icon-button:focus-visible,
.logout-button:focus-visible {
  outline: 3px solid rgb(159 0 102 / 20%);
  outline-offset: 2px;
}

.logout-button:hover {
  color: #a12222;
  background: #fff0f0;
}


/* ---------- SEARCH ---------- */

.search-control {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    width .2s ease,
    opacity .15s ease,
    margin .2s ease;
}

.search-control.is-open .search-field {
  width: 280px;
  margin-right: 6px;
  opacity: 1;
  pointer-events: auto;
}

.search-field input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--oxford);
  outline: none;
  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background-color .15s ease;
}

.search-field input::placeholder {
  color: #8492a6;
}

.search-field input:hover {
  background: #fff;
}

.search-field input:focus {
  background: #fff;
  border-color: var(--flirt);
  box-shadow:
    0 0 0 3px rgb(159 0 102 / 10%);
}


/* ---------- AVATAR ---------- */

.avatar {
  width: 44px;
  height: 44px;
  font-size: 14px;
  border: 1px solid #dde4ed;
  background: linear-gradient(
    145deg,
    #f3f5f8,
    #e5eaf0
  );
}


/* ---------- APPLICATION CARDS ---------- */

.app-card {
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: #dfe5ed;
  box-shadow:
    0 14px 34px rgb(7 34 73 / 9%);
}

.app-card[hidden],
.placeholder-card[hidden] {
  display: none;
}


/* ---------- APP ICONS ---------- */

.app-icon img {
  width: 64px;
  max-width: 64px;
  max-height: 64px;
  object-fit: contain;
}

.app-icon--passbolt {
  background: #1f1f1f;
}

.app-icon--passbolt img {
  width: 60px;
  height: 60px;
}


/* ---------- BUTTON ---------- */

.primary-btn {
  position: relative;
  overflow: hidden;
}

.primary-btn:focus-visible {
  outline: 3px solid rgb(159 0 102 / 20%);
  outline-offset: 3px;
}


/* ---------- EMPTY SEARCH ---------- */

.search-empty {
  padding: 36px 20px;
  margin: 22px 0 0;
  border: 1px dashed #ccd5e1;
  border-radius: 13px;
  text-align: center;
  color: var(--muted);
  background: rgb(255 255 255 / 45%);
}


/* ---------- FOOTER ---------- */

.footer-link {
  position: relative;
  color: var(--muted);
  transition: color .15s ease;
}

.footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .15s ease;
}

.footer-link:hover {
  color: var(--oxford);
}

.footer-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.footer-link:focus-visible {
  outline: 3px solid rgb(159 0 102 / 18%);
  outline-offset: 5px;
}


/* ---------- MOBILE ---------- */

@media (max-width: 799px) {

  /*
   * O CSS antigo esconde .icon-button no mobile.
   * Agora precisamos da lupa.
   */
  .icon-button {
    display: grid;
  }

  .top-actions {
    gap: 4px;
  }

  .search-control.is-open .search-field {
    position: absolute;
    z-index: 20;
    top: 52px;
    right: 0;
    width: min(
      310px,
      calc(100vw - 40px)
    );
    margin: 0;
    padding: 8px;
    border: 1px solid #e1e6ed;
    border-radius: 12px;
    background: #fff;
    box-shadow:
      0 12px 30px rgb(7 34 73 / 12%);
  }

  .search-field input {
    height: 44px;
  }

  .logout-button {
    width: 40px;
    height: 40px;
  }

}


/* ---------- SMALL MOBILE ---------- */

@media (max-width: 499px) {

  .top-actions {
    gap: 2px;
  }

  .avatar,
  .icon-button,
  .logout-button {
    width: 38px;
    height: 38px;
  }

  .avatar {
    font-size: 12px;
  }

  .icon-button svg,
  .logout-button svg {
    width: 21px;
    height: 21px;
  }

}


/* ---------- MOCK LOGIN ---------- */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  padding: 42px;
  border: 1px solid #e6ebf2;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 18px 50px rgb(7 34 73 / 10%);
}

.login-logo {
  width: 180px;
  margin-bottom: 40px;
}

.login-card h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

.login-description {
  margin: 0 0 30px;
  color: var(--muted);
  line-height: 1.6;
}

.login-card .primary-btn {
  width: 100%;
  justify-content: center;
}

.login-note {
  margin: 22px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
