/* ==========================================================================
   Auth screens: marketer login / signup, forgot + reset password, admin login.
   Shared by resources/views/Common/layout/auth.blade.php.

   Small screens: frosted card centred over the illustration.
   Wide screens:  the illustration fills the left, the form floats on the
                  white right-hand side of loginscreenbg.png (the client mock).
   ========================================================================== */

.auth-body {
  min-height: 100vh;
  background: #fff;
}

.auth-page {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Fixed layer, so a long form (signup) scrolls over the illustration instead
   of stretching it. The gradient is the lavender wash from the mock. */
.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(140deg, rgba(229, 218, 254, 0) 63%, #E5DAFE 84%),
    #fff url("../images/loginscreenbg.png") no-repeat left center / cover;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 500px;
  padding: 36px 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 24px 60px rgba(35, 13, 84, 0.12);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.auth-card--wide {
  max-width: 560px;
}

/* ---------- Heading ---------- */

.auth-logo {
  display: block;
  width: 190px;
  height: auto;
  margin: 0 auto 28px;
}

.auth-title {
  margin: 0 0 10px;
  color: #230D54;
  font-family: "GalanoGrotesqueSemiBold";
  font-size: 28px;
  font-weight: normal;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: #3D3D40;
  font-family: "GalanoGrotesqueRegular";
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}

.auth-subtitle strong {
  color: #230D54;
  font-family: "GalanoGrotesqueSemiBold";
  font-weight: normal;
  /* long emails may break, but only when they can't fit on a line of their own */
  overflow-wrap: anywhere;
}

.auth-card .alert {
  margin-bottom: 20px;
  font-size: 14px;
}

/* ---------- Fields ---------- */

.auth-field {
  margin-bottom: 20px;
}

.auth-label {
  display: block;
  margin-bottom: 8px;
  color: #5B5B5B;
  font-family: "GalanoGrotesqueMedium";
  font-size: 14px;
  line-height: 1.5;
}

.auth-input {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transform: translateY(-50%);
  pointer-events: none;
  /* the field icons come from different sets; render them all in the mock's near-black */
  filter: brightness(0);
  opacity: 0.85;
}

.auth-input-icon--sm {
  width: 20px;
  height: 20px;
  left: 18px;
}

.auth-card .form-control,
.auth-card .form-select {
  height: 50px;
  padding: 0 16px 0 50px;
  border: 1px solid #E4E2EA;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.55);
  color: #212121;
  font-family: "GalanoGrotesqueRegular";
  /* 16px keeps iOS Safari from zooming into the field on focus */
  font-size: 16px;
  box-shadow: none;
}

.auth-card .form-select {
  padding-right: 44px;
  background-position: right 16px center;
  cursor: pointer;
}

.auth-card .form-select:has(option[value=""]:checked) {
  color: #A9A9AD;
}

.auth-card .form-select option {
  color: #212121;
}

.auth-card .form-control::placeholder {
  color: #A9A9AD;
  opacity: 1;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
  border-color: #9468F6;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(148, 104, 246, 0.15);
}

.auth-card .form-control[readonly] {
  border-color: #E4E2EA;
  background-color: rgba(236, 231, 248, 0.6);
  color: #5B5B5B;
  box-shadow: none;
  cursor: default;
}

/* Chrome's autofill paints its own blue fill over the translucent field */
.auth-card .form-control:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #FBF9FF inset;
  -webkit-text-fill-color: #212121;
  caret-color: #212121;
}

.auth-card .form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #FBF9FF inset, 0 0 0 4px rgba(148, 104, 246, 0.15);
}

.auth-card .form-control.is-invalid,
.auth-card .form-select.is-invalid {
  border-color: var(--bs-form-invalid-border-color);
  background-image: none;
}

.auth-card .form-select.is-invalid {
  --bs-form-select-bg-icon: none;
  padding-right: 44px;
  background-image: var(--bs-form-select-bg-img);
  background-position: right 16px center;
  background-size: 16px 12px;
}

