/* Portkey shared styles */
:root {
  --primary: #232f3e;
  --primary-light: #37475a;
  --accent: #ff9900;
  --success: #1d8102;
  --danger: #d13212;
  --warning: #f89256;
  --bg: #f2f3f3;
  --card-bg: #ffffff;
  --text: #16191f;
  --text-light: #687078;
  --border: #d5dbdb;
  --radius: 4px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Navigation */
.nav {
  background: var(--primary);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover {
  color: var(--accent);
}
.nav .brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #d5dbdb;
  color: var(--text-light);
}
.btn-inline {
  padding: 4px 12px;
  font-size: 13px;
}

/* Forms */
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  font-weight: 500;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg);
  font-weight: 600;
  font-size: 13px;
}

/* Status badges */
.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-active {
  background: #d5f5d5;
  color: var(--success);
}
.badge-inactive {
  background: #f2f3f3;
  color: var(--text-light);
}
.badge-unverified {
  background: #fef3cd;
  color: #856404;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.alert-error {
  background: #fce9e6;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.alert-success {
  background: #d5f5d5;
  color: var(--success);
  border: 1px solid var(--success);
}
.alert-warning {
  background: #fef3cd;
  color: #856404;
  border: 1px solid #ffc107;
}
.alert-info {
  background: #e8f4fd;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 500px;
  width: 90%;
}

/* Layout utilities */
.text-center {
  text-align: center;
}
.mt-80 {
  margin-top: 80px;
}
.mt-20 {
  margin-bottom: 20px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mb-12 {
  margin-bottom: 12px;
}
.mb-16 {
  margin-bottom: 16px;
}
.mb-24 {
  margin-bottom: 24px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 4px;
}
.mt-16 {
  margin-top: 16px;
}
.ml-auto {
  margin-left: auto;
}
.ml-8 {
  margin-left: 8px;
}
.w-full {
  width: 100%;
}
.p-8 {
  padding: 8px;
}
.max-w-400 {
  max-width: 400px;
}
.max-w-500 {
  max-width: 500px;
}
.hidden {
  display: none;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid-2.grid-align-start {
  align-items: start;
}
.grid-gap-12 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Text utilities */
.text-accent {
  color: var(--accent);
}
.text-light {
  color: var(--text-light);
}
.text-danger {
  color: var(--danger);
}
.text-sm {
  font-size: 13px;
}
.text-lg {
  font-size: 18px;
}

/* Divider */
.divider {
  margin: 16px 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* Toast notifications — Cloudscape flashbar style */
.toast-container {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}
.toast.toast-success {
  background: var(--success);
  color: #fff;
}
.toast.toast-error {
  background: var(--danger);
  color: #fff;
}
.toast.toast-info {
  background: #0972d3;
  color: #fff;
}
.toast-message {
  flex: 1;
}
.toast-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 0 0 12px;
  line-height: 1;
}
.toast-dismiss:hover {
  color: #fff;
}
.toast.toast-fade {
  opacity: 0;
}
.streaming-frame {
  width: 100%;
  height: 80vh;
  border: none;
  border-radius: var(--radius);
}
.join-container {
  max-width: 500px;
  margin: 40px auto;
}
.join-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 18px;
  text-align: center;
  transition: border-color 0.2s;
}
.join-input:focus {
  outline: none;
  border-color: var(--accent);
}
.join-btn {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 12px;
}
.join-subtitle {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 20px;
}
.join-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* OIDC provider button */
.btn-oidc {
  background: var(--primary);
  color: #fff;
}

/* TOS notice on login page */
.tos-notice {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}
.tos-notice a {
  color: var(--text-light);
  text-decoration: underline;
}
.tos-notice a:hover {
  color: var(--text);
}

.nowrap {
  white-space: nowrap;
}

/* Card sections */
.firewall-section {
  padding: 4px 0;
}
.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* Click-to-copy code */
.copy-code {
  font-weight: 600;
  cursor: pointer;
}
.copy-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.6;
}
.copy-code:hover .copy-icon {
  opacity: 1;
}

/* Inline form row */
.flex-row-gap-8 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flex-row-gap-8 input {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  width: 72px;
}
.flex-row-gap-8 input.input-md {
  width: 80px;
}
