/* --- file: public/css/wlw.css --- */
/* WLW portal UI (H4 R7): local only - no Tailwind, no Lucide */

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --label: #64748b;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --green: #16a34a;
  --green-hover: #15803d;
  --amber: #d97706;
  --amber-hover: #b45309;
  --red: #ef4444;
  --red-soft: rgba(185, 28, 28, 0.2);
  --input-bg: #0f172a;
  --ok-bg: rgba(22, 101, 52, 0.35);
  --err-bg: rgba(127, 29, 29, 0.45);
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
}

body.wlw {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wlw-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wlw-page {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

@media (min-width: 768px) {
  .wlw-page { padding: 2rem; }
}

.wlw-card {
  position: relative;
  width: 100%;
  max-width: 28rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.wlw-card.wlw-card-wide {
  max-width: 28rem;
}

.wlw-card.has-timer {
  padding-top: 3.5rem;
}

.wlw-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
}

.wlw-logo {
  display: block;
  border: 0;
  background: #e5e7eb;
  border-radius: 50%;
}

.wlw-logo-login {
  width: 128px;
  height: 128px;
  margin: 0 auto 1rem;
}

.wlw-logo-mark {
  width: 28px;
  height: 28px;
  margin: 0 0 0.35rem;
}

.wlw-card .wlw-logo-mark {
  margin-left: auto;
  margin-right: auto;
}

.wlw-title {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
}

.wlw-title-lg {
  font-size: 1.875rem;
}

.wlw-sub {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.wlw-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wlw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* width: 100%; */
  width: auto;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wlw-btn:disabled,
.wlw-btn.is-disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
  pointer-events: none;
}

.wlw-btn-primary { background: var(--blue); color: #fff; }
.wlw-btn-primary:hover { background: var(--blue-hover); }

.wlw-btn-success { background: var(--green); color: #fff; }
.wlw-btn-success:hover { background: var(--green-hover); }

.wlw-btn-amber { background: var(--amber); color: #fff; }
.wlw-btn-amber:hover { background: var(--amber-hover); }

.wlw-btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.wlw-btn-ghost:hover { background: #334155; }

.wlw-btn-danger {
  background: transparent;
  color: var(--red);
}
.wlw-btn-danger:hover { background: var(--red-soft); }

.wlw-btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem;
}
.wlw-btn-link:hover { color: #cbd5e1; }

.wlw-alert {
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.wlw-alert-err {
  background: var(--err-bg);
  color: #fecaca;
}

.wlw-alert-ok {
  background: var(--ok-bg);
  color: #bbf7d0;
}

.wlw-field {
  text-align: left;
  margin-bottom: 1.25rem;
}

.wlw-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.wlw-field input[type="text"],
.wlw-field input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}

.wlw-field input.wlw-code {
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.wlw-field input:focus {
  outline: none;
  border-color: var(--blue);
}

.wlw-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.wlw-check input { width: 1rem; height: 1rem; cursor: pointer; }
.wlw-check label { cursor: pointer; user-select: none; }

.wlw-timer-bar {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wlw-chip {
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.4rem 0.65rem;
}

button.wlw-chip {
  cursor: pointer;
  font-family: inherit;
}
button.wlw-chip:hover {
  color: #60a5fa;
  background: #334155;
}

.wlw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* P1: clock + remaining immediately under "Signed in as …" */
.wlw-session-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

a.wlw-tile-link {
  text-decoration: none;
  display: block;
}
a.wlw-tile-link:hover { border-color: #60a5fa; }

.wlw-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .wlw-grid-2 { grid-template-columns: 1fr 1fr; }
}

.wlw-tile {
  position: relative;
  text-align: left;
  width: 100%;
  padding: 1.25rem;
  padding-right: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}
.wlw-tile:hover { border-color: #60a5fa; }
.tile-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin-bottom: 1rem;

  /* Inverts black icons to white to match your dark theme */
  /*filter: brightness(0) invert(1);*/
}

/* Horizontal tile layout with icon */
.wlw-tile-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wlw-tile-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wlw-tile-icon img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  display: block;
}

.wlw-tile-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Subdued Admin tile styling */
.wlw-tile.wlw-tile-admin {
  background: #243044;
  border-color: #38465c;
}

.wlw-tile.wlw-tile-admin:hover,
a.wlw-tile-link.wlw-tile-admin:hover {
  border-color: #64748b;
}

.wlw-tile.wlw-tile-admin .hint {
  color: #94a3b8;
}

.wlw-tile h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: #fff;
}

.wlw-tile .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.wlw-tile .hint {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
}

.wlw-section-title {
  margin: 1.75rem 0 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 700;
}

.wlw-tile .tile-subhint {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
  color: var(--label);
}

/* N7: probed gateway host unreachable — not a launch control */
.wlw-tile.wlw-tile-unavailable {
  cursor: default;
  opacity: 0.92;
  background: #1e293b;
  border-color: #334155;
}
.wlw-tile.wlw-tile-unavailable:hover {
  border-color: #334155;
}
.wlw-tile.wlw-tile-unavailable .hint.wlw-tile-unavailable-msg {
  color: #fbbf24;
  font-weight: 600;
}
.wlw-tile-recheck-wrap {
  margin: 0.75rem 0 0;
}
.wlw-tile-recheck-wrap .wlw-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
}

/* Portal tile badges: vendored Lucide SVGs (TOTP blue, cert amber) */
.wlw-tile-badges {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  z-index: 1;
  pointer-events: none;
}

.wlw-tile-badges .wlw-cert-warn {
  pointer-events: auto;
}

.wlw-tile-badge-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  flex-shrink: 0;
}

.wlw-tile-badge-icon-totp {
  color: #38bdf8;
}

.wlw-tile-badge-icon-cert {
  color: #fbbf24;
}

.wlw-cert-warn {
  margin: 0;
  padding: 0;
  line-height: 0;
  background: transparent;
  border: none;
}

.wlw-footer-link {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.875rem;
}
.wlw-footer-link a {
  color: var(--muted);
  text-decoration: none;
}
.wlw-footer-link a:hover { color: #e2e8f0; }

/* Modal */
.wlw-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.75);
}
.wlw-modal.is-open { display: flex; }

.wlw-modal .wlw-card {
  margin: 0;
}

.wlw-hidden { display: none !important; }

/* B31 audit sheet — fixed columns, no wrap on meta fields */
#wlw-audit-sheet {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

#wlw-audit-sheet th.audit-col-when,
#wlw-audit-sheet td.audit-col-when {
  width: 11.5rem;
  min-width: 11.5rem;
  white-space: nowrap;
}

#wlw-audit-sheet th.audit-col-type,
#wlw-audit-sheet td.audit-col-type {
  width: 10.5rem;
  min-width: 10.5rem;
  white-space: nowrap;
}

#wlw-audit-sheet th.audit-col-user,
#wlw-audit-sheet td.audit-col-user {
  width: 8rem;
  min-width: 8rem;
  white-space: nowrap;
}

#wlw-audit-sheet th.audit-col-status,
#wlw-audit-sheet td.audit-col-status {
  width: 6.5rem;
  min-width: 6.5rem;
  white-space: nowrap;
}

#wlw-audit-sheet th.audit-col-ip,
#wlw-audit-sheet td.audit-col-ip {
  width: 10rem;
  min-width: 10rem;
  white-space: nowrap;
}

#wlw-audit-sheet th.audit-col-details,
#wlw-audit-sheet td.audit-col-details {
  min-width: 28rem;
  max-width: 48rem;
  white-space: normal;
  word-break: break-word;
}
