:root {
  --brand-navy: #22395C;
  --brand-ivory: #F7F5EE;
  --background: #14243D;
  --surface: #1B2F4D;
  --surface-muted: #22395C;
  --surface-subtle: #2D456B;
  --text-primary: #FFFDF8;
  --text-secondary: #76899d;
  --text-muted: #76899d;
  --text-inverse: #172033;
  --border-subtle: rgba(195, 187, 175, 0.20);
  --border-default: rgba(195, 187, 175, 0.32);
  --border-strong: rgba(230, 210, 163, 0.58);
  --primary: #E6D2A3;
  --primary-hover: #B89455;
  --primary-active: #7A4A22;
  --primary-soft: rgba(230, 210, 163, 0.13);
  --accent: #E6D2A3;
  --accent-hover: #B89455;
  --accent-soft: rgba(230, 210, 163, 0.13);
  --accent-border: rgba(230, 210, 163, 0.48);
  --card: #1B2F4D;
  --card-muted: #22395C;
  --card-border: rgba(195, 187, 175, 0.22);
  --focus-ring: rgba(230, 210, 163, 0.32);
  --error-background: #4C0519;
  --error-border: #9F1239;
  --error-title: #FFF1F2;
  --error-text: #FECDD3;
  --error-icon: #FDA4AF;
  --bg: var(--background);
  --surface1: var(--surface);
  --surface2: var(--surface-muted);
  --surface3: var(--surface-subtle);
  --border: var(--border-subtle);
  --border-visible: var(--border-strong);
  --text1: var(--text-primary);
  --text2: var(--text-secondary);
  --text3: var(--text-muted);
  --text4: #6E7AA0;
  --gold: var(--accent);
  --gold-subtle: var(--accent-soft);
  --navy: #14243D;
  --navy-panel: var(--surface);
  --navy-soft: var(--surface-muted);
  --cream: var(--text-primary);
  --font-display: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --font-body: "Inter", "Noto Sans TC", system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-card: 18px;
  --radius-cards: 18px;
  --radius-control: 12px;
  --radius-inputs: 10px;
  --radius-modals: 28px;
  --shadow-1: 0 16px 44px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 28px 76px rgba(0, 0, 0, 0.36);
  --shadow-3: 0 40px 100px rgba(0, 0, 0, 0.46);
  --shadow-accent: 0 0 0 4px var(--focus-ring);
  --ease: 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
      linear-gradient(90deg,
        rgba(38, 30, 22, 0.90) 0%,
        rgba(57, 45, 33, 0.82) 30%,
        rgba(83, 66, 48, 0.62) 54%,
        rgba(132, 108, 80, 0.34) 78%,
        rgba(177, 149, 111, 0.22) 100%),
      linear-gradient(180deg,
        rgba(35, 28, 20, 0.38) 0%,
        rgba(103, 82, 60, 0.12) 46%,
        rgba(36, 28, 19, 0.54) 100%),
      url("../img/v1-bg-living-room.webp") center center / cover no-repeat #241d15;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.72;
  letter-spacing: 0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

[class^="mynaui-"],
[class*=" mynaui-"] {
  color: currentColor;
  font-size: inherit;
  line-height: 1;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.logo img {
  display: block;
  width: 154px;
  max-width: 100%;
  height: auto;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill, 999px);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.logo-text {
  color: rgba(255, 253, 248, 0.84);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.back-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 10px;
  border: 1px solid rgba(255, 253, 248, 0.82);
  border-radius: var(--radius-control);
  background: transparent;
  color: #FFFDF8;
  font-size: 13px;
  font-weight: 700;
  transition: border-color var(--ease), background var(--ease), color var(--ease), transform var(--ease);
}

.back-link::before {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3Cpath d='M19 12H5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3Cpath d='M19 12H5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.back-link:hover {
  border-color: #FFFDF8;
  background: rgba(255, 253, 248, 0.12);
  color: #FFFDF8;
  transform: translateY(-1px);
}

.login-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 96px 24px 64px;
}

.login-shell {
  width: min(1160px, 100%);
  min-height: 610px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #f8fcff1c;
  border-radius: var(--radius-modals);
  background: transparent;
  box-shadow: var(--shadow-3);
}

.login-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 5vw, 64px);
  background: linear-gradient(135deg, #2a50824d, rgba(20, 36, 61, 0) 38%), #14243D;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 54px;
}

.brand-lockup img {
  display: block;
  width: 188px;
  max-width: 100%;
  height: auto;
}

.brand-seal {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill, 999px);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.brand-name {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
}

.brand-caption {
  margin-top: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card-title {
  max-width: 420px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.card-sub {
  max-width: 390px;
  margin: 18px 0 34px;
  color: #76899d;
  font-size: 15px;
  line-height: 1.78;
}

.form-box {
  width: 100%;
  max-width: 430px;
}

.error-msg {
  position: relative;
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px 14px 13px 16px;
  border: 1px solid var(--error-border);
  border-left: 4px solid var(--error-icon);
  border-radius: var(--radius-lg);
  background: var(--error-background);
  color: var(--error-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.error-msg.show {
  display: none;
}

.error-msg::before {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill, 999px);
  content: "!";
  font-size: 12px;
  font-weight: 800;
}

.fg {
  margin-bottom: 20px;
}

.fg label {
  display: block;
  margin-bottom: 8px;
  color: #c7d8e9;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.input-shell {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid rgba(195, 187, 175, 0.24);
  border-radius: var(--radius-inputs);
  background: rgba(34, 57, 92, 0.70);
  color: #c7d8e9;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}

.input-shell:hover {
  border-color: rgba(230, 210, 163, 0.48);
}

.input-shell:focus-within {
  border-color: #c7d8e9;
  background: rgba(34, 57, 92, 0.86);
  box-shadow: 0 0 0 4px rgba(199, 216, 233, 0.28);
}

.input-shell i {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.input-shell .mynaui-mail,
.input-shell .mynaui-lock-keyhole {
  background: transparent;
}

.input-shell .mynaui-mail::before,
.input-shell .mynaui-lock-keyhole::before {
  width: 18px;
  height: 18px;
  display: block;
  content: "";
}

.input-shell .mynaui-mail::before {
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.input-shell .mynaui-lock-keyhole::before {
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3Ccircle cx='12' cy='16' r='1'/%3E%3Cpath d='M12 17v1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3Ccircle cx='12' cy='16' r='1'/%3E%3Cpath d='M12 17v1.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fg input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.35;
}

.fg input::placeholder {
  color: #76899d;
  opacity: 1;
}

.fg input.invalid {
  color: var(--error-text);
}

.input-shell:has(input.invalid) {
  border-color: #e11d48;
  background: #e11d481c;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.16);
}

.input-shell:has(input.invalid) i {
  color: #e11d48;
}

.btn-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--radius-control);
  background: #B89455;
  color: #14243D;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.20);
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), opacity var(--ease);
}

.btn-submit:hover {
  background: #c39d5b;
  color: #FFFDF8;
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.26);
}

.btn-submit:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.helper-text {
  margin-top: 20px;
  color: #76899d;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.login-visual {
  position: relative;
  min-width: 0;
  min-height: 610px;
  background: url("../img/v1-bg-living-room.webp") left 20% center / cover no-repeat #241d15;
}

.login-visual::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.10);
  content: "";
}

.login-visual::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: var(--card-border);
  content: "";
}

