/* landing.css — split landing (galaxy left, light login panel right), intro states, shared field/button parts. */

.landing-page {
  --footer-h: 0px;
  --panel-w: 40%;
  --gold: #f5c542;
  --gold-deep: #c99a1e;
  --fld: #352f4d;
  --fld-icon: #0b0819;
  --royal: #06127a;
  background: var(--navy-deep);
  overflow: hidden;
}

.galaxy-wrapper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--navy-deep) url('assets/blue-galaxy.webp') center / cover no-repeat;
}

#galaxy {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ==========================================================================
   Layout & Brand (Left Side)
   ========================================================================== */

.landing-layout {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr var(--panel-w);
  height: 100dvh;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.2rem, 2.4vw, 2.6rem);
  padding: 2rem;
}

.brand__mark {
  display: block;
  width: clamp(150px, 20vw, 360px);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(150, 190, 255, 0.3));
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4.6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.wordmark span {
  display: inline-block;
}

.wm-call {
  background: linear-gradient(180deg, var(--ice-soft), #8fb8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Panel & Typography (Right Side)
   ========================================================================== */

.panel {
  display: flex;
  align-items: center;
  padding: 2rem clamp(1.5rem, 5vw, 4.5rem);
  background: linear-gradient(180deg, #fcfdff 0%, #c9dbf7 100%);
  color: var(--royal);
}

.panel__inner {
  width: 21.25em;
  max-width: 100%;
  margin: 0 auto;
  font-size: clamp(13px, 0.96vw, 17px);
}

.welcome {
  margin: 0 0 0.45em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.5em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  color: var(--royal);
}

.tagline {
  max-width: min(34rem, 90%);
  margin: 0;
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
  color: var(--ice-soft);
}

/* ==========================================================================
   Shared Fields (Login + Register)
   ========================================================================== */

.field {
  position: relative;
  display: flex;
  height: 2.625em;
  margin-bottom: 1em;
  transition: box-shadow 0.3s ease;
}

.field__icon {
  flex: 0 0 2.625em;
  display: grid;
  place-items: center;
  background: var(--fld-icon);
  color: #fff;
  transition: background-color 0.3s ease;
}

.ico {
  width: 1.0625em;
  height: 1.0625em;
}

.field__input {
  flex: 1;
  min-width: 0;
  padding: 0 0.97em;
  border: 0;
  outline: 0;
  background: var(--fld);
  color: #fff;
  caret-color: var(--gold);
  font: 400 0.88em var(--font-body);
  letter-spacing: 0.02em;
}

.field__input::placeholder {
  color: rgba(214, 224, 245, 0.45);
}

.field__input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--fld) inset;
  -webkit-text-fill-color: #fff;
}

.field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.field:focus-within {
  box-shadow: 0 0 18px rgba(245, 197, 66, 0.28);
}

.field:focus-within::after,
.field.is-mismatch::after {
  transform: scaleX(1);
}

.field.is-mismatch {
  --fld-icon: #8f1d2c;
  box-shadow: 0 0 18px rgba(229, 72, 77, 0.35);
}

.field.is-mismatch::after {
  background: #e5484d;
  box-shadow: 0 0 10px #e5484d;
}

.field__toggle {
  flex: 0 0 2.5em;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: var(--fld);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.2s;
}

.field__toggle:hover,
.field__toggle:focus-visible {
  color: #fff;
  outline: none;
}

.field__toggle .eye-off,
.field__toggle[aria-pressed="true"] .eye {
  display: none;
}

.field__toggle[aria-pressed="true"] .eye-off {
  display: block;
}

.form-error {
  margin: -0.26em 0 1.18em;
  padding: 0.66em 0.99em;
  border-left: 3px solid #e5484d;
  background: rgba(229, 72, 77, 0.12);
  font-size: 0.76em;
  font-weight: 700;
  line-height: 1.4;
  color: #9b1c25;
}

.link-btn {
  display: block;
  margin: -0.53em 0 1.07em;
  padding: 0;
  border: 0;
  background: none;
  font: 700 0.75em var(--font-body);
  color: var(--royal);
  text-decoration: underline;
  cursor: pointer;
}

.link-btn[hidden],
.form-error[hidden] {
  display: none;
}


/* ==========================================================================
   Forgot Password Link
   ========================================================================== */

/* Places the password-reset link neatly between the login feedback and button. */
.forgot-password-link {
  margin: -0.2em 0 1em;
  text-align: right;
}

/* Matches the login design while keeping the link easy to notice. */
.forgot-password-link a {
  color: var(--royal);
  font-size: 0.76em;
  font-weight: 700;
  text-decoration: none;
}

/* Gives keyboard and mouse users clear feedback without changing layout. */
.forgot-password-link a:hover,
.forgot-password-link a:focus-visible {
  color: var(--gold);
  text-decoration: underline;
  outline: none;
}

/* ==========================================================================
   Buttons & Social Actions
   ========================================================================== */

.btn-primary {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  height: 3.19em;
  border: 0;
  cursor: pointer;
  font: 700 0.9em var(--font-display);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--royal);
  background: linear-gradient(90deg, #b4d0ff, #6b97ff);
  transition: transform 0.2s ease, box-shadow 0.3s ease, filter 0.2s;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.65s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(40, 70, 200, 0.35), 0 0 0 1px rgba(245, 197, 66, 0.7);
  outline: none;
}

.btn-primary:hover::before,
.btn-primary:focus-visible::before {
  transform: translateX(120%);
}

.btn-primary:active {
  transform: none;
}

.btn-primary:disabled {
  filter: grayscale(0.5) brightness(0.9);
  cursor: wait;
}

.or {
  display: flex;
  align-items: center;
  gap: 1.27em;
  margin: 2.73em 0 2.18em;
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--royal);
}

