/* ------------------------------------------------------------------
   CMS additions layered on top of styles.css.
   Public feature pages reuse styles.css classes; this file covers the
   util-row auth controls and the admin backend panels.
------------------------------------------------------------------ */

/* auth controls in the header utility row */
.util-row .util-logout { display: inline; }
.util-row button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-thin);
  font-size: 13px;
  color: var(--dark-blue);
}
.util-row button:hover { color: var(--red); }
.main-nav a.nav-admin { color: var(--red); font-weight: 700; }

/* search results */
.search-results { max-width: 820px; margin: 0 auto; text-align: left; }
.search-hit { padding: 18px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.search-hit a { color: var(--white); font-family: var(--font-heading); font-size: 20px; text-decoration: none; }
.search-hit a:hover { color: var(--red-text); }
.search-hit p { color: rgba(255, 255, 255, .82); font-size: 15px; line-height: 1.6; margin-top: 6px; }
.search-empty { color: rgba(255, 255, 255, .82); }

/* status / validation messages on public forms */
.alert { border-radius: 4px; padding: 14px 16px; margin: 0 auto 20px; max-width: 620px; text-align: left; }
.alert-success { background: rgba(40, 160, 90, .18); border: 1px solid rgba(40, 160, 90, .55); color: #eafff2; }
.alert-error   { background: rgba(226, 28, 33, .18); border: 1px solid rgba(226, 28, 33, .55); color: #ffecec; }
.field .text-danger, .validation-summary-errors { color: #ffb4b0; font-size: 13px; }

/* ---------------- admin backend ---------------- */
.admin-panel {
  background: #ffffff;
  color: #14232e;
  max-width: 1040px;
  margin: 40px auto;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  padding: 32px 36px;
  text-align: left;
}
.admin-panel h1 { font-family: var(--font-heading); font-size: 30px; color: #14232e; margin-bottom: 6px; }
.admin-panel h2 { font-family: var(--font-heading); font-size: 22px; color: #14232e; margin: 26px 0 12px; }
.admin-panel a { color: #0e2e47; }
.admin-crumbs { font-size: 13px; margin-bottom: 18px; }
.admin-crumbs a { color: var(--red); text-decoration: none; }
.admin-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e3e7ea; vertical-align: top; }
.admin-table th { background: #f3f5f7; font-family: var(--font-heading); color: #14232e; }
.admin-table tr:hover td { background: #fafbfc; }
.badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; }
.badge-on { background: #d7f5e3; color: #106b39; }
.badge-off { background: #f1d6d7; color: #a11f24; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-heading); font-size: 14px; letter-spacing: .03em;
  border: 0; border-radius: 4px; padding: 9px 18px; cursor: pointer; text-decoration: none;
}
.btn-primary { background: #0e2e47; color: #fff; }
.btn-primary:hover { background: var(--red); }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: #eef1f4; color: #14232e; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.admin-form { max-width: 780px; }
.admin-form label { display: block; font-family: var(--font-heading); font-size: 13px; color: #14232e; margin: 16px 0 6px; }
.admin-form input[type=text],
.admin-form input[type=number],
.admin-form input[type=email],
.admin-form textarea,
.admin-form select {
  width: 100%; padding: 10px 12px; font-size: 14px; font-family: var(--font-body);
  border: 1px solid #c3ccd3; border-radius: 4px; color: #14232e; background: #fff;
}
.admin-form textarea { min-height: 320px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; }
.admin-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-form .check { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.admin-form .check input { width: 18px; height: 18px; accent-color: var(--red); }
.admin-form .check label { margin: 0; }
.admin-actions { display: flex; gap: 12px; margin-top: 26px; }
.text-danger { color: #a11f24; font-size: 13px; }
.form-hint { color: #5c6b76; font-size: 12px; margin-top: 4px; }

/* ---------------- auth overlay (login / register) ---------------- */
.util-row .util-link { /* trigger buttons already inherit .util-row button styling */ }

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 18, 28, .74);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: authFade .18s ease;
}
.auth-modal[hidden] { display: none; }
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }

.auth-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  text-align: center;
  background: linear-gradient(180deg, rgba(20, 44, 64, .98), rgba(13, 33, 48, .98));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .62);
  padding: 38px 36px 32px;
  animation: authPop .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes authPop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, .7);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-close:hover { background: rgba(255, 255, 255, .1); color: var(--red-text); }

.auth-logo { width: 150px; height: auto; margin: 0 auto 20px; filter: brightness(0) invert(1); opacity: .95; }
.auth-dialog h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: .04em;
  color: var(--white);
  margin-bottom: 6px;
}
.auth-sub { color: rgba(255, 255, 255, .7); font-size: 14px; margin-bottom: 24px; }

.auth-dialog form { text-align: left; }
.auth-dialog .field { margin-bottom: 16px; }
.auth-remember { margin: 4px 0 8px; font-size: 14px; }
.auth-dialog .btn-pill.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  background: var(--red);
}
.auth-dialog .btn-pill.auth-submit:hover { background: #c2141a; }
.auth-dialog .btn-pill.auth-submit:disabled { opacity: .6; cursor: default; }

.auth-error {
  margin: 2px 0 14px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(226, 28, 33, .16);
  border: 1px solid rgba(226, 28, 33, .5);
  color: #ffd7d5;
  font-size: 14px;
}
.auth-switch { margin-top: 20px; text-align: center; color: rgba(255, 255, 255, .78); font-size: 14px; }
.auth-switch a { color: var(--red-text); text-decoration: none; font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .auth-dialog { padding: 30px 22px 26px; }
  .auth-dialog h2 { font-size: 26px; }
}
