/* Front floating toast + centered alert dialog
 * 主题覆盖变量：见 xy_front_toast.example.css
 */
:root{
  --xy-ft-toast-right:24px;
  --xy-ft-toast-bottom:28px;
  --xy-ft-toast-z:10050;
  --xy-ft-toast-ok:#2a9a7f;
  --xy-ft-toast-err:#c62828;
  --xy-ft-alert-z:100080;
  --xy-ft-alert-brand:#002E5B;
  --xy-ft-alert-accent:#FDE428;
}
.xy-ft-toast-host{
  position:fixed;
  right:var(--xy-ft-toast-right,24px);
  bottom:var(--xy-ft-toast-bottom,28px);
  left:auto;
  top:auto;
  z-index:var(--xy-ft-toast-z,10050);
  display:flex;
  flex-direction:column-reverse;
  align-items:flex-end;
  gap:10px;
  width:min(380px,calc(100vw - 32px));
  margin:0;
  padding:0;
  transform:none;
  pointer-events:none;
}
.xy-ft-toast{
  pointer-events:auto;
  display:flex;
  align-items:flex-start;
  gap:10px;
  width:100%;
  box-sizing:border-box;
  margin:0;
  padding:12px 14px 12px 12px;
  border-radius:10px;
  border:1px solid #e6e8eb;
  background:#fff;
  box-shadow:0 10px 28px rgba(26,29,33,.12),0 2px 8px rgba(26,29,33,.06);
  opacity:0;
  transform:translateY(12px) scale(.98);
  transition:opacity .28s ease,transform .28s cubic-bezier(.22,1,.36,1);
  font-size:13px;
  line-height:1.45;
  color:#1a1d21;
}
.xy-ft-toast.is-in{
  opacity:1;
  transform:translateY(0) scale(1);
}
.xy-ft-toast.is-out{
  opacity:0;
  transform:translateY(10px) scale(.98);
}
.xy-ft-toast-icon{
  flex:0 0 28px;
  width:28px;
  height:28px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
}
.xy-ft-toast.is-ok .xy-ft-toast-icon{background:linear-gradient(180deg,#3db89a 0%,var(--xy-ft-toast-ok,#2a9a7f) 100%)}
.xy-ft-toast.is-err .xy-ft-toast-icon{background:linear-gradient(180deg,#e57373 0%,var(--xy-ft-toast-err,#c62828) 100%)}
.xy-ft-toast-msg{
  flex:1 1 auto;
  min-width:0;
  margin:5px 0 0;
  font-weight:600;
  word-break:break-word;
}
.xy-ft-toast-x{
  flex:0 0 auto;
  margin:-2px -4px 0 0;
  border:0;
  background:transparent;
  color:#94a3b8;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  padding:4px 6px;
}
.xy-ft-toast-x:hover{color:#1a1d21}
.xy-ft-toast.is-ok{border-color:#b7d4c9;background:linear-gradient(180deg,#f3fbf8 0%,#fff 55%)}
.xy-ft-toast.is-err{border-color:#f0c4c0;background:linear-gradient(180deg,#fff7f6 0%,#fff 55%)}
@media (max-width:640px){
  .xy-ft-toast-host{right:12px;bottom:78px;width:calc(100vw - 24px)}
}

/* Centered form-validation alert */
.xy-ft-alert{
  position:fixed;
  inset:0;
  z-index:var(--xy-ft-alert-z,100080);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px 16px;
  box-sizing:border-box;
  opacity:0;
  visibility:hidden;
  transition:opacity .22s ease,visibility .22s ease;
}
.xy-ft-alert.is-open{
  opacity:1;
  visibility:visible;
}
.xy-ft-alert-mask{
  position:absolute;
  inset:0;
  background:rgba(0,46,91,.55);
  backdrop-filter:blur(2px);
}
.xy-ft-alert-card{
  position:relative;
  z-index:1;
  width:100%;
  max-width:380px;
  background:#fff;
  border-radius:6px;
  overflow:hidden;
  box-shadow:0 24px 64px rgba(0,46,91,.35);
  transform:translateY(14px) scale(.96);
  transition:transform .28s cubic-bezier(.22,1,.36,1);
  font-family:Arial,Helvetica,sans-serif;
  text-align:center;
}
.xy-ft-alert.is-open .xy-ft-alert-card{
  transform:none;
}
.xy-ft-alert-bar{
  height:6px;
  background:linear-gradient(90deg,var(--xy-ft-alert-brand,#002E5B),#01407a 60%,var(--xy-ft-alert-accent,#FDE428));
}
.xy-ft-alert-body{
  padding:28px 24px 22px;
}
.xy-ft-alert-icon{
  width:56px;
  height:56px;
  margin:0 auto 16px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(198,40,40,.1);
  color:#c62828;
}
.xy-ft-alert-icon svg{display:block}
.xy-ft-alert-title{
  margin:0 0 8px;
  font-size:18px;
  font-weight:700;
  color:var(--xy-ft-alert-brand,#002E5B);
  letter-spacing:.02em;
}
.xy-ft-alert-msg{
  margin:0;
  font-size:15px;
  line-height:1.55;
  color:#3a4a5a;
  word-break:break-word;
}
.xy-ft-alert-actions{
  padding:0 24px 24px;
}
.xy-ft-alert-ok{
  display:block;
  width:100%;
  height:44px;
  border:0;
  border-radius:4px;
  background:var(--xy-ft-alert-brand,#002E5B);
  color:#fff;
  font-size:15px;
  font-weight:700;
  letter-spacing:.04em;
  cursor:pointer;
  transition:background .2s,transform .15s;
}
.xy-ft-alert-ok:hover{background:#01407a}
.xy-ft-alert-ok:active{transform:scale(.98)}
body.xy-ft-alert-open{overflow:hidden}

/* Server flash → toast: hide after bubbled */
.xy-buy-now-flash.is-toasted,
.xy-checkout-toast.is-toasted,
[data-xy-front-flash].is-toasted,
.xy-ft-flash-src{
  display:none!important;
}
