/*****************************************************************************
 * Frontend styling on top of the themed Bootstrap build.
 *
 * Palette comes from the 2026 key visual — see _variables.scss. The look is
 * "fluid glass": translucent panels over a slowly drifting navy aurora, with
 * a cyan accent lifted from the countdown in the banner.
 *****************************************************************************/

:root {
  --aae-navy-deep: #071f3d;
  --aae-navy: #084884;
  --aae-blue: #1668bd;
  --aae-cyan: #14aec9;
  --aae-cyan-bright: #5fdcf2;

  --aae-glass-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.035));
  --aae-glass-border: rgba(255, 255, 255, 0.16);
  --aae-glass-blur: blur(20px) saturate(150%);
  --aae-glass-shadow:
    0 18px 40px -18px rgba(2, 12, 26, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

[v-cloak] {
  display: none;
}

.text-muted {
  color: #9fb6d1 !important;
}

:target {
  scroll-margin-top: 6rem;
}
@media (min-width: 768px) {
  :target {
    scroll-margin-top: 4rem;
  }
}

html {
  scroll-behavior: smooth;
}

/*****************************************************************************
 * Page background
 *****************************************************************************/

body {
  min-height: 100vh;
  background-color: var(--aae-navy-deep);
  background-image:
    radial-gradient(60rem 40rem at 12% -12%, rgba(22, 104, 189, 0.55), transparent 62%),
    radial-gradient(45rem 32rem at 92% 4%, rgba(20, 174, 201, 0.28), transparent 60%),
    radial-gradient(55rem 40rem at 50% 108%, rgba(8, 72, 132, 0.6), transparent 62%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* A single slow-drifting light, behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(28vmax 28vmax at 30% 35%, rgba(20, 174, 201, 0.16), transparent 60%),
    radial-gradient(24vmax 24vmax at 70% 60%, rgba(22, 104, 189, 0.18), transparent 60%);
  animation: aae-drift 26s ease-in-out infinite alternate;
}

@keyframes aae-drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.12); }
}

/*****************************************************************************
 * Navbar
 *****************************************************************************/

.aae-navbar {
  position: sticky;
  top: 0;
  background-color: rgba(7, 31, 61, 0.62);
  backdrop-filter: var(--aae-glass-blur);
  -webkit-backdrop-filter: var(--aae-glass-blur);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 10px 30px -18px rgba(2, 12, 26, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 1000;
}

.aae-navbar__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.aae-navbar__brand { order: 1; }
.aae-navbar__user, .aae-navbar__login { order: 2; }
.aae-navbar__nav { order: 3; }

/* Two-part lockup: the name reads first, the year/occasion sits under it. */
.aae-navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: #fff;
}
.aae-navbar__brand:hover,
.aae-navbar__brand:focus {
  color: #fff;
}
.aae-navbar__brand__text {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.5rem;
  line-height: 1.15;
}
.aae-navbar__brand__name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* No letter-spacing: it reads as gaps between characters in Chinese, not tracking. */
.aae-navbar__brand__sub {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(159, 214, 240, 0.85);
}

.aae-navbar__brand__mark {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--aae-cyan-bright);
  box-shadow: 0 0 0 0 rgba(95, 220, 242, 0.6);
  animation: aae-pulse 2.6s ease-out infinite;
}

@keyframes aae-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(95, 220, 242, 0.55); }
  70%  { box-shadow: 0 0 0 0.6rem rgba(95, 220, 242, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 220, 242, 0); }
}

/* On mobile the links are a segmented control, not three loose words. */
.aae-navbar__nav {
  flex-basis: 100%;
  padding: 0.1875rem;
  border-radius: 100rem;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.aae-navbar__nav .nav-item {
  flex: 1 1 0;
  text-align: center;
  min-width: 0;
}
.aae-navbar__nav .nav-link {
  position: relative;
  padding: 0.375rem 0.5rem;
  border-radius: 100rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.aae-navbar__nav .nav-link:hover,
.aae-navbar__nav .nav-link:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--aae-cyan-bright);
}
.aae-navbar__nav .nav-link:active {
  background-color: rgba(95, 220, 242, 0.18);
}

