/* =========================================================
   朝夕 · 云端模式样式
   只在 config.js 填了 Supabase 配置时才会用到登录门
   ========================================================= */

/* 兜底：遮罩只有真正打开时才接收点击，
   避免残留的透明遮罩把整页的点击都吃掉 */
.modal-backdrop:not(.is-open) {
  pointer-events: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 620px at 18% 8%, rgba(184, 95, 101, 0.14), transparent 62%),
    radial-gradient(900px 560px at 86% 92%, rgba(185, 139, 85, 0.16), transparent 60%),
    var(--paper);
  overflow-y: auto;
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  padding: 34px 32px 30px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  animation: auth-rise 0.5s var(--ease-spring) both;
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card .eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.auth-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-deep);
}

.auth-subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 15px;
}

.auth-field label {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(184, 95, 101, 0.14);
}

.auth-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--rose-wash);
  color: #985b52;
  font-size: 13px;
  line-height: 1.6;
}

.auth-error[hidden] {
  display: none;
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.auth-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.auth-footnote {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-faint);
  text-align: center;
}

/* 设置弹窗里的同步状态 */
.cloud-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cloud-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
  font-size: 13px;
  color: var(--ink-soft);
}

.cloud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
}

.cloud-dot.is-ok {
  background: var(--sage);
}

.cloud-dot.is-busy {
  background: var(--gold);
}

.cloud-dot.is-error {
  background: var(--rose-deep);
}

.cloud-status strong {
  color: var(--ink);
  font-weight: 600;
}

.cloud-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cloud-actions .data-button {
  flex: 1 1 160px;
}

@media (max-width: 520px) {
  .auth-card {
    padding: 28px 22px 24px;
    border-radius: 22px;
  }

  .auth-title {
    font-size: 25px;
  }
}
