/* CBIA secure server (Till Death Do Us Part) — login box, then the memory-card image gallery.
   Ported from the Flatsome blank landing page + WPCode CSS snippet; asset paths changed. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Lato, sans-serif;
  font-weight: 400;
  color: #0a0a0a;
  background: #fff;
  line-height: 1.6;
}

.page {
  padding: 30px 16px;
  text-align: center;
}

h2 {
  font-weight: 700;
  font-size: 1.6em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.3em; }

.login-error {
  margin: 0 0 20px;
  min-height: 1.6em;
}

.custom-login-form-container {
  background-color: #f0f0f0;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 300px;
  margin: 0 auto;
  text-align: left;
}

.custom-login-logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 100px;
}

.custom-login-input-group { margin-bottom: 15px; }
.custom-login-input-group label { display: block; margin-bottom: 4px; }

.custom-login-input-group input {
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 16px;
  font-family: inherit;
}

.custom-login-input-group input:focus {
  outline: none;
  border-color: #007cba;
}

.submit input {
  background-color: #007cba;
  color: #ffffff;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  font-family: inherit;
}

.submit input:hover { background-color: #005fa3; }

.logout-link {
  display: inline-block;
  margin-top: 30px;
  color: #334862;
}

/* Case file (after login) */
.contents { display: none; }
.contents.open { display: block; }

.server-logo {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto 20px;
}

.note {
  max-width: 1080px;
  margin: 0 auto 1.3em;
  text-align: left;
}

.results {
  max-width: 1080px;
  margin: 30px auto 0;
}

/* Each file sits in a dashed-bordered row, as on the original (Flatsome "row-dashed"). */
.result {
  border: 1px dashed #ddd;
  padding: 15px;
  margin: 0 auto 30px;
}

.result-icon {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
  margin: 0 auto 10px;
}

.result p { margin: 0; }
.result .button { margin-top: 15px; }

.button {
  display: inline-block;
  padding: 0 1.2em;
  line-height: 2.4em;
  font-weight: 700;
  font-size: 0.97em;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: #cd5555;
  border: 2px solid #cd5555;
  border-radius: 10px;
}

.button:hover { filter: brightness(0.9); }

/* Memory-card gallery (after login): Flatsome gallery grid, 4 / 3 / 2 columns. */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  max-width: 1080px;
  margin: 0 auto;
}
@media (min-width: 550px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 850px) { .gallery { grid-template-columns: repeat(4, 1fr); } }

.gallery a { display: block; position: relative; background: #000; }
.gallery img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.gallery a::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}
.gallery a:hover::after { background: rgba(0, 0, 0, 0); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
body.lightbox-open { overflow: hidden; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox button {
  position: absolute;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  padding: 12px 18px;
  cursor: pointer;
  opacity: 0.85;
}
.lightbox button:hover { opacity: 1; }
.lightbox-close { top: 6px; right: 6px; }
.lightbox-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute; top: 18px; left: 18px;
  color: #ccc; font-size: 13px;
}