.aae-navbar__login {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
  padding: 0.3125rem 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 100rem;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  background-color: rgba(255, 255, 255, 0.06);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.aae-navbar__login:hover,
.aae-navbar__login:focus {
  color: var(--aae-navy-deep);
  background-color: var(--aae-cyan-bright);
  border-color: var(--aae-cyan-bright);
}

/* Avatar button — a plain glass disc, no Bootstrap button chrome or caret. */
.aae-navbar__avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.aae-navbar__avatar:hover,
.aae-navbar__avatar:focus,
.aae-navbar__avatar[aria-expanded="true"] {
  outline: none;
  color: #fff;
  border-color: rgba(95, 220, 242, 0.7);
  box-shadow: 0 0 0 0.2rem rgba(95, 220, 242, 0.16);
}

/* Unfilled details get a dot here, so the warning is visible before opening. */
.aae-navbar__avatar__dot {
  position: absolute;
  top: -0.0625rem;
  right: -0.0625rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: #ff8a8a;
  box-shadow: 0 0 0 2px rgba(7, 31, 61, 0.9);
}

/*****************************************************************************
 * Navbar user menu
 *****************************************************************************/

.aae-menu {
  min-width: 15rem;
  margin-top: 0.625rem;
  padding: 0.375rem;
  border: 1px solid var(--aae-glass-border);
  border-radius: 1rem;
  /* Nearly opaque on purpose: the menu sits over the key visual, and the blur
     alone leaves the artwork readable through it (and is dropped entirely by
     browsers without backdrop-filter). */
  background: linear-gradient(160deg, rgba(16, 56, 100, 0.97), rgba(7, 27, 53, 0.98));
  backdrop-filter: var(--aae-glass-blur);
  -webkit-backdrop-filter: var(--aae-glass-blur);
  box-shadow: var(--aae-glass-shadow);
}
/*
 * Bootstrap flips display:none → block, so animate rather than transition.
 * Popper positions the menu with an inline `transform`, and an animated
 * `transform` would win the cascade over it and drop the menu off-screen —
 * hence the independent `translate` / `scale` properties, which compose with it.
 */
.aae-menu.show {
  transform-origin: top right;
  animation: aae-menu-in 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes aae-menu-in {
  from { opacity: 0; translate: 0 -0.375rem; scale: 0.97; }
  to   { opacity: 1; translate: none; scale: none; }
}

.aae-menu__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.aae-menu__avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.125rem;
  border-radius: 50%;
  color: var(--aae-navy-deep);
  background: linear-gradient(150deg, var(--aae-cyan-bright), var(--aae-cyan));
}
.aae-menu__id {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  min-width: 0;
}
.aae-menu__name {
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aae-menu__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.88);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.aae-menu__item:hover,
.aae-menu__item:focus,
.aae-menu__item:active {
  color: var(--aae-cyan-bright);
  background-color: rgba(255, 255, 255, 0.1);
}
.aae-menu__item .ti {
  font-size: 1.0625rem;
  opacity: 0.75;
}

@media (min-width: 768px) {
  .aae-navbar__row {
    padding: 0.375rem 0;
    gap: 0.75rem;
  }
  .aae-navbar__brand { order: 1; }
  .aae-navbar__user, .aae-navbar__login { order: 3; }
  .aae-navbar__nav { order: 2; }

  .aae-navbar__brand__name {
    font-size: 1.25rem;
  }
  .aae-navbar__brand__sub {
    font-size: 1rem;
  }

  /* Same segmented track as mobile, sized to its content instead of the row. */
  .aae-navbar__nav {
    margin-right: auto;
    margin-left: 1rem;
    flex-basis: auto;
  }
  .aae-navbar__nav .nav-item {
    flex: 0 0 auto;
  }
  .aae-navbar__nav .nav-link {
    padding: 0.375rem 1.125rem;
    font-size: 0.9375rem;
  }
}

/*****************************************************************************
 * Hero
 *****************************************************************************/

.aae-hero {
  position: relative;
  overflow: hidden;
  animation: aae-hero-in 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.aae-hero img {
  display: block;
  position: relative;
  z-index: 0;
}

/* Glass sheen sweeping across the visual. */
.aae-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  bottom: -50%;
  width: 45%;
  left: -60%;
  z-index: 1;
  pointer-events: none;
  transform: skewX(-18deg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0) 100%);
  animation: aae-sheen 9s ease-in-out 1.4s infinite;
}

