/* ===== AGIS Shared Variables & Base Styles ===== */
:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1f3a;
  --bg-card: #132244;
  --bg-input: #0c1a30;
  --border: #1a3055;
  --text: #e0e8f0;
  --text-dim: #7a8da6;
  --accent: #00d4ff;
  --accent-hover: #00b8e0;
  --btn: #0088aa;
  --btn-hover: #006d8a;
  --danger: #ff4466;
  --danger-hover: #dd2244;
  --success: #00cc88;
  --yellow: #eab308;
  --blue: #3b82f6;
  --red: #ff4466;
  --green: #00cc88;
  --radius: 8px;
  --radius-lg: 12px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ===== Shared Navbar ===== */
.shared-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
  background: rgba(15, 31, 58, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.shared-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.shared-topbar .brand:hover { text-decoration: none; }

.shared-topbar .brand img {
  height: 34px;
  width: 34px;
  object-fit: contain;
  border-radius: 8px;
}

.shared-topbar .nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.shared-topbar .nav-right a {
  color: var(--text-dim);
  font-size: 0.82rem;
  transition: color 0.2s;
}

.shared-topbar .nav-right a:hover {
  color: var(--accent);
  text-decoration: none;
}

.shared-topbar .portal-link {
  color: var(--accent) !important;
  font-weight: 600;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.shared-topbar .portal-link:hover {
  opacity: 1;
}

/* ===== Shared Login ===== */
.shared-login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.shared-login-card {
  background: rgba(19, 34, 68, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.shared-login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.shared-login-logo img {
  height: 64px;
  width: 64px;
  object-fit: contain;
  border-radius: 14px;
  margin-bottom: 0.75rem;
}

.shared-login-logo h1 {
  color: var(--accent);
  font-size: 1.4rem;
}

.shared-login-logo p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.shared-login-card .form-group {
  margin-bottom: 1rem;
}

.shared-login-card label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shared-login-card input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.shared-login-card input:focus {
  border-color: var(--accent);
}

.shared-login-card button[type="submit"] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius);
  background: var(--btn);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.shared-login-card button[type="submit"]:hover {
  background: var(--btn-hover);
}

.shared-login-card .error-msg {
  background: rgba(255, 68, 102, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ===== Shared Toast ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  z-index: 300;
  animation: slideIn 0.3s ease;
}

.toast-success { background: var(--success); color: #000; }
.toast-error { background: var(--danger); color: #fff; }

@keyframes slideIn {
  from { transform: translateY(1rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Responsive base ===== */
@media (max-width: 768px) {
  .shared-topbar {
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .shared-topbar .nav-right {
    gap: 0.6rem;
    flex-wrap: wrap;
  }
  .shared-login-card {
    margin: 1rem;
    padding: 1.5rem;
  }
}
