/*
 * CSS Variables
 */
:root {
    /* Palette */
    --color-dark-gold: #b28c54;
    --color-gold: #e1c987;
    --color-gold2: #e6dabf63;
    --color-light-gold: #e2c886;
    --color-yellow: #e6ab3e;
    --color-border-light-gold: #e2c886dd;
    --color-header-dark-gold: #926f39;
    --color-bg-light-gold: #fbf6e8cd;
    --color-brown: #8e8b7b;
    --color-orange: #ff5100;
    --color1: #ff5100;
    --color2: #4d4d4d;
    /* Brand */
    --bs-brand-primary: #591f34;

    /* Common */
    --bs-body-line-height: 1.3;
    --bs-body-color: white;

    /* Typography */
    --bs-font-sans-serif: "NotoSans-400";
    --bs-font-size-base: 1rem;
    --bs-body-font-size: 1rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.3;
    --bs-body-color: var(--bs-brand-primary);
    --bs-body-bg: white;

    --bs-border-radius: 4px;

    /* Layout */
    --header-height: 70px;
}

/*
 * Common Styles
 */

@font-face {
  font-family: "NotoSansTC-300";
  src: local("NotoSansTC-300"),
        url(../themes/kontec/assets/fonts/NotoSansTC-Light.ttf) format("truetype");
}

@font-face {
    font-family: "NotoSansTC-500";
    src: local("NotoSansTC-500"),
        url(../themes/kontec/assets/fonts/NotoSansTC-Medium.ttf) format("truetype");
}

@font-face {
    font-family: "NotoSansTC-400";
    src: local("NotoSansTC-400"),
        url(../themes/kontec/assets/fonts/NotoSansTC-Regular.ttf) format("truetype");
}

@font-face {
    font-family: "NotoSansTC-700";
    src: local("NotoSansTC-700"),
        url(../themes/kontec/assets/fonts/NotoSansTC-Bold.ttf) format("truetype");
}

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

html,
body {
    font-family: "NotoSansTC-400";
    width: 100%;
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
    color: #373434;
}

h3 {
  font-size: 1.25rem;
}

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

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

button {
  display: block;
  border: none;
  outline: none;
  text-decoration: none;
  background-color: transparent;
}

#layout-content {
    position: relative;
    min-height: 100dvh;
    max-width: 450px;
    margin: 0 auto;
}

.logo {
    height: var(--header-height);
    width: 100%;
    background-color: var(--bs-brand-primary);
}

.logo img {
    max-width: 150px;
    height: auto;
}

/* --- Form Field --- */
.form-field {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    column-gap: 8px;
}

.form-field label {
    flex-shrink: 0;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-dark-gold);
    font-size: 1rem;
}

.form-field input:not([type="checkbox"]) {
    border: 1.5px solid var(--color-gold);
    border-radius: 2px;
    width: 100%;
    padding: 6px 8px;
    font-size: 0.875rem;
    line-height: 1rem;
    letter-spacing: 0.05em;
}

.form-field input:not([type="checkbox"]):focus {
    outline: none;
}

.form-field input:not([type="checkbox"])::placeholder {
    color: #37343480;
}

.form-field select {
    border: none;
    width: 100%;
    background-color: transparent;
    text-decoration: unset;
    color: inherit;
}

.form-field select:focus {
    outline: none;
}

/* --- Checkbox --- */
.form-field_checkbox {
    width: 100%;
    display: flex;
    align-items: top;
    justify-content: center;
    column-gap: 16px;
}

.form-field_checkbox label {
    color: var(--bs-brand-primary);
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    line-height: 1.4;
}

.form-field_checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.form-field_checkbox .custom-checkbox {
    width: 24px;
    height: 24px;
    display: inline-block;
    border: 1.5px solid var(--color-dark-gold);
    border-radius: 0;
    background-color: #fff;
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}

.form-field_checkbox input[type="checkbox"]:checked + .custom-checkbox::after {
    content: "";
    position: absolute;
    left: 6.5px;
    top: 0.5px;
    width: 8px;
    height: 16px;
    border: solid var(--color-dark-gold);
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
}

.form-field_checkbox input[type="checkbox"]:focus + .custom-checkbox {
    outline: none;
}

/*
 * --- Sparkle Stars (parent must be positioned; content above needs z-index > 1) ---
 * The layer starts --sparkles-bleed above the header's bottom edge and sparkles.js pushes every
 * star down by the same amount, so stars sit below the header but their glow can overlap it.
 */
