@charset "UTF-8";

/* Shared cloud UI: account entry, login card, protected-page gate, forms. */
.site-auth {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  width: 128px;
  min-height: 44px;
}

/* Reserve the same slot while restoring auth; never flash a login button. */
.auth-placeholder {
  display: block;
  width: 100%;
  height: 44px;
  border: 1px solid #E2DCD9;
  border-radius: 15px;
  background: #EDE8E5;
}

.auth-login-button,
.auth-logout {
  border: 0;
  font-family: var(--sans);
  cursor: pointer;
}

.auth-login-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1.5px solid #E2CAD8;
  border-radius: 16px;
  background: #FFF5F3;
  color: var(--ink);
  font-size: 16px;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.auth-login-button:hover,
.auth-login-button:focus-visible {
  transform: translateY(-1px);
  background: var(--garden-pale);
  box-shadow: 0 5px 14px #B2939117;
}

.auth-key svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: var(--garden-icon-line);
}

.auth-user {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}

.auth-login-button,
.auth-user {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  justify-content: center;
}

.auth-placeholder {
  box-sizing: border-box;
}

.auth-user img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.auth-user-hua {
  background: #F7F2FC;
}

.auth-user-yue {
  background: #FFF8E9;
}

.auth-user-name {
  font-size: 17px;
  line-height: 1;
}

.auth-logout {
  padding: 5px 7px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
}

.auth-logout:hover,
.auth-logout:focus-visible {
  background: var(--garden-pale);
  color: var(--ink);
}

.login-dialog {
  width: min(430px, calc(100% - 30px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #E8D7CF;
  border-radius: 26px;
  background: #FFFBF5;
  color: var(--ink);
  box-shadow: 0 24px 70px #614B4930;
}

.login-dialog::backdrop {
  background: #6A57553B;
  backdrop-filter: blur(4px);
}

.login-card {
  padding: 27px 27px 24px;
  background:
    radial-gradient(circle at 92% 8%, #D1BFE52B, transparent 32%),
    radial-gradient(circle at 5% 100%, #F0ADAE1C, transparent 33%),
    #FFFBF5;
}

.login-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-kicker {
  color: var(--text-soft);
  font-family: var(--garden-ui);
  font-size: 10px;
  letter-spacing: .16em;
}

.login-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 20px;
  line-height: 1;
}

.login-card h2 {
  margin: 12px 0 4px;
  font-size: 30px;
  letter-spacing: .04em;
}

.login-intro,
.login-footnote {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}

.login-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 14px;
}

.login-field input,
.login-field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 17px;
}

.login-field input:focus,
.login-field select:focus {
  border-color: #C7B4D8;
  outline: 3px solid #D1BFE52E;
}

.login-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.login-status.is-error {
  color: #AD5F68;
}

.login-submit {
  width: 100%;
  min-height: 46px;
}

.login-footnote {
  margin-top: 13px;
  text-align: center;
  font-size: 12px;
}

/* Protected-page gate */
.protected-page[hidden],
.cloud-gate[hidden] {
  display: none;
}

.cloud-gate {
  display: grid;
  min-height: 0;
  place-items: center;
  padding-block: 16px 24px;
}

.cloud-gate-card {
  position: relative;
  width: min(640px, 100%);
  padding: 28px 36px 22px;
  border: 1.5px solid var(--cottage-stroke);
  border-radius: 34px 28px 36px 26px;
  background: url("./assets/cottage/botanical-guestbook-paper.webp") center / cover, var(--surface);
  box-shadow: var(--cottage-shadow);
  text-align: center;
}

.cloud-gate-card::before,
.cloud-gate-card::after {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1px solid #DCCCE8;
  border-radius: 50%;
  content: "";
}

.cloud-gate-card::before {
  top: 18px;
  left: 20px;
}

.cloud-gate-card::after {
  right: 20px;
  bottom: 18px;
}

.cloud-gate-cat {
  display: block;
  width: 220px;
  max-width: 70%;
  height: auto;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 9px #B2939117);
}

.cloud-gate h1 {
  margin: 4px 0 7px;
  font-size: clamp(25px, 3vw, 34px);
}

.cloud-gate p {
  margin: 0 auto 18px;
  max-width: 390px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.9;
}

.cloud-gate .eyebrow { justify-content: center; }

.cloud-gate .button {
  min-height: 44px;
}

.cloud-gate-note {
  margin-top: 14px !important;
  font-size: 12px !important;
}

/* Shared page structure and forms */
.cloud-page {
  padding-bottom: 40px;
}

.cloud-page-heading {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 178px;
  margin-bottom: 26px;
  padding: 26px 28px;
  border: 1.5px solid var(--line);
  border-radius: 28px 24px 30px 22px;
  background: var(--page-tint, #F5EDF8);
  box-shadow: var(--cottage-shadow);
}

.cloud-page-heading::before {
  position: absolute;
  z-index: -1;
  inset: 7px;
  border: 1px dashed #CDB6D066;
  border-radius: 22px 18px 24px 16px;
  content: "";
}

.cloud-page-heading::after {
  position: absolute;
  z-index: -1;
  right: 22px;
  top: 12px;
  width: 162px;
  height: calc(100% - 24px);
  background: var(--page-art, url("./assets/cottage/art-letter.svg")) center / contain no-repeat;
  content: "";
  opacity: .85;
}

.cloud-page-heading > :last-child {
  margin-right: 162px;
}

.cloud-page-heading > :only-child {
  margin-right: 150px;
}

.cloud-page-heading h1 {
  margin: 4px 0 7px;
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: .035em;
}

.cloud-page-heading p {
  max-width: 550px;
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.8;
}

.cloud-page-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.cloud-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cloud-select,
.cloud-input,
.cloud-textarea {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
}

.cloud-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.8;
}

.cloud-input:focus,
.cloud-select:focus,
.cloud-textarea:focus {
  border-color: #C7B4D8;
  outline: 3px solid #D1BFE52E;
}

.cloud-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1.5px solid #D5A9B8;
  border-radius: 15px 14px 16px 13px;
  background: #F5CED4;
  box-shadow: 0 3px 0 #D5A9B829;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  cursor: pointer;
}

