/* ============================================================
   YS FluentCart Blocksy — 登入/註冊 Popup + 帳號 mini menu + 迷你購物車
   設計語言：YS CART auth 結構 × 站台調色盤
   （優先吃 --asal-* → --theme-palette-color-N → 字面 fallback）
   ============================================================ */
.ys-fcb-overlay,
.ys-fcb-account,
.ct-header-ys-mini-cart{
  --ysfcb-navy: var(--asal-navy, var(--theme-palette-color-4, #16244A));
  --ysfcb-ink: var(--asal-ink, var(--theme-palette-color-3, #1A1C22));
  --ysfcb-muted: var(--asal-muted, #667085);
  --ysfcb-line: var(--asal-line, var(--theme-palette-color-5, #E7E9EE));
  --ysfcb-accent: var(--asal-orange, var(--theme-palette-color-1, #DB8A3E));
  --ysfcb-accent-deep: var(--asal-orange-deep, var(--theme-palette-color-2, #C5772C));
  --ysfcb-surface: var(--asal-surface, var(--theme-palette-color-8, #FFFFFF));
  --ysfcb-serif: var(--asal-serif, 'Fraunces', Georgia, serif);
  --ysfcb-sans: var(--asal-sans, 'Inter', -apple-system, sans-serif);
  font-family: var(--ysfcb-sans);
}

/* ===== Overlay + Modal ===== */
.ys-fcb-overlay{
  position: fixed; inset: 0; z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,26,51,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 20px; overflow-y: auto;
}
.ys-fcb-overlay[hidden]{ display: none; }
.ys-fcb-modal{
  position: relative;
  width: 100%; max-width: 430px;
  background: var(--ysfcb-surface);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15,26,51,.35);
  padding: clamp(1.6rem, 4vw, 2.4rem);
  margin: auto;
  animation: ys-fcb-pop .22s cubic-bezier(.23,1,.32,1);
}
@keyframes ys-fcb-pop{ from{ opacity: 0; transform: translateY(14px) scale(.97);} to{ opacity: 1; transform: none;} }
@media (prefers-reduced-motion: reduce){ .ys-fcb-modal{ animation: none; } }

.ys-fcb-close{
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--ysfcb-muted);
  transition: background-color .2s ease, color .2s ease;
}
.ys-fcb-close:hover{ background: var(--ysfcb-line); color: var(--ysfcb-ink); }

/* ===== Panels（登入/註冊切換） ===== */
.ys-fcb-panel{ display: none; }
.ys-fcb-panel.is-active{ display: block; }

.ys-fcb-title{
  font-family: var(--ysfcb-serif);
  color: var(--ysfcb-navy);
  font-size: 1.65rem; font-weight: 600; letter-spacing: -.01em;
  margin: 0 0 .25rem;
}
.ys-fcb-subtitle{ color: var(--ysfcb-muted); font-size: .95rem; margin: 0 0 1.4rem; }

/* ===== 表單（ys-cart .ys-ec-form 同款結構） ===== */
.ys-fcb-group{ margin-bottom: 1.05rem; }
.ys-fcb-group label{
  display: block; font-size: .88rem; font-weight: 600;
  color: var(--ysfcb-ink); margin-bottom: .4rem;
}
.ys-fcb-required{ color: var(--ysfcb-accent-deep); }
.ys-fcb-group input{
  width: 100%; box-sizing: border-box;
  padding: .78rem 1rem;
  border: 1px solid var(--ysfcb-line); border-radius: 10px;
  font-family: inherit; font-size: .98rem;
  background: var(--ysfcb-surface); color: var(--ysfcb-ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ys-fcb-group input:focus{
  outline: none; border-color: var(--ysfcb-accent);
  box-shadow: 0 0 0 3px rgba(219,138,62,.18);
}
.ys-fcb-group.ys-fcb-has-error input{ border-color: #d64545; }

.ys-fcb-row{
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.1rem; font-size: .88rem;
}
.ys-fcb-check{ display: inline-flex; align-items: center; gap: .45rem; color: var(--ysfcb-ink); cursor: pointer; }
.ys-fcb-check input{ accent-color: var(--ysfcb-accent); }
.ys-fcb-muted{ color: var(--ysfcb-muted); text-decoration: none; }
.ys-fcb-muted:hover{ color: var(--ysfcb-accent-deep); }

.ys-fcb-btn{
  display: block; width: 100%;
  padding: .9rem 1.4rem;
  background: var(--ysfcb-accent); color: #fff;
  border: 0; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1;
  transition: background-color .2s ease, transform .16s cubic-bezier(.23,1,.32,1);
}
.ys-fcb-btn:hover{ background: var(--ysfcb-accent-deep); }
.ys-fcb-btn:active{ transform: scale(.98); }
.ys-fcb-btn[disabled]{ opacity: .6; cursor: wait; }

.ys-fcb-alert{
  background: #fdf0ef; border: 1px solid #f3c6c2; color: #b3261e;
  border-radius: 10px; padding: .7rem 1rem;
  font-size: .9rem; margin-bottom: 1rem;
}
.ys-fcb-alert[hidden]{ display: none; }

.ys-fcb-switch{
  text-align: center; font-size: .92rem;
  color: var(--ysfcb-muted);
  margin: 1.25rem 0 0; padding-top: 1.1rem;
  border-top: 1px solid var(--ysfcb-line);
}
.ys-fcb-switch a{ color: var(--ysfcb-accent-deep); font-weight: 600; text-decoration: none; }
.ys-fcb-switch a:hover{ text-decoration: underline; }

.ys-fcb-turnstile{ margin-bottom: 1.1rem; min-height: 65px; }
.ys-fcb-turnstile:empty{ min-height: 0; margin-bottom: 0; }

/* ===== Header 帳號元件 ===== */
.ct-header-ys-account{ display: flex; align-items: center; }
.ys-fcb-open{
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.3rem;
  border: 1.5px solid var(--ysfcb-line, #E7E9EE); border-radius: 10px;
  background: transparent; color: var(--ysfcb-navy, #16244A);
  font-weight: 600; font-size: .95rem; line-height: 1;
  cursor: pointer; text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}
.ys-fcb-open:hover{ border-color: var(--ysfcb-navy, #16244A); }

.ys-fcb-account{ position: relative; }
.ys-fcb-account__toggle{
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-size: .95rem; font-weight: 600;
  color: var(--ysfcb-ink); padding: .5rem .35rem;
}
.ys-fcb-account__toggle svg{ width: 20px; height: 20px; }
.ys-fcb-account__caret{ width: 12px !important; height: 12px !important; transition: transform .2s ease; }
.ys-fcb-account.is-open .ys-fcb-account__caret{ transform: rotate(180deg); }
.ys-fcb-account__menu{
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 99999;
  min-width: 200px; margin: 0; padding: .5rem; list-style: none;
  background: var(--ysfcb-surface); border: 1px solid var(--ysfcb-line);
  border-radius: 12px; box-shadow: 0 18px 50px rgba(22,36,74,.14);
}
.ys-fcb-account__menu[hidden]{ display: none; }
.ys-fcb-account__menu a{
  display: block; padding: .6rem .8rem; border-radius: 8px;
  color: var(--ysfcb-ink); font-size: .92rem; font-weight: 500; text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.ys-fcb-account__menu a:hover{ background: var(--asal-sand, #F3F5F8); color: var(--ysfcb-accent-deep); }
.ys-fcb-account__sep{ height: 1px; margin: .4rem .3rem; background: var(--ysfcb-line); }

/* ===== Mini cart 元件外框 ===== */
.ct-header-ys-mini-cart{ display: flex; align-items: center; }

/* ===== RWD ===== */
@media (max-width: 560px){
  .ys-fcb-modal{ padding: 1.4rem 1.2rem; border-radius: 14px; }
  .ys-fcb-row{ flex-wrap: wrap; gap: .5rem; }
}
