@import url("botasj-tokens.css");

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background-color: var(--canvas);
  background-image: none;
  min-height: 100vh;
  line-height: 1.5;
  margin: 0;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Barra clara: contraste com logo ASJ em azul (evita logo “some” no azul petróleo) */
.app-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.app-header::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--action);
}

.app-header-inner {
  width: min(1420px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.app-header-brand:focus-visible {
  outline: 2px solid var(--action-ring);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.app-header-brand img,
.app-header-logo {
  height: 38px;
  width: auto;
  max-width: min(200px, 46vw);
  display: block;
  object-fit: contain;
}

.app-header-titles {
  min-width: 0;
}

.app-header-titles h1 {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.app-header-titles p {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  max-width: 420px;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.env-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.env-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
}

.btn-logout {
  display: none;
  padding: 9px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  transition: background 0.2s, border-color 0.2s;
}

.btn-logout:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

body.portal-hub .btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.portal-hub .app-main {
  background-color: var(--canvas);
}

.wrap {
  width: min(1420px, calc(100vw - 32px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: justify-content 0.25s ease;
}

body.portal-hub .wrap {
  justify-content: flex-start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: clamp(24px, 4vw, 36px);
}

.view {
  display: none;
  animation: fadeIn 0.45s ease both;
}

.view.is-active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}

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

.login-aside {
  padding-right: clamp(0px, 2vw, 16px);
}

.login-aside h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}

.login-aside .lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--muted);
}

.feature-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--action-ring);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.2s, background 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--action);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--action-hover);
}

.btn-ghost {
  background: rgba(19, 35, 45, 0.05);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: rgba(19, 35, 45, 0.08);
  border-color: rgba(19, 35, 45, 0.14);
}

.alert {
  font-size: 0.85rem;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(178, 63, 49, 0.28);
  background: var(--danger-soft);
  color: var(--danger);
  display: none;
}

.alert.is-visible {
  display: block;
}

.hub-routines {
  width: 100%;
}

.hub-routines-head {
  margin-bottom: 22px;
}

.hub-routines-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.hub-routines-title {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hub-routines-lead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 56ch;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.routine-card {
  position: relative;
  text-align: left;
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s ease, box-shadow 0.22s;
}

.routine-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--success);
  opacity: 1;
}

.routine-card.is-wip::after {
  background: var(--warning);
}

.routine-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.routine-card.is-wip:hover {
  border-color: var(--border-strong);
}

.routine-card--primary {
  box-shadow: var(--shadow-xs);
}

.routine-card--primary::after {
  background: var(--success);
}

.routine-card--secondary {
  box-shadow: var(--shadow-xs);
}

.routine-card--secondary::after {
  background: var(--primary);
}

.routine-card--tertiary {
  box-shadow: var(--shadow-xs);
}

.routine-card--tertiary::after {
  background: var(--action);
}

.routine-card-inner {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 1;
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(4, 120, 87, 0.2);
}

.routine-card.is-wip .card-icon {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(147, 96, 20, 0.18);
}

.card-heading {
  min-width: 0;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 6px;
}

.routine-card.is-wip .card-tag {
  color: var(--warning);
}

.card-title {
  margin: 0;
  font-size: clamp(1.12rem, 1.5vw, 1.28rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.2;
}

.card-desc {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.58;
  flex: 1;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.card-chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(19, 35, 45, 0.04);
  color: var(--muted);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
  margin-top: auto;
}

.card-cta {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--action);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.routine-card.is-wip .card-cta {
  color: var(--warning);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--success);
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.routine-card.is-wip .status-dot {
  color: var(--warning);
}

.routine-card.is-wip .status-dot::before {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-soft);
}

.card-arrow {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--action-soft);
  color: var(--action);
  transition: transform 0.2s, background 0.2s;
}

.routine-card:hover .card-arrow {
  transform: translateX(4px);
  background: rgba(37, 99, 235, 0.16);
}

.routine-card.is-wip .card-arrow {
  background: var(--warning-soft);
  color: var(--warning);
}

.routine-card.is-wip:hover .card-arrow {
  background: rgba(147, 96, 20, 0.18);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