.cloud-button:hover,
.cloud-button:focus-visible {
  background: #EDA0A7;
}

.cloud-button.secondary {
  border-color: #DAC8E3;
  background: #FAF5FD;
}

.cloud-button.secondary:hover {
  background: var(--garden-pale);
}

.cloud-button.danger {
  border-color: #E3B8B6;
  background: #FCE6E3;
  color: #975B62;
}

.cloud-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.cloud-icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
}

.cloud-icon-button:hover {
  background: var(--garden-pale);
  color: var(--ink);
}

.cloud-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 6px 22px #B2939110;
}

.cloud-empty {
  display: grid;
  min-height: 200px;
  place-items: center;
  padding: 30px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.9;
  text-align: center;
}

.cloud-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100% - 30px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #E8D7CF;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px #614B4930;
}

.cloud-dialog::backdrop {
  background: #6A57533D;
  backdrop-filter: blur(4px);
}

.cloud-dialog form,
.cloud-dialog .dialog-body {
  display: grid;
  gap: 15px;
  padding: 25px;
}

.cloud-dialog h2 {
  margin: 0;
  font-size: 27px;
}

.cloud-dialog p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.75;
}

.cloud-field {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 14px;
}

.cloud-field > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cloud-field output {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.cloud-field input,
.cloud-field textarea,
.cloud-field select {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FFFBF5;
  color: var(--ink);
  font-size: 16px;
}

.cloud-field textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.8;
}

.cloud-field input[type="file"] {
  padding: 9px;
  font-size: 14px;
}

.cloud-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 5px;
}

.cloud-dialog-status {
  min-height: 22px;
  margin-right: auto;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.cloud-dialog-status.is-error {
  color: #AD5F68;
}

.cloud-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.cloud-dialog {
  position: relative;
}

.cloud-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.cloud-media-grid img,
.cloud-media-grid video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FBF5EF;
  object-fit: cover;
}

.cloud-hidden {
  display: none !important;
}

/* Global broadcast strip pinned under the sticky header on every page. */
.global-broadcast {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 38px;
  padding: 5px 20px;
  border-top: 1px dashed #E6D6DF;
  background: #FAF1F2;
  color: var(--ink);
  font-size: 15px;
  text-align: center;
}

.global-broadcast-label {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  padding-right: 4px;
  color: var(--text-soft);
  font-family: var(--garden-ui);
  font-size: 12px;
  letter-spacing: .12em;
}

.global-broadcast-label img {
  display: block;
  width: 20px;
  height: 20px;
}

