/* ==========================================================================
   Carivium Global Authentication Gate & Entrance Modal
   Matches index.html's Evening Primrose obsidian & gold aesthetic.
   ========================================================================== */

html.carivium-auth-checking,
html.carivium-auth-checking body {
  background-color: #080b06 !important;
}
html.carivium-auth-checking body > * {
  visibility: hidden !important;
  opacity: 0 !important;
}

/* ---------- Landing Page Auth Modal ---------- */
.carivium-gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(5, 7, 4, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: cariviumFadeIn 0.28s ease forwards;
}
.carivium-gate-backdrop[hidden] {
  display: none;
}

.carivium-gate-card {
  position: relative;
  width: min(100%, 410px);
  background: radial-gradient(ellipse at top, #181911 0%, #0d100a 58%, #070905 100%);
  border: 1px solid rgba(255, 211, 107, 0.34);
  border-radius: 14px;
  padding: 2rem 1.85rem 1.75rem;
  color: #f8e5b0;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 227, 154, 0.14);
}

.carivium-gate-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 211, 107, 0.24);
  background: transparent;
  color: #d1bc8c;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.carivium-gate-close:hover {
  border-color: #ffd36b;
  color: #fff3cf;
}

.carivium-gate-kicker {
  margin: 0 0 0.35rem;
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #79b8a1;
}
.carivium-gate-title {
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #ffd36b;
}
.carivium-gate-sub {
  margin: 0 0 1.35rem;
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.84rem;
  line-height: 1.5;
  color: rgba(248, 229, 176, 0.72);
}

/* Mode switcher (Log In / Create Account) */
.carivium-gate-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.25rem;
  margin-bottom: 1.15rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 211, 107, 0.16);
}
.carivium-gate-tab {
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(248, 229, 176, 0.68);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.carivium-gate-tab.is-active {
  background: rgba(255, 211, 107, 0.16);
  color: #ffe8a8;
  font-weight: 600;
}

/* Google OAuth button */
.carivium-oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.74rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 211, 107, 0.34);
  background: rgba(255, 255, 255, 0.045);
  color: #fff3cf;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.carivium-oauth-btn:hover {
  background: rgba(255, 211, 107, 0.12);
  border-color: #ffd36b;
  transform: translateY(-1px);
}
.carivium-oauth-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.carivium-gate-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.05rem 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(248, 229, 176, 0.45);
}
.carivium-gate-divider::before,
.carivium-gate-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 211, 107, 0.16);
}

.carivium-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.carivium-gate-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.carivium-gate-field[hidden] {
  display: none;
}
.carivium-gate-field label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(248, 229, 176, 0.75);
}
.carivium-gate-field input {
  width: 100%;
  padding: 0.68rem 0.8rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 211, 107, 0.28);
  background: rgba(5, 7, 4, 0.82);
  color: #fff6dc;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.carivium-gate-field input:focus {
  outline: none;
  border-color: #ffd36b;
  box-shadow: 0 0 0 3px rgba(255, 211, 107, 0.14);
}

.carivium-gate-submit {
  margin-top: 0.25rem;
  width: 100%;
  padding: 0.76rem 1rem;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(155deg, #ffe294, #cfa349);
  color: #090b06;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}
.carivium-gate-submit:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}
.carivium-gate-submit:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.carivium-gate-msg {
  min-height: 1.2em;
  margin: 0.65rem 0 0;
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #9be0ca;
}
.carivium-gate-msg.is-error {
  color: #f3a6b0;
}

.carivium-gate-foot {
  margin-top: 1.15rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 211, 107, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.74rem;
  color: rgba(248, 229, 176, 0.58);
}
.carivium-gate-foot a {
  color: #efd69a;
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 211, 107, 0.3);
  padding-bottom: 1px;
}
.carivium-gate-foot a:hover {
  color: #fff3cf;
  border-color: #ffd36b;
}

.carivium-dev-bypass {
  margin-top: 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px dashed rgba(121, 184, 161, 0.42);
  background: rgba(47, 111, 94, 0.12);
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.74rem;
  color: #b7e6d5;
}
.carivium-dev-bypass button {
  margin-top: 0.45rem;
  background: transparent;
  color: #ffe294;
  border: 1px solid rgba(255, 211, 107, 0.4);
  border-radius: 5px;
  padding: 0.34rem 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.carivium-dev-bypass button:hover {
  background: rgba(255, 211, 107, 0.14);
}

/* Small global signed-in bar on index.html */
.carivium-account-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(239, 214, 154, 0.72);
}
.carivium-account-bar a,
.carivium-account-bar button {
  background: none;
  border: 0;
  padding: 0.2rem 0.15rem;
  color: #efd69a;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  border-bottom: 1px solid rgba(211, 168, 77, 0.35);
  cursor: pointer;
}
.carivium-account-bar a:hover,
.carivium-account-bar button:hover {
  color: #fff3cf;
  border-color: #ffd36b;
}

@keyframes cariviumFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
