/* register.css — the register popup, styled to match the member login popup (member-login.css).
   Fields/buttons come from landing.css; overlay/rise/close from modal.css. */

.register-modal {
  /* Tweak the whole card from here (same tokens as member-login.css) */
  --card-top: #b9d4ff;
  --card-mid: #8fa4dc;
  --card-bottom: #6c6e91;
  --title-ink: #465069;
  --accent: #7fb0ff; /* focus + hover glow */
  --fld-icon: #171a20;
  --fld: rgba(46, 54, 70, 0.9);
  --field-placeholder: rgba(214, 224, 245, 0.42);

  padding: 2.3rem 2.75rem 3rem;
  font-family: var(--font-body);
  color: #fff;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-mid) 48%, var(--card-bottom) 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 20, 0.55), 0 0 60px rgba(110, 160, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ==========================================================================
   Staggered Entrance Animations
   ========================================================================== */

.register-modal.is-active .reg-item {
  animation: modal-item-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s) backwards;
}

.register-modal__title {
  --d: 0.18s;
}

.register-modal__form > :nth-child(1) {
  --d: 0.26s;
}

.register-modal__form > :nth-child(2) {
  --d: 0.33s;
}

.register-modal__form > :nth-child(3) {
  --d: 0.33s;
}

.register-modal__form > :nth-child(4) {
  --d: 0.40s;
}

.register-modal__form > :nth-child(5) {
  --d: 0.46s;
}

.register-modal__form > :nth-child(7) {
  --d: 0.52s;
}

.register-modal__form > :nth-child(8) {
  --d: 0.58s;
}

/* ==========================================================================
   Modal Title
   ========================================================================== */

.register-modal__title {
  margin: 0 0 2.35rem;
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-align: center;
  text-transform: uppercase;
  color: var(--title-ink);
}

/* ==========================================================================
   Form Fields & Inputs
   ========================================================================== */

.register-modal .field {
  height: 43px;
  margin-bottom: 1.3rem;
  box-shadow: 0 0 0 1px rgba(127, 176, 255, 0), 0 0 0 rgba(127, 176, 255, 0);
}

.register-modal .field__icon {
  flex: 0 0 43px;
}

.register-modal .ico {
  width: 18px;
  height: 18px;
}

.register-modal .field__input {
  padding: 0 0.85rem;
  font-size: 0.92rem;
  caret-color: #fff;
  transition: background-color 0.3s ease;
}

.register-modal .field__input::placeholder {
  color: var(--field-placeholder);
}

.register-modal .field__input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #2e3646 inset;
  -webkit-text-fill-color: #fff;
}

/* Glowing blue underline + focus lift (replaces the landing page's gold) */
.register-modal .field::after {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.register-modal .field:focus-within {
  --fld-icon: #1d3a86;
  --fld: rgba(58, 68, 90, 0.92);
  box-shadow: 0 0 0 1px rgba(127, 176, 255, 0.55), 0 0 22px rgba(127, 176, 255, 0.35);
}

/* Short hint under the email field ("Use your @cvsu.edu.ph email.") */
.register-modal .field-hint {
  margin: -0.95rem 0 1.1rem 0.25rem;
  font-size: 0.76rem;
  line-height: 1.3;
  color: #2b3552;
}

/* Password mismatch stays red, even while the field is focused */
/* Email typed by the Admin on an invite: shown, but cannot be changed. */
.register-modal .field.is-locked .field__input {
  opacity: 0.8;
  cursor: not-allowed;
}

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

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

/* Show / hide password */
.register-modal .field__toggle {
  transition: color 0.2s ease, filter 0.2s ease, background-color 0.3s ease;
}

.register-modal .field__toggle:hover,
.register-modal .field__toggle:focus-visible {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.75));
}

.register-modal .field__toggle .ico {
  width: 17px;
  height: 17px;
}

/* ==========================================================================
   Validation & Errors
   ========================================================================== */

.register-modal .form-error {
  margin: -0.35rem 0 1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #fff;
  background: rgba(110, 20, 45, 0.55);
  border-left-color: #ff8a9b;
  animation: modal-item-in 0.3s ease-out;
}

/* ==========================================================================
   Dividers & Buttons
   ========================================================================== */

.register-modal__divider {
  height: 1px;
  margin: 0.4rem -7px 1.8rem;
  border: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.75) 12%, rgba(255, 255, 255, 0.75) 88%, rgba(255, 255, 255, 0) 100%);
}

/* Sign up button (same as the login popup's button) */
.register-modal .btn-primary {
  width: 78%;
  height: 37px;
  margin: 0 auto;
  background: #e8eefb;
  color: #06070d;
  font: 600 0.86rem var(--font-display);
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.2s ease, letter-spacing 0.3s ease, filter 0.2s;
}

.register-modal .btn-primary::before {
  background: linear-gradient(105deg, transparent 30%, rgba(120, 165, 255, 0.5) 50%, transparent 70%);
}