.global-broadcast p {
  margin: 0;
  max-width: 650px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.global-broadcast.has-live-message {
  border-top-color: #F0C9C2;
  background: #FFF0E5;
}

.global-broadcast p.is-live {
  color: var(--ink);
  animation: broadcast-live-in 240ms ease-out both;
}

@keyframes broadcast-live-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

/* Shared confirmation dialog: the page stays visible behind a blur. */
.huayue-confirm {
  width: min(420px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 1px solid #E8D7CF;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 55px #4A383641;
}

.huayue-confirm::backdrop {
  background: #FFFBF566;
  backdrop-filter: blur(5px);
}

.huayue-confirm-card {
  padding: 24px 24px 20px;
}

.huayue-confirm-card h2 {
  margin: 0 0 7px;
  font-size: 26px;
  letter-spacing: .04em;
}

.huayue-confirm-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.8;
}

.huayue-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

/* Sticky footer: keep the footer at the viewport bottom on short pages. */
body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.garden-page-frame {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}

.garden-page-frame > main {
  flex: 1 0 auto;
}

.site-footer {
  margin-top: auto;
}

/* Menu tabs hug the right edge next to the account chip. */
.site-header .header-inner {
  justify-content: flex-start;
}

.site-header .nav-list {
  margin-left: auto;
}

.guest-note-delete {
  position: absolute;
  z-index: 3;
  top: 5px;
  right: 6px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  padding: 0;
  border: 1px solid #E2CFC4;
  border-radius: 50%;
  background: #FFFEFCE8;
  color: #A57D75;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.guest-note-delete:hover {
  background: #FCE6E3;
  color: #8F5F65;
}

.huayue-calendar .occasion-form.is-locked {
  opacity: .62;
}

.huayue-calendar .occasion-form.is-locked input,
.huayue-calendar .occasion-form.is-locked button {
  cursor: not-allowed;
}

@media (max-width: 1000px) {
  .site-auth {
    width: 120px;
  }

  .auth-login-button {
    padding-inline: 10px;
    font-size: 14px;
  }

  .auth-logout {
    font-size: 11px;
  }
}

@media (max-width: 900px) {
  .site-header .nav-list {
    margin-left: 0;
  }

  .site-auth {
    align-self: center;
  }

  .cloud-page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
  }

  .cloud-page-heading > :last-child,
  .cloud-page-heading > :only-child {
    margin-right: 130px;
  }

  .cloud-page-heading::after {
    right: 8px;
    width: 140px;
  }

  .global-broadcast {
    gap: 10px;
    padding-inline: 20px;
  }

  .cloud-page-heading-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .nav-link {
    min-height: 61px;
    justify-content: center;
    font-size: 12px;
  }

  .nav-link > span {
    text-align: center;
    line-height: 1.25;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .site-auth {
    width: 110px;
    min-height: 44px;
  }

  .auth-placeholder {
    height: 38px;
  }

  .auth-user {
    height: 38px;
    min-height: 38px;
    padding: 4px 6px 4px 8px;
  }

  .auth-user img {
    width: 20px;
    height: 20px;
  }

  .auth-user-name {
    font-size: 15px;
  }

  .login-card {
    padding: 22px 18px 20px;
  }

  .login-card h2 {
    font-size: 26px;
  }

  .cloud-gate-card {
    padding: 20px 16px;
  }

  .global-broadcast {
    padding: 5px 16px;
    text-align: left;
  }

  .global-broadcast-label {
    gap: 0;
    padding: 0;
    font-size: 0;
  }

  .cloud-page-heading {
    margin-bottom: 20px;
    min-height: 164px;
    padding: 20px;
  }

  .cloud-page-heading > :last-child,
  .cloud-page-heading > :only-child {
    margin-right: 0;
  }

  .cloud-page-heading p {
    max-width: 88%;
    font-size: 15px;
  }

  .cloud-page-heading h1 {
    font-size: 32px;
  }

  .cloud-page-heading::after {
    top: auto;
    right: 0;
    bottom: 0;
    width: 120px;
    height: 125px;
    opacity: .19;
    border-radius: 23px;
  }

  .cloud-gate-cat {
    width: 175px;
  }

  .cloud-dialog form,
  .cloud-dialog .dialog-body {
    padding: 21px 17px;
  }

  .cloud-page-heading {
    padding-block: 25px 18px;
  }
}