/* Cyan hairline where the banner meets the page. */
.aae-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent,
    rgba(95, 220, 242, 0.75) 50%,
    transparent);
  box-shadow: 0 0 24px 2px rgba(20, 174, 201, 0.35);
}

@keyframes aae-hero-in {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes aae-sheen {
  0%       { left: -60%; }
  55%, 100% { left: 130%; }
}

/*****************************************************************************
 * Section
 *****************************************************************************/

.aae-container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}
@media (min-width: 576px) { .aae-container { max-width: 540px; } }
@media (min-width: 768px) { .aae-container { max-width: 720px; } }
@media (min-width: 992px) { .aae-container { max-width: 960px; } }

.aae-section {
  position: relative;
  background: var(--aae-glass-bg);
  border: 1px solid var(--aae-glass-border);
  padding: 1.75rem 1.25rem;
  margin: 3rem 0;
  border-radius: 1.25rem;
  box-shadow: var(--aae-glass-shadow);
}
@media (min-width: 768px) {
  .aae-section {
    padding: 2.25rem 2rem;
  }
}

/* Light catching the top edge of the panel. */
.aae-section::before {
  content: "";
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.65),
    transparent);
}

/* The backdrop blur is opt-in: it makes the panel a containing block for
 * `position: fixed`, so a panel that hosts a modal must not carry it. */
.aae-section--glass {
  backdrop-filter: var(--aae-glass-blur);
  -webkit-backdrop-filter: var(--aae-glass-blur);
}

.aae-section h1,
.aae-section h2,
.aae-section h3,
.aae-section h4,
.aae-section h5,
.aae-section h6 {
  color: var(--aae-cyan-bright);
  font-weight: bold;
}

