/* ============================================================
   CuteChat demo site - modern theme
   Layered on top of Bootstrap 3; overrides its legacy chrome.
   ============================================================ */

:root {
  --cc-bg:            #f6f8fc;
  --cc-surface:       #ffffff;
  --cc-surface-alt:   #f2f5fa;
  --cc-border:        #e3e8f0;
  --cc-border-soft:   #edf1f7;
  --cc-text:          #1b2437;
  --cc-text-muted:    #64708a;
  --cc-brand:         #2f6bff;
  --cc-brand-dark:    #1f4fd8;
  --cc-brand-soft:    #eaf0ff;
  --cc-accent:        #12b981;
  --cc-radius:        14px;
  --cc-radius-sm:     9px;
  --cc-shadow-sm:     0 1px 2px rgba(16, 24, 40, .05);
  --cc-shadow:        0 4px 16px -4px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --cc-shadow-lg:     0 24px 48px -16px rgba(16, 24, 40, .18);
  --cc-ease:          200ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------- base ---------- */

html { -webkit-text-size-adjust: 100%; }

body {
  padding-top: 0;
  background: var(--cc-bg);
  color: var(--cc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1160px; }

h1, h2, h3, h4 {
  color: var(--cc-text);
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.25;
}

a { color: var(--cc-brand); text-decoration: none; transition: color var(--cc-ease); }
a:hover, a:focus { color: var(--cc-brand-dark); text-decoration: none; }

/* visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cc-brand);
  outline-offset: 2px;
}

/* ---------- top account bar ---------- */

.nav.pull-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  float: none !important;
  justify-content: flex-end;
  padding: 14px 2px 0;
  font-size: 13.5px;
  color: var(--cc-text-muted);
}
.nav.pull-right a { color: var(--cc-text-muted); }
.nav.pull-right a:hover { color: var(--cc-brand); }

/* ---------- masthead + nav ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 8px 0 22px;
}
.masthead h3 { margin: 0; }
.masthead img { max-height: 46px; width: auto; }

.topmenu { flex: 1 1 420px; min-width: 0; }

/* Nav pill bar - replaces the old gradient/border stack */
.nav-justified,
ul.nav.nav-justified {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: none;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  box-shadow: var(--cc-shadow-sm);
}
.nav-justified > li { flex: 1 1 auto; float: none; text-align: center; }

.nav-justified > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 0;
  color: var(--cc-text-muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  background: transparent;
  background-image: none;
  filter: none;
  border: 0;
  border-radius: 999px;
  transition: background var(--cc-ease), color var(--cc-ease);
}
.nav-justified > li > a:hover,
.nav-justified > li > a:focus {
  color: var(--cc-brand-dark);
  background: var(--cc-brand-soft);
}
.nav-justified > .active > a,
.nav-justified > .active > a:hover,
.nav-justified > .active > a:focus {
  color: #fff;
  background: var(--cc-brand);
  background-image: none;
  box-shadow: none;
}
.nav-justified > li > a img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

/* ---------- hero ---------- */

.jumbotron {
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
  padding: 48px 44px;
  text-align: left;
  color: var(--cc-text);
  background: linear-gradient(135deg, #eef3ff 0%, #ffffff 55%, #eafaf3 100%);
  border: 1px solid var(--cc-border);
  border-radius: 22px;
  box-shadow: var(--cc-shadow);
}
.jumbotron h1 {
  margin: 0 0 16px;
  font-size: 44px;
  font-size: clamp(30px, 4.4vw, 48px);
  font-weight: 750;
}
.jumbotron .lead {
  max-width: 78ch;
  color: var(--cc-text-muted);
  font-size: 16.5px;
  font-weight: 400;
}
.jumbotron .lead img {
  max-width: 300px;
  height: auto;
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
}
.jumbotron .btn { padding: 14px 28px; font-size: 16px; }

.hero-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}
.hero-copy { flex: 1 1 420px; min-width: 0; }
.hero-art  { flex: 0 1 300px; }
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow-lg);
}
.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  color: var(--cc-brand-dark);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .75);
  border: 1px solid #d9e3ff;
  border-radius: 999px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- feature cards ---------- */

.feature-row { display: flex; flex-wrap: wrap; margin-bottom: 12px; }
.feature-row > [class^="col-"] { display: flex; margin-bottom: 24px; }

.feature {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 26px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow-sm);
  transition: box-shadow var(--cc-ease), transform var(--cc-ease);
}
.feature:hover { box-shadow: var(--cc-shadow); transform: translateY(-2px); }
.feature h2 { margin: 0 0 12px; font-size: 20px; }
.feature p { color: var(--cc-text-muted); }
.feature > p:last-child { margin: auto 0 0; padding-top: 14px; }

.cred { display: flex; flex-wrap: wrap; gap: 8px; }
.cred span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 13px;
  background: var(--cc-surface-alt);
  border: 1px solid var(--cc-border);
  border-radius: 999px;
}
code {
  padding: 2px 7px;
  color: var(--cc-brand-dark);
  font-size: 12.5px;
  background: var(--cc-brand-soft);
  border: 0;
  border-radius: 6px;
}