.auth-card .form-control.is-invalid:focus,
.auth-card .form-select.is-invalid:focus {
  border-color: var(--bs-form-invalid-border-color);
  box-shadow: 0 0 0 4px rgba(var(--bs-danger-rgb), 0.15);
}

.auth-card .invalid-feedback {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
}

/* Password show / hide */
.auth-input--password .form-control,
.auth-input--password .form-control.is-invalid {
  padding-right: 54px;
}

.auth-toggle-password {
  position: absolute;
  top: 50%;
  right: 9px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.auth-toggle-password img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.auth-toggle-password:hover {
  background-color: rgba(148, 104, 246, 0.08);
}

.auth-toggle-password:focus-visible {
  outline: 2px solid #9468F6;
  outline-offset: 0;
}

/* ---------- Checkboxes / options row ---------- */

.auth-card .form-check-input {
  flex: 0 0 auto;
  float: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid #C8B6F4;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.auth-card .form-check-input:checked {
  border-color: #6420AA;
  background-color: #6420AA;
}

.auth-card .form-check-input:focus {
  border-color: #9468F6;
  box-shadow: 0 0 0 3px rgba(148, 104, 246, 0.2);
}

.auth-card .form-check-input.is-invalid {
  border-color: var(--bs-form-invalid-border-color);
}

.auth-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 12px;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #9468F6;
  font-family: "GalanoGrotesqueMedium";
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.auth-remember .form-check-input {
  width: 16px;
  height: 16px;
}

.auth-forgot {
  /* stays right-aligned if the row wraps on a narrow phone */
  margin-left: auto;
  color: #230D54;
  font-family: "GalanoGrotesqueMedium";
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}

.auth-forgot:hover,
.auth-forgot:focus-visible {
  color: #6420AA;
  text-decoration: underline;
}

.auth-checks {
  margin-top: 24px;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  color: #3D3D40;
  font-family: "GalanoGrotesqueRegular";
  font-size: 14px;
  line-height: 1.45;
}

.auth-checks .auth-check:first-child {
  margin-top: 0;
}

.auth-check .form-check-input {
  margin-top: 1px;
}

.auth-check label {
  margin: 0;
  cursor: pointer;
  text-wrap: pretty;
}

.auth-check a {
  color: #9468F6;
  font-family: "GalanoGrotesqueSemiBold";
  text-decoration: none;
}

.auth-check a:hover {
  text-decoration: underline;
}

/* ---------- Button + footer ---------- */

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin-top: 28px;
  padding: 0 24px;
  border: 0;
  border-radius: 6px;
  background-color: #6420AA;
  color: #fff;
  font-family: "GalanoGrotesqueSemiBold";
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-btn:hover,
.auth-btn:focus-visible {
  background-color: #531B8E;
  color: #fff;
}

.auth-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(100, 32, 170, 0.25);
}

.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-footer {
  margin: 16px 0 0;
  color: #212121;
  font-family: "GalanoGrotesqueMedium";
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.auth-footer a {
  color: #6420AA;
  font-family: "GalanoGrotesqueSemiBold";
  font-size: 1.1em;
  text-decoration: none;
}

.auth-footer a:hover,
.auth-footer a:focus-visible {
  text-decoration: underline;
}

/* ---------- Result states (reset email sent, password changed) ---------- */

.auth-status {
  text-align: center;
}

.auth-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  margin: 4px auto 24px;
  border-radius: 50%;
  background: rgba(148, 104, 246, 0.12);
}

.auth-status-icon img {
  width: 64px;
  height: 64px;
}

.auth-status-icon--success {
  background: rgba(15, 160, 65, 0.1);
}

/* the heading only receives focus from script, so the result is announced */
.auth-status .auth-title:focus {
  outline: none;
}

/* ---------- Scrollbar (the app-wide one is dark navy) ---------- */