.visual-copy {
  display: none;
  position: absolute;
  right: 32px;
  bottom: 30px;
  left: 32px;
  z-index: 1;
  max-width: 430px;
  margin-left: auto;
  padding: 20px 22px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-cards);
  background: rgba(20, 36, 61, 0.88);
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
}

.visual-copy span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.visual-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: 0.01em;
}

footer {
  position: relative;
  z-index: 2;
  padding: 0 0 20px;
  color: #FFFDF8;
  font-size: 12px;
  text-align: center;
}

#toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 500;
  width: 340px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-lg);
  background: #FFFDF8;
  box-shadow: 0 22px 60px rgba(34, 57, 92, 0.14);
  color: #172033;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateX(24px);
}

#toast i {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-grid;
  place-items: center;
  margin-top: 2px;
  color: #22395C;
  font-size: 20px;
  line-height: 1;
}

#toast i::before {
  width: 20px;
  height: 20px;
  display: block;
  background: currentColor;
  content: "";
}

#toast .mynaui-check-circle::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 2.5 2.5L16 9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 2.5 2.5L16 9'/%3E%3C/svg%3E") center / contain no-repeat;
}

#toast .mynaui-danger-circle::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

#toast.toast-warning i {
  color: #D97706;
}

#toast .toast-copy {
  min-width: 0;
}

#toast h4 {
  margin: 0;
  color: #172033;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

#toast p {
  margin: 2px 0 0;
  color: #4F5663;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

#toast.show {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .login-panel {
    padding: 42px 34px;
  }

  .brand-lockup {
    margin-bottom: 36px;
  }

  .login-visual {
    min-height: 240px;
    order: -1;
  }

  .visual-copy {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 64px;
    padding: 0 16px;
  }

  .logo img {
    width: 132px;
  }

  .back-link {
    min-height: 36px;
    padding: 0 12px 0 9px;
    font-size: 12px;
  }

  .login-stage {
    padding: 82px 14px 36px;
  }

  .login-shell {
    min-height: 0;
    border-radius: 22px;
  }

  .login-panel {
    padding: 34px 22px 28px;
  }

  .brand-lockup {
    margin-bottom: 30px;
  }

  .brand-lockup img {
    width: 164px;
  }

  .card-title {
    font-size: 38px;
  }

  .card-sub {
    margin-bottom: 26px;
    font-size: 14px;
  }

  .login-visual {
    min-height: 180px;
  }

  footer {
    padding-bottom: 14px;
  }

  #toast {
    right: 14px;
    bottom: 18px;
    width: calc(100vw - 28px);
  }
}