.float-img {
  float: right;
  width: 250px;
  max-width: 45%;
  margin: 0 0 16px 20px;
}

.link-list { margin: 0; padding: 0; list-style: none; }
.link-list li + li { margin-top: 8px; }
.link-list a {
  display: block;
  padding: 11px 14px;
  font-weight: 600;
  background: var(--cc-surface-alt);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-sm);
  transition: background var(--cc-ease), border-color var(--cc-ease);
}
.link-list a:hover { background: var(--cc-brand-soft); border-color: #c6d6ff; }

.hero-note { margin-top: 18px; color: var(--cc-text-muted); font-size: 13.5px; }

.page-intro {
  max-width: 68ch;
  margin: 0 0 24px;
  color: var(--cc-text-muted);
  font-size: 15.5px;
}

.empty-state {
  margin: 0;
  padding: 28px 24px;
  color: var(--cc-text-muted);
  text-align: center;
  background: var(--cc-surface-alt);
  border: 1px dashed var(--cc-border);
  border-radius: var(--cc-radius);
}
.empty-state b { display: block; margin-bottom: 4px; color: var(--cc-text); font-size: 15px; }
.muted-note { color: var(--cc-text-muted); font-size: 13.5px; margin: 0 0 14px; }

/* numbered setup steps — a real sequence, so the numbers carry meaning */
.steps { margin: 0 0 20px; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 18px 44px;
  color: var(--cc-text-muted);
}
.steps li:last-child { padding-bottom: 8px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--cc-brand-dark);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--cc-brand-soft);
  border-radius: 50%;
}
.steps b { display: block; color: var(--cc-text); font-weight: 600; }

/* feature inventory */
.spec-grid {
  display: grid;
  gap: 22px 28px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.spec-grid b {
  display: block;
  margin-bottom: 4px;
  color: var(--cc-text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.spec-grid p { margin: 0; color: var(--cc-text-muted); font-size: 14px; }

/* ---------- buttons ---------- */

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: none;
  text-shadow: none;
  background-image: none;
  transition: background var(--cc-ease), border-color var(--cc-ease),
              transform var(--cc-ease), box-shadow var(--cc-ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary,
.btn-primary:focus {
  background: var(--cc-brand);
  border-color: var(--cc-brand);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary:active:hover {
  background: var(--cc-brand-dark);
  border-color: var(--cc-brand-dark);
  box-shadow: var(--cc-shadow);
}

.btn-success,
.btn-success:focus {
  background: var(--cc-accent);
  border-color: var(--cc-accent);
  color: #fff;
}
.btn-success:hover,
.btn-success:active,
.btn-success:active:hover {
  background: #0e9d6d;
  border-color: #0e9d6d;
  box-shadow: var(--cc-shadow);
}

.btn-default {
  background: var(--cc-surface);
  border-color: var(--cc-border);
  color: var(--cc-text);
}
.btn-default:hover { background: var(--cc-surface-alt); border-color: #cfd8e6; }

/* ---------- feature columns ---------- */

.row [class^="col-"] > h2 {
  margin-top: 4px;
  font-size: 21px;
}

/* ---------- cards ---------- */

.infobox {
  margin: 0 0 24px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--cc-ease), transform var(--cc-ease);
}
.infobox:hover { box-shadow: var(--cc-shadow); }

.infobox > h2 {
  margin: 0;
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 650;
  color: var(--cc-text);
  background: var(--cc-surface-alt);
  border-bottom: 1px solid var(--cc-border);
}
.infobox .padding20 {
  padding: 24px;
  height: auto !important;   /* kill legacy fixed pixel heights */
  color: var(--cc-text-muted);
}
.infobox .padding20 img { max-width: 100%; height: auto; border-radius: var(--cc-radius-sm); }
.infobox .padding20 strong { color: var(--cc-text); }
.infobox .padding20 a { font-weight: 600; }

/* room / list tables inside cards */
.infobox table { width: 100%; }
.infobox td { vertical-align: top; }

/* chat room tiles */
.infobox a > nobr {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-weight: 600;
  background: var(--cc-surface-alt);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-sm);
  transition: background var(--cc-ease), border-color var(--cc-ease);
}
.infobox a:hover > nobr {
  background: var(--cc-brand-soft);
  border-color: #c6d6ff;
}
.infobox a > nobr img { border-radius: 10px; }

/* ---------- chat room list ---------- */

.room-card { max-width: 960px; margin: 40px auto; }
.room-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
}
.room-list { flex: 1 1 380px; min-width: 0; }
.room-art  { flex: 0 1 280px; }
.room-art img { width: 100%; height: auto; border-radius: var(--cc-radius); }
.room-list table { width: auto; }
.room-list td { padding: 4px 8px 12px 0; }
.room-meta { margin-top: 6px; color: var(--cc-text-muted); font-size: 13px; }

/* ---------- forms ---------- */

input[type="text"], input[type="password"], input[type="email"], textarea, select,
.form-control {
  height: auto;
  padding: 9px 12px;
  color: var(--cc-text);
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-sm);
  box-shadow: none;
  transition: border-color var(--cc-ease), box-shadow var(--cc-ease);
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus,
select:focus, .form-control:focus {
  border-color: var(--cc-brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .15);
  outline: none;
}

/* ---------- auth / form pages ---------- */

.auth-card { max-width: 460px; margin: 48px auto; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--cc-text);
  font-size: 13.5px;
  font-weight: 600;
}
.field-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  color: var(--cc-text);
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-sm);
  transition: border-color var(--cc-ease), box-shadow var(--cc-ease);
}
.field-input:focus {
  border-color: var(--cc-brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .15);
  outline: none;
}
/* form-level failure: shown in place, not in an alert() box */
.form-error {
  display: block;
  margin: 0 0 20px;
  padding: 12px 16px;
  color: #9f1239;
  font-size: 14px;
  background: #fff1f2;
  border: 1px solid #fbd5da;
  border-left: 3px solid #e11d48;
  border-radius: var(--cc-radius-sm);
}