.social {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9em;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  height: 3.125em;
  border: 0;
  cursor: pointer;
  font: 700 0.92em var(--font-display);
  color: #fff;
  background: linear-gradient(90deg, #0a1a6b, #03042e);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-social svg {
  width: 1.5em;
  height: 1.5em;
}

.btn-social:hover,
.btn-social:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(3, 4, 46, 0.4), 0 0 0 1px var(--gold);
  outline: none;
}

.register-line {
  margin: 2.03em 0 0;
  font-size: 0.74em;
  font-weight: 600;
  text-align: center;
  color: #6a7596;
}

.register-line a {
  color: var(--royal);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.register-line a:hover {
  border-color: var(--gold);
}

/* ==========================================================================
   Copyright line (bottom of the brand side)
   ========================================================================== */

.landing-copy {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 5;
  width: calc(100% - var(--panel-w));
  margin: 0;
  padding: 0 1rem 1.1rem;
  text-align: center;
  pointer-events: none;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   Intro Animation States
   ========================================================================== */

.intro-fx {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--ice);
  box-shadow: 0 0 18px rgba(150, 190, 255, 0.6), inset 0 0 18px rgba(150, 190, 255, 0.3);
  opacity: 0;
}

.ring.gold {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(245, 197, 66, 0.55), inset 0 0 18px rgba(245, 197, 66, 0.25);
}

.intro-core {
  position: absolute;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  filter: drop-shadow(0 0 12px rgba(245, 197, 66, 0.75));
}

/* The star: shaped like the star in the Sinagtala logo (long rays up, down, left and right,
   short rays on the diagonals). It reshapes between a small plump star and a long sparkle,
   and turns a quarter turn every two beats. landingscript.js adds the pulse on top. */
.intro-core::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #fff3c4 0%, var(--gold) 45%, #ff9a0a 100%);
  clip-path: polygon(50.0% 17.0%, 56.5% 34.3%, 67.7% 32.3%, 65.7% 43.5%, 83.0% 50.0%, 65.7% 56.5%, 67.7% 67.7%, 56.5% 65.7%, 50.0% 83.0%, 43.5% 65.7%, 32.3% 67.7%, 34.3% 56.5%, 17.0% 50.0%, 34.3% 43.5%, 32.3% 32.3%, 43.5% 34.3%);
  animation: star-morph 1s ease-in-out infinite, star-spin 2s ease-in-out infinite;
}

/* Bright center that beats with the star. */
.intro-core::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #fffbe8;
  box-shadow: 0 0 14px 4px rgba(255, 244, 200, 0.8);
  animation: star-beat 1s ease-in-out infinite;
}

@keyframes star-morph {
  0%, 10%, 90%, 100% { clip-path: polygon(50.0% 17.0%, 56.5% 34.3%, 67.7% 32.3%, 65.7% 43.5%, 83.0% 50.0%, 65.7% 56.5%, 67.7% 67.7%, 56.5% 65.7%, 50.0% 83.0%, 43.5% 65.7%, 32.3% 67.7%, 34.3% 56.5%, 17.0% 50.0%, 34.3% 43.5%, 32.3% 32.3%, 43.5% 34.3%); }
  40%, 60% { clip-path: polygon(50.0% 0.0%, 52.7% 43.5%, 70.5% 29.5%, 56.5% 47.3%, 100.0% 50.0%, 56.5% 52.7%, 70.5% 70.5%, 52.7% 56.5%, 50.0% 100.0%, 47.3% 56.5%, 29.5% 70.5%, 43.5% 52.7%, 0.0% 50.0%, 43.5% 47.3%, 29.5% 29.5%, 47.3% 43.5%); }
}

@keyframes star-spin {
  0%, 20% { rotate: 0deg; }
  30%, 70% { rotate: 45deg; }
  80%, 100% { rotate: 90deg; }
}

@keyframes star-beat {
  0%, 10%, 90%, 100% { transform: scale(1); }
  40%, 60% { transform: scale(1.4); }
}

@media (prefers-reduced-motion: reduce) {
  .intro-core::before,
  .intro-core::after {
    animation: none;
  }
}