.register-modal .btn-primary:hover,
.register-modal .btn-primary:focus-visible {
  background: #fff;
  letter-spacing: 0.25em;
  box-shadow: 0 8px 22px rgba(20, 40, 120, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 24px rgba(160, 200, 255, 0.7);
}

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

/* Google button spans the same width as the fields and Sign up button */
.register-modal .btn-social {
  width: 100%;
}

/* ==========================================================================
   "Check Your Inbox" State
   ========================================================================== */

.register-modal__sent {
  display: none;
  text-align: center;
  padding: 0.5rem 0 0.2rem;
}

.register-modal__sent h3 {
  margin: 0 0 0.8rem;
  font: 700 1.3rem var(--font-display);
  color: #2b3552;
}

.register-modal__sent p {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #2b3552;
}

.register-modal__sent b {
  word-break: break-all;
}

.register-modal.is-sent .register-modal__form {
  display: none;
}

.register-modal.is-sent .register-modal__sent {
  display: block;
}

/* The invite popup hides its intro sentence once the result is showing. */
#invite-modal.is-sent .forgot-password-text {
  display: none;
}

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

@media (max-width: 420px) {
  .register-modal {
    padding: 2.3rem 1.6rem 2.4rem;
  }
  .register-modal__title {
    font-size: 1.3rem;
  }

  /* ==========================================================
   Register success message spacing

   This keeps the success title, message, email, and button
   properly spaced and easy to read.
   ========================================================== */

    .register-modal__sent {
      padding: 20px 18px 10px;
      text-align: center;
    }

    /* Add space below the success title. */
    .register-modal__sent h3 {
      margin: 0 0 14px;
    }

    /* Make the success message easier to read. */
    .register-modal__sent p {
      margin: 0 auto 20px;
      max-width: 320px;
      line-height: 1.6;
    }

    /* Give the email breathing room and allow long emails to wrap. */
    .register-modal__sent b {
      display: inline;
      margin: 0 3px;
      word-break: break-word;
    }

    /* Add a little more space above the Back to Login button. */
    .register-modal__sent .btn-primary {
      margin-top: 4px;
    }

}
/* Green success message for a successful Forgot Password request. */
#forgotPasswordError.is-success {
    background: rgba(46, 204, 113, 0.16);
    border-left: 3px solid #2ecc71;
    color: #bff5cf;
}
/* ==========================================================
   RESPONSIVE REGISTER / FORGOT PASSWORD MODALS
   Keeps modal content aligned and usable when zoomed or viewed
   on tablets and smaller screens.
   ========================================================== */

/* Prevent modal content from overflowing its available width. */
.register-modal,
.register-modal__form,
.register-modal .field,
#forgot-password-modal,
#forgotPasswordForm {
    min-width: 0;
}

/* Keep modal width flexible but controlled. */
.register-modal,
#forgot-password-modal {
    width: min(92vw, 430px);
    max-width: 430px;
}

/* Make form controls use the available modal width. */
.register-modal__form,
.register-modal .field,
.register-modal .btn-primary,
#forgotPasswordForm,
#forgotPasswordForm .field,
#forgotPasswordForm .btn-primary {
    width: 100%;
}

/* Prevent inputs from growing outside the modal. */
.register-modal .field__input,
#forgotPasswordForm .field__input {
    width: 100%;
    min-width: 0;
}

/* Allow long modal messages to wrap safely. */
.register-modal__sent,
.forgot-password-text,
.form-error {
    overflow-wrap: break-word;
    word-break: normal;
}

/* ==========================================================
   TABLET / ZOOMED VIEW
   ========================================================== */

@media (max-width: 768px) {

    /* Keep the modal away from browser edges. */
    .modal-stage {
        padding: 24px;
    }

    /* Reduce modal padding slightly. */
    .register-modal,
    #forgot-password-modal {
        padding: 32px 28px;
    }

    /* Scale the modal headings without making them too large. */
    .register-modal__title {
        font-size: clamp(2rem, 7vw, 2.8rem);
    }
}

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

@media (max-width: 420px) {

    /* Reduce outer spacing on narrow screens. */
    .modal-stage {
        padding: 14px;
    }

    /* Use almost the full mobile width. */
    .register-modal,
    #forgot-password-modal {
        width: 100%;
        max-width: 100%;
        padding: 28px 18px;
    }

    /* Keep headings readable without overflowing. */
    .register-modal__title {
        font-size: clamp(1.8rem, 10vw, 2.4rem);
        line-height: 1.05;
    }

    /* Tighten field spacing slightly on small screens. */
    .register-modal .field,
    #forgotPasswordForm .field {
        margin-bottom: 12px;
    }

    /* Make buttons easier to tap. */
    .register-modal .btn-primary,
    #forgotPasswordForm .btn-primary,
    .forgot-password-back {
        min-height: 46px;
    }

    /* Keep explanatory text readable. */
    .forgot-password-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}