/* Homepage-only cloud account entry and modal. */
.cloud-modal,
.cloud-modal * {
  box-sizing: border-box;
}

.home-cloud-dock {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 900;
}

.cloud-account-button {
  min-height: 44px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  color: #475569;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(30, 41, 59, 0.14);
  backdrop-filter: blur(12px);
  font:
    800 13px/1 "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.cloud-account-button:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 185, 163, 0.36);
  box-shadow: 0 16px 34px rgba(30, 41, 59, 0.17);
}

.cloud-account-button.is-authenticated {
  color: #0f766e;
}
.cloud-account-button small {
  font-size: 10px;
  opacity: 0.68;
}
.cloud-account-icon {
  color: #1fa58f;
  font-size: 15px;
}

.cloud-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(8px);
  animation: cloudFadeIn 0.18s ease both;
}

.cloud-modal-panel {
  width: min(430px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  animation: cloudPanelIn 0.24s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.cloud-modal-head {
  padding: 22px 22px 16px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf1f5;
  background: linear-gradient(
    135deg,
    rgba(237, 127, 155, 0.09),
    rgba(45, 185, 163, 0.1)
  );
}

.cloud-modal-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #ed7f9b, #2db9a3);
  box-shadow: 0 10px 22px rgba(45, 185, 163, 0.2);
  font-size: 19px;
}

.cloud-modal-head small {
  display: block;
  margin-bottom: 2px;
  color: #1b8f80;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.cloud-modal-head h2 {
  margin: 0;
  color: #1f2937;
  font-size: 1.28rem;
  line-height: 1.2;
}

.cloud-modal-close {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid #e5eaf0;
  border-radius: 11px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.84);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cloud-modal-close:hover {
  color: #be445f;
  background: #fff3f6;
}
.cloud-modal-body {
  padding: 20px 22px 24px;
}

.cloud-login-form {
  display: grid;
  gap: 14px;
}

.cloud-login-lead {
  margin: 0 0 2px;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.65;
}

.cloud-field {
  display: grid;
  gap: 7px;
}

.cloud-field > span {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
}

.cloud-field input {
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #d9e1ea;
  border-radius: 14px;
  color: #1f2937;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
  font:
    500 15px/1 "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.cloud-field input:focus {
  border-color: rgba(45, 185, 163, 0.78);
  box-shadow: 0 0 0 4px rgba(45, 185, 163, 0.12);
}

.cloud-field input::placeholder {
  color: #a0aaba;
}

.cloud-primary-button,
.cloud-account-actions button {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: #179d8b;
  box-shadow: 0 10px 22px rgba(23, 157, 139, 0.2);
  font:
    900 14px/1 "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  cursor: pointer;
}

.cloud-primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.cloud-form-error {
  margin: -2px 0 0;
  padding: 9px 11px;
  border: 1px solid #ffd3dc;
  border-radius: 10px;
  color: #b4233d;
  background: #fff2f5;
  font-size: 12px;
}

.cloud-form-note {
  margin: 0;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  border-radius: 12px;
  color: #64748b;
  background: #f6faf9;
  font-size: 12px;
  line-height: 1.55;
}

.cloud-form-note > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2db9a3;
  font-weight: 900;
}

.cloud-form-note p {
  margin: 1px 0 0;
}

.cloud-account-summary {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.cloud-big-icon {
  font-size: 34px;
}
.cloud-account-summary p {
  margin: 0 0 8px;
  color: #64748b;
}

.cloud-data-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cloud-data-grid span {
  padding: 11px 6px;
  display: grid;
  gap: 2px;
  border: 1px solid #e6ebf1;
  border-radius: 12px;
  color: #0f766e;
  background: #f8fbfb;
  font-weight: 900;
}

.cloud-data-grid small {
  color: #7b8795;
  font-weight: 700;
}
.cloud-account-actions {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}
.cloud-account-actions button {
  color: #475569;
  border: 1px solid #dce3eb;
  background: #fff;
  box-shadow: none;
}
.cloud-account-actions .danger {
  color: #ad2942;
  border-color: #ffd3dc;
  background: #fff3f6;
}

.cloud-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; background: #f2f6f7; border-radius: 12px; }
.cloud-auth-tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: #64748b; font-weight: 800; cursor: pointer; }
.cloud-auth-tabs button.active { color: #0f766e; background: #fff; box-shadow: 0 2px 8px #203d4410; }
.cloud-text-button { border: 0; background: transparent; color: #0f766e; padding: 8px; cursor: pointer; font-weight: 700; }
.cloud-import-choice { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 12px; }
.cloud-import-choice input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: #179d8b; }
.cloud-recovery-card { display: grid; gap: 12px; margin-bottom: 18px; color: #536875; }
.cloud-recovery-card p { margin: 0; font-size: 13px; line-height: 1.7; }
.cloud-recovery-card input { font-family: Consolas, monospace; font-size: 12px; }
.cloud-recovery-card small { font-size: 12px; }
.cloud-secondary-button { padding: 10px; border: 1px solid #dce8e6; border-radius: 10px; color: #147c6e; background: #f4faf8; cursor: pointer; font-weight: 700; }
.cloud-modal button:focus-visible { outline: 3px solid #71c7b8; outline-offset: 2px; }

@keyframes cloudFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes cloudPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 600px) {
  .home-cloud-dock {
    left: 14px;
    bottom: 14px;
  }
  .cloud-account-button {
    min-height: 40px;
    padding: 8px 11px;
  }
  .cloud-account-button small {
    display: none;
  }
  .cloud-modal {
    padding: 10px;
    align-items: end;
  }
  .cloud-modal-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 22px;
  }
  .cloud-modal-head {
    padding: 18px 16px 14px;
    grid-template-columns: 42px 1fr auto;
  }
  .cloud-modal-mark {
    width: 42px;
    height: 42px;
  }
  .cloud-modal-body {
    padding: 17px 16px 20px;
  }
  .cloud-field input,
  .cloud-primary-button {
    height: 50px;
    min-height: 50px;
    border-radius: 14px;
  }
}