.field-error {
  display: block;
  margin-top: 6px;
  color: #d63636;
  font-size: 13px;
}
.field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--cc-text-muted);
  font-size: 14px;
}
.field-check input { accent-color: var(--cc-brand); margin: 0; }
.field-check label { margin: 0; font-weight: 400; }
.field-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.field-actions .btn { padding: 10px 22px; }
.field-hint {
  margin: 20px 0 0;
  padding-top: 16px;
  color: var(--cc-text-muted);
  font-size: 13px;
  border-top: 1px solid var(--cc-border);
}

/* ---------- tables ---------- */

.table > thead > tr > th {
  border-bottom: 1px solid var(--cc-border);
  color: var(--cc-text-muted);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.table > tbody > tr > td { border-top: 1px solid var(--cc-border); }
.table-striped > tbody > tr:nth-of-type(odd) { background: var(--cc-surface-alt); }

/* ---------- footer ---------- */

.footer,
#CommonFooter {
  margin-top: 48px;
  padding: 28px 0 40px;
  color: var(--cc-text-muted);
  font-size: 13.5px;
  text-align: center;
  border-top: 1px solid var(--cc-border);
}
.footer p { margin: 0; }

/* ---------- responsive ---------- */

@media (max-width: 767px) {
  .masthead { justify-content: center; text-align: center; }
  .nav.pull-right { justify-content: center; }
  .nav-justified { border-radius: var(--cc-radius); }
  .nav-justified > li { flex: 1 1 45%; }
  .jumbotron { padding: 32px 22px; }
  .jumbotron .lead img { float: none !important; display: block; margin: 0 0 20px; }
  .hero-grid { gap: 26px; }
  .hero-art { flex: 1 1 100%; order: -1; }
  .float-img { float: none; width: 100%; max-width: 100%; margin: 0 0 16px; }
}

@media screen and (min-width: 768px) {
  .masthead, .marketing, .footer { padding-right: 0; padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   Dark theme - follows the operating system setting.
   Only the tokens are redefined; every rule above reads them.
   ============================================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --cc-bg:          #0e1320;
    --cc-surface:     #161d2c;
    --cc-surface-alt: #1c2436;
    --cc-border:      #28324a;
    --cc-border-soft: #222c42;
    --cc-text:        #e8edf7;
    --cc-text-muted:  #9aa5bb;
    --cc-brand:       #6f9bff;
    --cc-brand-dark:  #8fb2ff;
    --cc-brand-soft:  #1e2942;
    --cc-accent:      #34d399;
    --cc-shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
    --cc-shadow:      0 4px 16px -4px rgba(0, 0, 0, .55), 0 2px 4px -2px rgba(0, 0, 0, .4);
    --cc-shadow-lg:   0 24px 48px -16px rgba(0, 0, 0, .7);
  }

  .jumbotron {
    background: linear-gradient(135deg, #16203a 0%, #161d2c 55%, #14261f 100%);
  }
  .eyebrow {
    background: rgba(255, 255, 255, .06);
    border-color: #2c3a5c;
  }

  .btn-primary, .btn-primary:focus { color: #0e1320; }
  .btn-success, .btn-success:focus { color: #0e1320; }
  .btn-default { background: var(--cc-surface); border-color: var(--cc-border); color: var(--cc-text); }
  .btn-default:hover { background: var(--cc-surface-alt); border-color: #3a4767; }

  code { color: #b9ccff; background: var(--cc-brand-soft); }

  .form-error { color: #fecdd3; background: #2b1720; border-color: #4a2430; }
  .field-error { color: #fda4af; }

  .empty-state { background: var(--cc-surface-alt); border-color: var(--cc-border); }

  input[type="text"], input[type="password"], input[type="email"], textarea, select,
  .form-control, .field-input {
    color: var(--cc-text);
    background: var(--cc-surface-alt);
    border-color: var(--cc-border);
  }
  input::placeholder, textarea::placeholder { color: #7c88a1; }
}