.sparkles {
  --sparkles-bleed: 24px;
  position: absolute;
  top: calc(var(--header-height) - var(--sparkles-bleed));
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.sparkles__star {
  position: absolute;
  width: var(--sparkle-size, 3px);
  height: var(--sparkle-size, 3px);
  border-radius: 50%;
  background-color: #fffaf0;
  opacity: 0;
  animation: sparkle 4s ease-in-out infinite alternate;
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: scale(0.5);
    box-shadow: 0 0 6px 2px rgba(255, 236, 190, 0.35);
  }
  50% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px 4px rgba(255, 236, 190, 0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
    box-shadow: 0 0 10px 4px rgba(255, 236, 190, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sparkles {
    display: none;
  }
}

#fullpage-loader {
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
}

.loader-spinner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 6px solid #fff;
    border-top: 6px solid #5ab267;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loader-text {
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tnc-container {
  text-align: left;
  font-size: 12px;
}

.tnc-container p {
  margin: 0 0 6px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/** Swal **/
.swal2-popup {
    padding: 1em 1em 1.25em !important;
    border-radius: 24px !important;
    width: 365px;
    font-size: 14px;
}

.swal2-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #3d424f !important;
}

.swal2-html-container {
    font-size: 14px !important;
    color: #3d424f !important;
}

.swal2-actions {
    width: 100%;
    display: flex;
    flex-direction: row-reverse;
}

.swal2-confirm {
    background-color: var(--bs-brand-primary) !important;
    border-radius: 999px !important;
    border: 2px solid #173c29 !important;
    color: #fff !important;
    height: 45px;
    flex-grow: 1;
    width: 120px;
    padding: 0 2em;
    font-size: 14px;
    font-weight: 600;
}

.swal2-confirm:focus {
    box-shadow: none !important;
}

.swal2-styled.swal2-cancel {
    background-color: #6e7881 !important;
    border-radius: 999px !important;
    border: 2px solid #6e7881 !important;
    color: #fff !important;
    height: 45px;
    flex-grow: 1;
    width: 120px;
    padding: 0 2em;
    font-size: 14px;
    font-weight: 600;
}

.swal2-styled.swal2-cancel:focus {
    box-shadow: none !important;
}
#home-section {
  position: relative;
  background-color: var(--bs-brand-primary);
}

/*
 * Padding percentages are relative to width, so the card always starts below the steps panel in home-s2.
 * Asymmetric sides align the card body with the panel frame and let the bow overhang to the right.
 */
#home-section div#home__s2 {
  aspect-ratio: 1111 / 2069;
  padding: 74% 3% 16% 6.5%;
  background-color: #2b0414;
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% auto;
}

#home-section div#home__s3 {
  position: relative;
  z-index: 2;
  aspect-ratio: 1016 / 1073;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12% 12% 7% 8%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

#home-section div#home__s3 h3.home__s3_form-header {
  font-family: "NotoSansTC-500";
  color: var(--color-dark-gold);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

#home-section div#home__s3 div.home__s3_form-container > form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 15px;
}

#home-section div#home__s3 .form-field label {
  font-size: 0.875rem;
}

#home-section div#home__s3 .form-field input:not([type="checkbox"]) {
  padding: 4px 8px;
  font-size: 0.75rem;
  background-color: transparent;
}

#home-section div#home__s3 .form-field_checkbox {
  column-gap: 8px;
}

#home-section div#home__s3 .form-field_checkbox label {
  font-size: 0.6875rem;
}

#home-section div#home__s3 .form-field_checkbox .custom-checkbox {
  width: 16px;
  height: 16px;
  border-width: 1px;
  background-color: transparent;
}

#home-section div#home__s3 .form-field_checkbox input[type="checkbox"]:checked + .custom-checkbox::after {
  left: 4.5px;
  top: 0.5px;
  width: 5px;
  height: 10px;
  border-width: 0 2px 2px 0;
}

#home-section div#home__s3 div.home__s3_form-container > form > .form-field_checkbox {
  margin-top: 4px;
}

#home-section div#home__s3 div.errors {
  color: red;
  font-size: 12px;
  margin-top: 8px;
}

#home-section div#home__s3 button#btn-register-submit {
  margin: 12px auto 0;
}

#home-section div#home__s3 img.home__s3_form-submit {
  width: 140px;
  height: auto;
  object-fit: contain;
}

#home-section div#home__s3 span#btn-tnc {
  text-decoration: underline;
}