@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600;700&display=swap');

:root {
  --fwg-bg: #f4f6fb;
  --fwg-bg-2: #eef2f8;
  --fwg-surface: #ffffff;
  --fwg-ink: #0f172a;
  --fwg-muted: #6b7280;
  --fwg-primary: #2563eb;
  --fwg-primary-600: #1d4ed8;
  --fwg-accent: #f59e0b;
  --fwg-success: #16a34a;
  --fwg-danger: #dc2626;
  --fwg-border: #e5e7eb;
  --fwg-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  color: var(--fwg-ink);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.fwg-body {
  background: linear-gradient(135deg, var(--fwg-bg) 0%, var(--fwg-bg-2) 100%);
  min-height: 100vh;
  background-attachment: fixed;
}
body.fwg-index {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}


body.fwg-auth {
  background: radial-gradient(1200px 600px at 10% 10%, #1f2937 0%, #0f172a 55%, #0b1020 100%);
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.fwg-auth-tenant {
  background: linear-gradient(135deg, #2c3e50 0%, #4c2c2c 100%);
}

body.fwg-success {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fwg-card {
  background: var(--fwg-surface);
  border: 1px solid var(--fwg-border);
  border-radius: 14px;
  box-shadow: var(--fwg-shadow);
  backdrop-filter: saturate(110%);
}

.fwg-card-header {
  background: linear-gradient(135deg, #0f172a 0%, #1f2937 100%);
  color: #fff;
  letter-spacing: 0.2px;
  padding: 25px;
  text-align: center;
}

.fwg-card-header.light {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-bottom: 5px solid #1e40af;
}

.fwg-card-footer {
  background: #f8fafc;
  border-top: 1px solid var(--fwg-border);
}

.fwg-muted {
  color: var(--fwg-muted);
}

.fwg-accent {
  color: var(--fwg-accent);
}

.btn-primary {
  background-color: var(--fwg-primary);
  border-color: var(--fwg-primary);
}

.btn-primary:hover {
  background-color: var(--fwg-primary-600);
  border-color: var(--fwg-primary-600);
}

.btn-primary:focus,
.btn-primary:active {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.btn,
.form-control,
.form-select,
.input-group-text {
  border-radius: 10px;
}

.btn {
  transition: transform 0.12s ease, box-shadow 0.18s ease, background-color 0.2s ease, border-color 0.2s ease;
}

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

.form-control:focus,
.form-select:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.btn-outline-primary {
  color: var(--fwg-primary);
  border-color: var(--fwg-primary);
}

.btn-outline-primary:hover {
  background-color: var(--fwg-primary);
  border-color: var(--fwg-primary);
}

.table thead.table-light th {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: #111827;
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.fwg-info-row {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 10px 0;
  border: 1px dashed #cbd5f5;
  font-family: monospace;
  font-size: 18px;
}

/* Admin UI helpers */
.status-dot {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

.status-online {
  background-color: #28a745;
  box-shadow: 0 0 5px #28a745;
}

.status-offline {
  background-color: #dc3545;
}

.master-badge {
  font-size: 0.8em;
  background: #ffc107;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e0a800;
}

.nav-link.active {
  font-weight: 700;
  border-bottom: 3px solid #0d6efd !important;
  color: #0d6efd !important;
}

.nav-link {
  color: #495057;
  padding: 10px 16px;
  font-size: 0.95rem;
}

.form-text {
  font-size: 0.85em;
  color: #6c757d;
  margin-top: 3px;
}

.bg-code {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 2px 4px;
  font-family: monospace;
  color: #d63384;
}


.dropdown-menu {
  z-index: 9999 !important;
}

.metric-label {
  width: 30px;
  display: inline-block;
  font-weight: 700;
  color: #6c757d;
  font-size: 0.75rem;
}

.metric-val {
  font-size: 0.75rem;
  min-width: 35px;
  text-align: right;
  display: inline-block;
  margin-left: 5px;
  font-family: monospace;
  font-weight: 700;
}

details > summary {
  cursor: pointer;
  transition: background 0.2s;
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary:hover {
  background-color: #e9ecef !important;
}

details[open] > summary {
  border-bottom: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

details[open] > summary .bi-chevron-down {
  transform: rotate(180deg);
  transition: transform 0.2s;
}

.cursor-pointer {
  cursor: pointer;
}

.tenant-card {
  transition: transform 0.2s;
  border: 1px solid #dee2e6;
  border-top: 4px solid #0d6efd;
  border-radius: 14px;
}

.tenant-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.table-hover tbody tr:hover {
  background-color: #f8f9fa;
}

.action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Auth screens */
.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  overflow: hidden;
  border: none;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  position: relative;
}

.card-header-custom {
  background: #0d6efd;
  padding: 25px;
  text-align: center;
  color: #ffffff;
}

.card-header-admin {
  background: #dc3545;
  padding: 25px;
  text-align: center;
  color: #ffffff;
  border-bottom: 5px solid #b02a37;
}

.card-body-custom {
  padding: 30px;
}

.btn-admin {
  background-color: #dc3545;
  border-color: #dc3545;
  padding: 12px;
  font-weight: 700;
  color: #ffffff;
  border-radius: 8px;
  transition: all 0.3s;
  width: 100%;
}

.btn-admin:hover {
  background-color: #bb2d3b;
  border-color: #b02a37;
  color: #ffffff;
  transform: translateY(-1px);
}

.loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  z-index: 10;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.fwg-input-group-text {
  background-color: #f8f9fa;
  border-right: none;
  color: #6c757d;
}

.fwg-input-light {
  border-left: none;
  box-shadow: none !important;
  background-color: #f8f9fa;
}

.fwg-input-light:focus {
  background-color: #ffffff;
  border-color: #dee2e6;
}

.fwg-btn-primary {
  padding: 12px;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
}

.fwg-code-input {
  letter-spacing: 8px;
  font-size: 28px;
  text-align: center;
  font-weight: 700;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 10px;
}

.fwg-code-input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 4px rgba(13,110,253,0.1);
}

.fwg-qr-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.fwg-lang-dropdown {
  min-width: 100px;
}

.fwg-top-right {
  position: absolute;
  top: 0;
  right: 0;
  padding: 1rem;
  z-index: 1000;
}

.fwg-card-sm {
  width: 100%;
  max-width: 400px;
}

.fwg-card-md {
  width: 100%;
  max-width: 500px;
}

/* Portal */
.fwg-container {
  max-width: 800px;
}

.fwg-navbar {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.server-card {
  background: #ffffff;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid #eaedf2;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.server-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.server-icon-box {
  width: 60px;
  height: 60px;
  background: #e7f1ff;
  color: #0d6efd;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-right: 25px;
}

.server-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: #2c3e50;
  line-height: 1.2;
  margin-bottom: 8px;
}

.server-meta {
  font-size: 1.1rem;
  color: #6c757d;
  font-weight: 500;
}

.btn-open {
  padding: 12px 30px;
  font-weight: 700;
  border-radius: 10px;
  font-size: 1.1rem;
  background-color: #198754;
  border-color: #198754;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(25, 135, 84, 0.18);
}

.btn-open:hover {
  background-color: #157347;
}

/* Access granted */
.fwg-success-card {
  background: #ffffff;
  color: #333333;
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 20px 45px rgba(0,0,0,0.25);
  max-width: 500px;
  width: 90%;
}

.fwg-success-icon {
  font-size: 60px;
  color: #198754;
  margin-bottom: 20px;
}

/* Index */
.fwg-access-card {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.15);
  border: 1px solid #eef2f7;
  max-width: 440px;
  width: 90%;
  text-align: center;
}

.fwg-logo-area {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.fwg-app-name {
  font-weight: 700;
  color: #1a1a1a;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.fwg-app-tagline {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.fwg-access-input-group {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 5px;
  border: 1px solid #dee2e6;
  transition: all 0.3s;
}

.fwg-access-input-group:focus-within {
  border-color: var(--fwg-primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}

.fwg-access-input-group .input-group-text {
  background: transparent;
  border: none;
  color: #adb5bd;
  font-weight: 600;
}

.fwg-access-input-group .form-control {
  border: none;
  background: transparent;
  font-weight: 600;
  padding: 0.75rem;
}

.fwg-access-input-group .form-control:focus {
  box-shadow: none;
  background: transparent;
}

.btn-access {
  background: var(--fwg-primary);
  border: none;
  border-radius: 10px;
  padding: 0.8rem;
  font-weight: 600;
  margin-top: 1.5rem;
  transition: transform 0.2s;
}

.btn-access:hover {
  transform: translateY(-2px);
  background: #0b5ed7;
}

.fwg-footer-note {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: #adb5bd;
}

.fwg-modal-card {
  border-radius: 20px;
}

.fwg-modal-alert {
  background: #f8f9fa;
}

.badge {
  border-radius: 999px;
  padding: 0.35em 0.6em;
}

/* Optional themes (activate by adding class to body) */
body.theme-blue {
  --fwg-bg: #eef3ff;
  --fwg-bg-2: #e6eeff;
  --fwg-primary: #1e40af;
  --fwg-primary-600: #1d4ed8;
  --fwg-accent: #f59e0b;
  --fwg-shadow: 0 22px 50px rgba(30, 64, 175, 0.12);
}

body.theme-slate {
  --fwg-bg: #f3f5f7;
  --fwg-bg-2: #e7ebf0;
  --fwg-primary: #0f172a;
  --fwg-primary-600: #1f2937;
  --fwg-accent: #22c55e;
  --fwg-shadow: 0 22px 50px rgba(15, 23, 42, 0.15);
}

.fwg-error-card {
  max-width: 550px;
}

/* Utilities */
.fwg-hidden {
  display: none;
}

.fwg-maxw-1200 {
  max-width: 1200px;
}

.w-1p { width: 1%; }
.w-25 { width: 25px; }
.w-32 { width: 32px; }
.w-45 { width: 45px; }
.w-80 { width: 80px; }
.w-100 { width: 100px; }
.w-110 { width: 110px; }
.w-140 { width: 140px; }
.w-160 { width: 160px; }
.w-200 { width: 200px; }
.w-30p { width: 30%; }

.h-32 { height: 32px; }

.fs-07rem { font-size: 0.7rem; }
.fs-075rem { font-size: 0.75rem; }
.fs-08rem { font-size: 0.8rem; }
.fs-09rem { font-size: 0.9rem; }
.fs-07em { font-size: 0.7em; }
.fs-075em { font-size: 0.75em; }
.fs-08em { font-size: 0.8em; }
.fs-09em { font-size: 0.9em; }

.fwg-subtitle {
  opacity: 0.8;
  font-size: 0.9em;
}

.fwg-badge-super {
  font-size: 0.6em;
  vertical-align: top;
}

.fwg-small-muted {
  font-size: 0.75em;
  opacity: 0.8;
}

.fwg-hr-dashed {
  border-style: dashed;
}

.fwg-input-xs {
  width: 80px;
}

.fwg-sticky-header {
  top: 0;
  z-index: 1020;
  margin-top: -1.5rem;
  padding-top: 1.5rem !important;
}

.fwg-summary-divider {
  border-bottom: 1px solid #f0f0f0;
}

.fwg-table-fixed {
  table-layout: fixed;
  width: 100%;
}

.fwg-progress-sm {
  height: 5px;
}

.fwg-progress-bar {
  transition: width 0.3s ease;
}

.fwg-bg-purple {
  background-color: #6f42c1;
}

.fwg-qr-box {
  display: inline-block;
  margin: 0 auto 15px auto;
  width: 100%;
}

.fwg-qr-inner {
  display: flex;
  justify-content: center;
}

.fwg-scroll-400 {
  max-height: 400px;
  overflow-y: auto;
}

.fwg-pb-7 {
  padding-bottom: 7rem;
}

.fwg-mono-bold {
  font-family: monospace;
  font-weight: 700;
}

.fwg-code-input-sm {
  letter-spacing: 3px;
  font-weight: 700;
}

.fwg-code-input-lg {
  letter-spacing: 5px;
  font-size: 1.5rem;
}

.fwg-icon-5xl {
  font-size: 5rem;
}