.aae-section h2 {
  background-image: linear-gradient(100deg, #ffffff 15%, var(--aae-cyan-bright) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
}

.aae-section hr {
  border-color: rgba(255, 255, 255, 0.18);
  margin: 1.75rem 0;
}

/* Inset panel used for the long-form blocks (rules, ToS, privacy). */
.aae-panel {
  background-color: rgba(4, 22, 43, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.875rem;
}

/*****************************************************************************
 * Reveal on scroll — the class is only armed once the script runs, so the
 * page stays readable without JavaScript or with reduced motion.
 *****************************************************************************/

.aae-reveal-ready .aae-reveal {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

.aae-reveal-ready .aae-reveal.is-revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/*****************************************************************************
 * Buttons, forms
 *****************************************************************************/

.btn {
  transition:
    transform 0.18s ease,
    box-shadow 0.25s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary {
  background-image: linear-gradient(135deg, #5fdcf2 0%, #14aec9 55%, #1a7fd0 130%);
  border-color: transparent;
  box-shadow:
    0 10px 26px -12px rgba(20, 174, 201, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover,
.btn-primary:focus {
  background-image: linear-gradient(135deg, #7ee6f7 0%, #21bcd7 55%, #2189db 130%);
  border-color: transparent;
  box-shadow:
    0 14px 32px -12px rgba(20, 174, 201, 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-primary:disabled,
.btn-primary.disabled {
  background-image: none;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-light {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Headline call to action, with a sheen that reads as glass. */
.aae-cta {
  position: relative;
  overflow: hidden;
  padding-right: 2rem;
  padding-left: 2rem;
}
.aae-cta::after {
  content: "";
  position: absolute;
  top: -50%;
  bottom: -50%;
  left: -80%;
  width: 45%;
  transform: skewX(-20deg);
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 100%);
  animation: aae-sheen 4.5s ease-in-out 1s infinite;
}

.form-control {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
}
.form-control:focus {
  box-shadow:
    0 0 0 0.2rem rgba(95, 220, 242, 0.22),
    0 0 26px -8px rgba(95, 220, 242, 0.75);
}

/* Status lozenge — "資料已填妥" / "資料尚未填妥". */
.aae-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: 100rem;
  border: 1px solid transparent;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.aae-status--ok {
  color: #7ef0c8;
  border-color: rgba(126, 240, 200, 0.45);
  background-color: rgba(126, 240, 200, 0.1);
}
.aae-status--todo {
  color: #ffb3a1;
  border-color: rgba(242, 72, 34, 0.5);
  background-color: rgba(242, 72, 34, 0.14);
}

/*
 * The quiet sibling of .aae-status: a bare coloured label with an icon, no pill.
 * Shared by the navbar user menu and the e-mail verification line, so the two
 * cannot drift apart — it is the same statement about the same account.
 */
.aae-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}
.aae-flag--ok { color: #7fd6a6; }
.aae-flag--warn { color: #ffb0b0; }

/* Login prompt shown in place of the profile form. */
.aae-login {
  max-width: 30rem;
  margin: 0 auto;
  text-align: center;
}
.aae-login__hint {
  color: #c3d5e8;
  margin-bottom: 1.5rem;
}

/*****************************************************************************
 * Coming soon — placeholder for the question flow
 *****************************************************************************/

.aae-coming-soon {
  max-width: 38rem;
  margin: 0 auto;
  padding: 1rem 0 0.5rem;
  text-align: center;
}

.aae-coming-soon__orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05) 62%);
  box-shadow:
    0 0 45px -8px rgba(20, 174, 201, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: var(--aae-cyan-bright);
  font-size: 2.5rem;
  animation: aae-float 5s ease-in-out infinite;
}

@keyframes aae-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-0.5rem) scale(1.03); }
}

.aae-coming-soon__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem 1.1rem;
  border: 1px solid rgba(95, 220, 242, 0.45);
  border-radius: 100rem;
  background-color: rgba(20, 174, 201, 0.12);
  color: var(--aae-cyan-bright);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
}

.aae-dots {
  display: inline-flex;
  gap: 0.25rem;
}
.aae-dots span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background-color: var(--aae-cyan-bright);
  animation: aae-blink 1.4s ease-in-out infinite;
}
.aae-dots span:nth-child(2) { animation-delay: 0.2s; }
.aae-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aae-blink {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1); }
}

.aae-coming-soon__lead {
  margin-bottom: 1.25rem;
  line-height: 1.9;
  text-wrap: pretty; /* progressive: keeps a single character off the last line */
}

.aae-coming-soon__note {
  margin-bottom: 1.5rem;
  color: #9fb6d1;
  font-size: 0.9375rem;
}
.aae-coming-soon__note:last-child {
  margin-bottom: 0.5rem;
}

/*****************************************************************************
 * Footer
 *****************************************************************************/

.aae-footer {
  padding: 1.5rem 0;
  margin-top: 3rem;
  background-color: rgba(4, 22, 43, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #b9cde2;
  text-align: center;
}

/*****************************************************************************
 * Misc
 *****************************************************************************/

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotate {
  animation: rotate 1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body::before,
  .aae-hero,
  .aae-hero::before,
  .aae-cta::after,
  .aae-navbar__brand__mark,
  .aae-menu.show,
  .aae-coming-soon__orb,
  .aae-dots span {
    animation: none;
  }
  .btn:hover,
  .btn:active {
    transform: none;
  }
}
