/* System Auth - Clean, Premium Dark Theme */
:root {
  --bg-main: #0c0d12;
  --bg-card: #13151f;
  --bg-card-hover: #181a27;
  --bg-input: #0a0b0f;
  --border-color: #212433;
  --border-focus: #6366f1;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --code-bg: #090a0e;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #818cf8;
}

/* Navbar */
.navbar {
  background-color: rgba(19, 21, 31, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.nav-badge {
  font-size: 0.7rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
}

/* Layout Container */
.container {
  max-width: 1000px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  flex: 1;
  width: 100%;
}

.container-narrow {
  max-width: 720px;
}

.container-wide {
  max-width: 1200px;
}

/* Flash Messages */
.flash-messages {
  margin-bottom: 1.8rem;
}

.alert {
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.8rem;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.alert-info {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
}

.hero-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.4rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: #e2e8f0;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 0.95rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  font-size: 0.88rem;
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  user-select: none;
}

.form-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

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

.btn-discord {
  background-color: #5865F2;
  color: #fff;
  border-color: #4752C4;
}

.btn-discord:hover {
  background-color: #4752C4;
  color: #fff;
}

/* Discord Profile Card */
.discord-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.3);
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.discord-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.discord-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #5865F2;
  object-fit: cover;
}

.discord-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.98rem;
}

.discord-id-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #a5b4fc;
}

/* Cooldown Alert Banner */
.cooldown-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cooldown-banner-title {
  color: #fcd34d;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.cooldown-banner-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn-secondary {
  background-color: #212433;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #292d3f;
  color: #fff;
}

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

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-PENDING {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.status-APPROVED, .status-ACTIVE, .status-ALLOWED {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.status-REJECTED, .status-BANNED, .status-DENIED, .status-INVALID_SIGNATURE {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 11, 15, 0.4);
}

.table td {
  padding: 0.95rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
}

/* Code Snippets */
.code-box {
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  word-break: break-all;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  .card {
    padding: 1.4rem;
  }
  .hero-actions {
    flex-direction: column;
  }
}