::-webkit-scrollbar-track {
  background: #F1ECFD;
}

::-webkit-scrollbar-thumb {
  background: #B9A2F2;
}

::-webkit-scrollbar-thumb:hover {
  background: #9468F6;
}

/* ---------- Small phones ---------- */

@media (max-width: 399.98px) {
  .auth-panel {
    padding: 24px 12px;
  }

  .auth-card {
    padding: 32px 18px;
  }

  .auth-remember,
  .auth-forgot {
    font-size: 13px;
  }

  /* fields stay 16px (iOS zoom); only the hint shrinks so it isn't clipped by the eye button */
  .auth-card .form-control::placeholder {
    font-size: 14px;
  }
}

/* ---------- Tablet ---------- */

@media (min-width: 576px) {
  .auth-panel {
    padding: 48px 24px;
  }

  .auth-card {
    padding: 48px 44px;
  }

  .auth-logo {
    width: 210px;
    margin-bottom: 32px;
  }

  .auth-title {
    font-size: 32px;
  }

  .auth-subtitle {
    font-size: 16px;
    margin-bottom: 32px;
  }

  .auth-label {
    font-size: 15px;
  }

  .auth-btn {
    height: 52px;
    font-size: 18px;
  }

  .auth-footer {
    font-size: 16px;
  }
}

/* ---------- Desktop: split layout from the mock ---------- */

@media (min-width: 1200px) and (min-aspect-ratio: 3/2) {
  .auth-panel {
    /* mock: the form column starts ~1100px into the 1920px frame */
    flex: 0 0 42.7%;
    width: 42.7%;
    margin-left: auto;
    padding: 40px 32px;
  }

  .auth-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .auth-logo {
    width: 220px;
    margin-bottom: clamp(28px, 5vh, 48px);
  }

  .auth-title {
    font-size: 34px;
    margin-bottom: 12px;
  }

  .auth-subtitle {
    font-size: 17px;
    margin-bottom: clamp(24px, 4vh, 40px);
  }

  .auth-field {
    margin-bottom: clamp(16px, 2.6vh, 24px);
  }

  .auth-card .form-control,
  .auth-card .form-select {
    height: 52px;
    font-size: 14px;
  }

  .auth-btn {
    margin-top: clamp(24px, 3.4vh, 32px);
  }
}

/* Enough height for the mock's 1920x1080 sizes */
@media (min-width: 1200px) and (min-aspect-ratio: 3/2) and (min-height: 800px) {
  .auth-logo {
    width: 264px;
    margin-bottom: 66px;
  }

  .auth-title {
    font-size: 40px;
    margin-bottom: 14px;
  }

  .auth-subtitle {
    font-size: 20px;
    margin-bottom: 48px;
  }

  .auth-label {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .auth-field {
    margin-bottom: 30px;
  }

  .auth-card .form-control,
  .auth-card .form-select {
    height: 58px;
  }

  .auth-btn {
    height: 58px;
    margin-top: 36px;
    font-size: 20px;
  }

  .auth-footer {
    margin-top: 16px;
    font-size: 18px;
  }

  /* Signup has five rows of fields; sized to fit a 1080p browser window */
  .auth-panel:has(.auth-card--wide) {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .auth-card--wide .auth-logo {
    width: 180px;
    margin-bottom: 28px;
  }

  .auth-card--wide .auth-title {
    font-size: 36px;
  }

  .auth-card--wide .auth-subtitle {
    font-size: 16px;
    margin-bottom: 28px;
  }

  .auth-card--wide .auth-field {
    margin-bottom: 16px;
  }

  .auth-card--wide .form-control,
  .auth-card--wide .form-select {
    height: 50px;
  }

  .auth-card--wide .auth-checks {
    margin-top: 22px;
  }

  .auth-card--wide .auth-btn {
    height: 54px;
    margin-top: 24px;
  }
}
