/* ============================================================
   Karteo — shared login modal + header auth controls
   ============================================================ */

/* The hidden attribute must win over flex/grid/inline-flex display rules
   (auth controls and dashboard states are toggled via [hidden]). */
[hidden] { display: none !important; }

.kauth {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.kauth[hidden] { display: none; }

.kauth-bg {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(6px);
}

.kauth-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--paper, #EFE9DD);
  color: var(--ink, #0E0E10);
  border-radius: 18px;
  padding: 30px 28px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: kauth-in 0.22s ease;
}
@keyframes kauth-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.kauth-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(14, 14, 16, 0.5);
  cursor: pointer;
  border-radius: 8px;
}
.kauth-x:hover { background: rgba(14, 14, 16, 0.07); color: var(--ink, #0E0E10); }

.kauth-mark { margin-bottom: 14px; }

.kauth-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.kauth-sub {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(14, 14, 16, 0.62);
  margin: 0 0 20px;
}

.kauth-field { display: block; margin-bottom: 14px; }
.kauth-k {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(14, 14, 16, 0.55);
  margin-bottom: 7px;
}
.kauth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink, #0E0E10);
  background: #fff;
  border: 1px solid rgba(14, 14, 16, 0.16);
  border-radius: 11px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kauth-field input:focus {
  border-color: var(--ink, #0E0E10);
  box-shadow: 0 0 0 3px rgba(14, 14, 16, 0.08);
}
.kauth-code {
  letter-spacing: 0.4em;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
  font-size: 22px !important;
}

.kauth .btn-block { margin-top: 2px; }

.kauth-change {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: rgba(14, 14, 16, 0.6);
  cursor: pointer;
}
.kauth-change:hover { color: var(--ink, #0E0E10); }

.kauth-msg {
  min-height: 18px;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.kauth-msg.is-err { color: #C0392B; }
.kauth-msg.is-ok { color: #1E7A46; }

/* ---- shared outline button (dark surfaces) ---- */
.btn-outline {
  background: transparent;
  color: var(--paper, #EFE9DD);
  border: 1px solid var(--ink-line, rgba(239, 233, 221, 0.12));
}
.btn-outline:hover { border-color: var(--paper, #EFE9DD); }

/* ---- header account control (dark nav) ---- */
.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-account-email {
  font-size: 13px;
  color: var(--paper, #EFE9DD);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-signout {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: rgba(239, 233, 221, 0.6);
  cursor: pointer;
  padding: 4px 6px;
}
.nav-signout:hover { color: var(--paper, #EFE9DD); }
