/* ============================================================
   ONYX.CSS — FINAL (AUTHORITATIVE COPY)
   Professional UI system for Onyx
   Bootstrap 5 compatible
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root{
  /* Backgrounds */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: rgba(15, 23, 42, 0.12);

  /* Text */
  --text: #111827;
  --muted: #6b7280;

  /* Brand */
  --brand: #1f2a44;
  --brand-hover: #16203a;

  /* Buttons */
  --btn-bg: #2f3f66;
  --btn-bg-hover: #233154;

  /* Status */
  --success: #1f7a4f;
  --warning: #9a5b00;
  --danger:  #b42318;

  /* Shape */
  --radius: 14px;
  --radius-sm: 10px;

  /* Depth */
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.10);

  /* Focus */
  --ring: rgba(31, 42, 68, 0.28);
}

/* ---------- GLOBAL ---------- */
body{
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.container-fluid{
  max-width: 1500px;
}

/* ---------- LINKS (DEFAULT) ---------- */
a{
  color: var(--brand);
  text-decoration: none;
}
a:hover{
  color: var(--brand-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- FOCUS ---------- */
:focus-visible{
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ---------- BUTTONS ---------- */
.btn{
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none !important;
}

/* NEVER underline buttons */
.btn,
.btn:hover,
.btn:focus,
a.btn:hover{
  text-decoration: none !important;
}

/* Primary */
.btn-primary{
  background: var(--btn-bg) !important;
  border-color: var(--btn-bg) !important;
  color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus{
  background: var(--btn-bg-hover) !important;
  border-color: var(--btn-bg-hover) !important;
}

/* Outline primary */
.btn-outline-primary{
  color: var(--btn-bg) !important;
  border-color: rgba(47,63,102,.45) !important;
}
.btn-outline-primary:hover{
  background: rgba(47,63,102,.08) !important;
  color: var(--btn-bg-hover) !important;
}

/* Outline secondary */
.btn-outline-secondary{
  border-color: rgba(15,23,42,.2);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  color: #212529;          /* bootstrap text-dark */
  background-color: #e9ecef;
  border-color: #ced4da;
}

/* Mobile buttons */
@media (max-width: 768px){
  .btn{
    min-height: 44px;
    padding: 10px 14px;
    font-size: 16px;
  }
}

/* ---------- FORMS ---------- */
.form-label{
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
}

.form-control,
.form-select{
  border-radius: 12px;
  border: 1px solid var(--border);
}

.form-control:focus,
.form-select:focus{
  border-color: rgba(47,63,102,.45);
  box-shadow: 0 0 0 .2rem rgba(47,63,102,.18);
}

/* ---------- CARDS ---------- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header{
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

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

.card:hover{
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  transition: box-shadow .15s ease, transform .15s ease;
}

/* ---------- PAGE HEADER ---------- */
.onyx-pagehead{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.onyx-pagehead h2{
  margin: 0;
  font-weight: 800;
}

.onyx-pagehead-sub{
  color: var(--muted);
}

/* ---------- SECTIONS ---------- */
.onyx-section{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.onyx-section-header{
  padding: 12px 14px;
  font-weight: 800;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.onyx-section-body{
  padding: 14px;
}

/* ---------- SIDEBAR ---------- */
.sidebar{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px 0;
}

.sidebar ul{
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar a{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 8px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none !important; /* 🚫 NO UNDERLINES */
}

.sidebar a:hover{
  background: var(--surface-2);
  text-decoration: none !important;
}

.sidebar a.active{
  background: var(--btn-bg);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47,63,102,.25);
  text-decoration: none !important;
}

/* ---------- AUTH (LOGIN / REGISTER / PASSWORD) ---------- */
.onyx-auth-card{
  background: var(--surface);
  border: 1px solid rgba(15,23,42,.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* Auth links should look like normal web links */
.onyx-auth-links{
  text-align: center;
  font-size: .95rem;
}

.onyx-auth-links a{
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.onyx-auth-links a:hover{
  color: #1d4ed8;
}

/* Password help text */
.onyx-helptext{
  color: var(--muted);
  font-size: .875rem;
}
.onyx-helptext ul{
  margin: .35rem 0 0 1.1rem;
  padding: 0;
}
.onyx-helptext li{
  margin:0;
}

.errorlist { margin: .25rem 0 0; padding-left: 1rem; color: #dc3545; }
.errorlist li { margin: 0; color: #dc3545;}
.invalid-feedback {
    display: block;
  }

.invalid-input {
    border-color: red;
    border-style: solid;
    border-width: 2px; /* Adjust as needed */
}

/* If using Bootstrap conventions */
.is-invalid {
    border-color: #dc3545; /* Bootstrap red color */
}
.form-input.error,
.form-input:invalid {
    border: 2px solid red !important;
}