/* "Loading…" text under the star, added by landingscript.js. */
.intro-progress {
  position: absolute;
  width: 11em;
  margin-left: -5.5em;
  text-align: center;
}

.intro-progress__text {
  margin: 0.7em 0 0;
  font: 600 0.85rem var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice-soft);
}

.is-intro .panel {
  transform: translateX(101%);
}

.is-intro .brand__mark,
.is-intro .landing-copy,
.is-intro .wordmark span,
.is-intro .brand .tagline,
.is-intro .panel__inner > * {
  opacity: 0;
}

.is-intro .landing-layout {
  pointer-events: none;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 860px) {
  .landing-page {
    overflow-y: auto;
  }
  .landing-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100dvh;
  }
  .brand {
    padding: 3rem 1rem 1.5rem;
  }
  .brand__mark {
    width: clamp(100px, 28vw, 150px);
  }
  .wordmark {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }
  .panel {
    padding: 2.5rem 1.5rem 3rem;
  }
  .is-intro .panel {
    transform: translateY(60px);
    opacity: 0;
  }
  .landing-copy {
    position: static;
    width: auto;
    padding: 1.2rem 1rem 1.6rem;
    color: rgba(255, 255, 255, 0.7);
  }
  .panel__inner {
    font-size: 16px;
  }
  .welcome {
    font-size: 3.2em;
  }
}

/* Text shown inside the Forgot Password modal. */
.forgot-password-text {
    margin: 0 0 18px;
    text-align: center;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
}

/* Back to Login button below the reset form. */
.forgot-password-back {
    display: block;
    margin: 14px auto 0;
    padding: 8px 12px;

    border: 0;
    background: transparent;

    color: #ffc233;
    font: inherit;

    cursor: pointer;
}

/* Makes the Back to Login action clearer when using a mouse. */
.forgot-password-back:hover {
    text-decoration: underline;
}
/* Success message used after a password reset request is created. */
.form-error.is-success {
    background: rgba(46, 204, 113, 0.16);
    border-left: 3px solid #2ecc71;
    color: #bff5cf;
}
/* Centers the Reset Password page content. */
.reset-password-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}


/* Main Reset Password card. */
.reset-password-card {
    width: min(420px, 100%);
    padding: 36px;

    background: #25213d;

    border-radius: 8px;

    text-align: center;
}


/* Reset Password title. */
.reset-password-card h1 {
    margin-top: 0;

    color: #ffffff;
}


/* Reset Password description. */
.reset-password-card p {
    margin-bottom: 24px;

    color: rgba(255, 255, 255, 0.75);
}


/* Creates spacing between reset fields. */
.reset-password-card .field {
    margin-bottom: 16px;
}
/* ==========================================================
   RESPONSIVE LOGIN / LANDING PAGE
   Keeps the login layout aligned when the browser is resized
   or zoomed in and out.
   ========================================================== */


/* Prevent large page elements from overflowing their container. */
.landing-layout,
.panel,
.panel__inner,
.login-form,
.field,
.social {
    min-width: 0;
}


/* Keep the login panel at a readable width instead of stretching. */
.panel__inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}


/* Make all login fields use the same full width. */
.login-form,
.field,
.btn-primary {
    width: 100%;
}


/* Keep input fields from overflowing when zoomed. */
.field__input {
    width: 100%;
    min-width: 0;
}


/* The Google button uses the full width. */
.social {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}


/* Allow long text to wrap instead of leaving the panel. */
.tagline,
.register-line,
.forgot-password-link {
    overflow-wrap: break-word;
}


/* ==========================================================
   TABLET / SMALL SCREEN
   ========================================================== */

@media (max-width: 768px) {

    /* Stack the branding and login panel vertically. */
    .landing-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }


    /* Give the login area safe spacing from the screen edges. */
    .panel {
        width: 100%;
        padding: 32px 24px;
    }


    /* Keep the login content centered. */
    .panel__inner {
        max-width: 500px;
        margin: 0 auto;
    }


    /* Reduce the large welcome heading slightly. */
    .welcome {
        font-size: clamp(2.8rem, 10vw, 4.5rem);
    }


    /* Hide or reduce the large left branding area if needed on tablets. */
    .brand {
        min-height: 340px;
    }
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 420px) {

    /* Give the page enough breathing room on small phones. */
    .panel {
        padding: 28px 18px;
    }


    /* Reduce heading size on narrow screens. */
    .welcome {
        font-size: clamp(2.4rem, 15vw, 3.6rem);
    }


    /* Keep descriptive text readable. */
    .tagline {
        font-size: 0.95rem;
        line-height: 1.5;
    }


    /* Keep the social button comfortable on small phones. */
    .social {
        gap: 12px;
    }


    /* Keep buttons comfortable to tap. */
    .btn-primary,
    .btn-social {
        min-height: 48px;
    }


    /* Reduce the large branding section on phones. */
    .brand {
        min-height: 250px;
    }


    /* Keep Register text centered and wrapped. */
    .register-line {
        text-align: center;
        line-height: 1.5;
    }
}