/*
|--------------------------------------------------------------------------
| JET Traffic Control login
|--------------------------------------------------------------------------
*/

:root {
  --login-bg: #10120f;
  --login-panel: rgba(15, 17, 14, 0.96);
  --login-input: #1c1e19;
  --login-input-hover: #21231e;

  --login-cream: rgb(245, 245, 228);
  --login-white: #ffffff;
  --login-text: rgb(245, 245, 228);
  --login-muted: #888b82;
  --login-border: rgba(245, 243, 223, 0.16);

  --login-accent: rgb(0, 230, 161);
  --login-accent-hover: #35ffcd;

  --login-danger: #ff7474;
  --login-danger-bg: rgba(255, 116, 116, 0.1);
  --login-danger-border: rgba(255, 116, 116, 0.35);

  --login-radius: 4px;
  --login-button-radius: 999px;

  --font-heading: "Archivo", sans-serif;
  --font-body: "space-grotesk-variable", sans-serif;
}

/*
|--------------------------------------------------------------------------
| Reset
|--------------------------------------------------------------------------
*/

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

/*
|--------------------------------------------------------------------------
| Page background
|--------------------------------------------------------------------------
*/

.login-page {
  min-height: 100vh;
  overflow-x: hidden;

  color: var(--login-text);

  font-family: var(--font-body);
  font-variation-settings: "wght" 400;

  background-color: var(--login-bg);

  /*
     * Add a background image at:
     * assets/images/login-background.webp
     *
     * The gradient still works if the image does not exist.
     */
  background-image:
    linear-gradient(
      90deg,
      rgba(14, 16, 13, 0.99) 0%,
      rgba(14, 16, 13, 0.98) 45%,
      rgba(14, 16, 13, 0.78) 70%,
      rgba(14, 16, 13, 0.28) 100%
    ),
    url("../images/login-background.webp");

  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.login-page::before {
  content: "";

  position: fixed;
  inset: 0;

  pointer-events: none;

  background: radial-gradient(
    circle at 62% 50%,
    rgba(0, 255, 191, 0.04),
    transparent 42%
  );
}

/*
|--------------------------------------------------------------------------
| Main layout
|--------------------------------------------------------------------------
*/

.login-shell {
  position: relative;
  z-index: 1;

  min-height: 100vh;

  display: grid;
  grid-template-rows: auto 1fr auto;

  padding: 38px 48px 26px;
}

.login-brand {
  display: flex;
  align-items: center;
}

.login-brand-logo {
  display: block;

  width: 200px;
  max-width: 28vw;
  height: auto;

  /*
     * The SVG shown in VS Code appears black.
     * This filter turns a black SVG cream/white.
     */
  filter: brightness(0) saturate(100%) invert(92%) sepia(12%) saturate(453%)
    hue-rotate(12deg) brightness(107%) contrast(94%);
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
}

.login-panel {
  width: min(100%, 520px);
  margin: 0;
  padding: 34px 0 50px;

  animation: login-panel-in 0.55s ease both;
}

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

.login-heading {
  margin-bottom: 32px;
}

.login-eyebrow {
  margin: 0 0 8px;

  color: var(--login-accent);

  font-family: var(--font-body);
  font-size: 12px;
  font-variation-settings: "wght" 650;
  font-weight: 650;

  letter-spacing: 0.3em;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-heading h1 {
  margin: 0;
  font-family: "archivo-black", sans-serif;
  font-weight: 400;
  color: var(--login-cream);

  font-size: clamp(48px, 5vw, 72px);
  font-style: italic;

  letter-spacing: -0.055em;
  line-height: 0.95;
}

/*
|--------------------------------------------------------------------------
| Error message
|--------------------------------------------------------------------------
*/

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 11px;

  margin-bottom: 24px;
  padding: 13px 15px;

  color: #ffd4d4;
  background: var(--login-danger-bg);

  border: 1px solid var(--login-danger-border);
  border-radius: var(--login-radius);

  font-size: 14px;
  line-height: 1.45;
}

.login-error-icon {
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  width: 20px;
  height: 20px;

  color: var(--login-bg);
  background: var(--login-danger);

  border-radius: 50%;

  font-size: 12px;
  font-weight: 700;
}

/*
|--------------------------------------------------------------------------
| Form
|--------------------------------------------------------------------------
*/

.login-form {
  width: 100%;
}

.login-field {
  margin-bottom: 23px;
}

.login-field label {
  display: block;

  margin-bottom: 9px;

  color: var(--login-muted);

  font-size: 12px;
  font-variation-settings: "wght" 650;
  font-weight: 650;

  letter-spacing: 0.22em;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.forgot-password-link {
  margin-bottom: 9px;

  color: var(--login-accent);

  font-size: 13px;
  font-variation-settings: "wght" 500;
  font-weight: 500;

  text-decoration: none;

  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.forgot-password-link:hover {
  color: var(--login-accent-hover);
}

.login-field input[type="email"],
.login-field input[type="password"],
.login-field input[type="text"] {
  display: block;

  width: 100%;
  min-height: 58px;

  padding: 0 19px;

  color: var(--login-cream);
  background: var(--login-input);

  border: 1px solid transparent;
  border-left: 2px solid rgba(245, 243, 223, 0.25);
  border-radius: 0;

  outline: none;

  font-family: var(--font-body);
  font-size: 16px;
  font-variation-settings: "wght" 400;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.login-field input::placeholder {
  color: #6d7068;
  opacity: 1;
}

.login-field input:hover {
  background: var(--login-input-hover);
}

.login-field input:focus {
  background: var(--login-input-hover);

  border-color: rgba(0, 255, 191, 0.24);
  border-left-color: var(--login-accent);

  box-shadow: 0 0 0 3px rgba(0, 255, 191, 0.06);
}

/*
|--------------------------------------------------------------------------
| Password toggle
|--------------------------------------------------------------------------
*/

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 78px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 17px;

  width: auto;
  padding: 5px;

  color: var(--login-muted);
  background: transparent;

  border: 0;

  transform: translateY(-50%);
  cursor: pointer;

  font-size: 12px;
  font-variation-settings: "wght" 600;
  font-weight: 600;

  transition: color 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--login-accent);
}

.password-toggle:focus-visible {
  outline: 1px solid var(--login-accent);
  outline-offset: 3px;
}

/*
|--------------------------------------------------------------------------
| Remember checkbox
|--------------------------------------------------------------------------
*/

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-top: -2px;
  margin-bottom: 29px;
}

.remember-option {
  position: relative;

  display: inline-flex;
  align-items: center;
  gap: 11px;

  color: #b4b6ae;

  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.remember-option input {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;
  pointer-events: none;
}

.custom-checkbox {
  position: relative;

  display: block;

  width: 21px;
  height: 21px;

  border: 1px solid rgba(245, 243, 223, 0.28);
  border-radius: 2px;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.remember-option input:checked + .custom-checkbox {
  background: var(--login-accent);
  border-color: var(--login-accent);
}

.remember-option input:checked + .custom-checkbox::after {
  content: "";

  position: absolute;
  top: 3px;
  left: 6px;

  width: 6px;
  height: 11px;

  border-right: 2px solid var(--login-bg);
  border-bottom: 2px solid var(--login-bg);

  transform: rotate(45deg);
}

.remember-option input:focus-visible + .custom-checkbox {
  border-color: var(--login-accent);

  box-shadow: 0 0 0 3px rgba(0, 255, 191, 0.15);
}

/*
|--------------------------------------------------------------------------
| Submit button
|--------------------------------------------------------------------------
*/

.login-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  width: 100%;
  min-height: 68px;

  padding: 7px 8px 7px 31px;

  color: #151611;
  background: var(--login-cream);

  border: 0;
  border-radius: var(--login-button-radius);

  cursor: pointer;

  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 18px;
  font-variation-settings: "wght" 650;
  font-weight: 650;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.login-submit:hover {
  background: #ffffff;

  transform: translateY(-1px);

  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.login-submit:active {
  transform: translateY(0);
}

.login-submit:focus-visible {
  outline: 3px solid var(--login-accent);
  outline-offset: 4px;
}

.login-submit-icon {
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  width: 53px;
  height: 53px;

  border: 1px solid rgba(21, 22, 17, 0.78);
  border-radius: 50%;

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.login-submit:hover .login-submit-icon {
  color: var(--login-cream);
  background: #00e6a1;

  transform: translateX(2px);
}

/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.login-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding-top: 18px;

  color: rgba(245, 243, 223, 0.48);

  font-size: 11px;
  font-variation-settings: "wght" 500;
  font-weight: 500;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/*
|--------------------------------------------------------------------------
| Animation
|--------------------------------------------------------------------------
*/

@keyframes login-panel-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 1100px) {
  .login-page {
    background-image:
      linear-gradient(
        90deg,
        rgba(14, 16, 13, 0.98) 0%,
        rgba(14, 16, 13, 0.94) 58%,
        rgba(14, 16, 13, 0.55) 100%
      ),
      url("../images/login-background.webp");
  }

  .login-panel {
    margin-left: auto;
    margin-right: auto;
  }
}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 700px) {
  .login-page {
    background-position: 65% center;

    background-image:
      linear-gradient(rgba(14, 16, 13, 0.92), rgba(14, 16, 13, 0.96)),
      url("../images/login-background.webp");
  }

  .login-shell {
    padding: 24px 22px 20px;
  }

  .login-brand-logo {
    width: 145px;
    max-width: 45vw;
  }

  .login-main {
    align-items: flex-start;
  }

  .login-panel {
    width: 100%;
    margin: 0;
    padding-top: 70px;
  }

  .login-heading {
    margin-bottom: 28px;
  }

  .login-heading h1 {
    font-size: 52px;
  }

  .login-field input[type="email"],
  .login-field input[type="password"],
  .login-field input[type="text"] {
    min-height: 56px;
  }

  .login-submit {
    min-height: 64px;
    padding-left: 25px;
  }

  .login-submit-icon {
    width: 49px;
    height: 49px;
  }

  .login-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/*
|--------------------------------------------------------------------------
| Reduced motion
|--------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/*
|--------------------------------------------------------------------------
| Forgotten password and password reset
|--------------------------------------------------------------------------
*/

.login-intro {
  max-width: 470px;
  margin: 22px 0 0;

  color: #a7aaa1;

  font-family: var(--font-body);
  font-size: 15px;
  font-variation-settings: "wght" 400;
  font-weight: 400;

  line-height: 1.65;
}

.login-success {
  display: flex;
  align-items: flex-start;
  gap: 11px;

  margin-bottom: 24px;
  padding: 13px 15px;

  color: var(--login-cream);
  background: rgba(0, 230, 161, 0.09);

  border: 1px solid rgba(0, 230, 161, 0.32);
  border-radius: var(--login-radius);

  font-size: 14px;
  line-height: 1.45;
}

.login-success-icon {
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  width: 20px;
  height: 20px;

  color: var(--login-bg);
  background: var(--login-accent);

  border-radius: 50%;

  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.login-return {
  margin-top: 25px;
  text-align: center;
}

.login-return a {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: #a7aaa1;

  font-size: 14px;
  font-variation-settings: "wght" 500;
  font-weight: 500;

  text-decoration: none;

  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.login-return a:hover {
  color: var(--login-accent);
  transform: translateX(-2px);
}

.login-submit-link {
  text-decoration: none;
}

.password-requirements {
  display: grid;
  gap: 4px;

  margin: -3px 0 26px;
  padding: 14px 16px;

  color: #9da097;
  background: rgba(255, 255, 255, 0.025);

  border-left: 2px solid rgba(0, 230, 161, 0.5);

  font-size: 12px;
  line-height: 1.55;
}

.password-requirements strong {
  margin-bottom: 2px;

  color: #c9cbc3;

  font-variation-settings: "wght" 600;
  font-weight: 600;
}

.password-requirements span::before {
  content: "—";
  margin-right: 7px;
  color: var(--login-accent);
}

.login-development-note {
  margin-bottom: 24px;
  padding: 14px 16px;

  color: #cbcfc5;
  background: rgba(255, 196, 0, 0.07);

  border: 1px solid rgba(255, 196, 0, 0.24);
  border-radius: var(--login-radius);

  font-size: 13px;
  line-height: 1.5;
}

.login-development-note strong {
  display: block;
  margin-bottom: 4px;
  color: #f2d677;
}

.login-development-note p {
  margin: 0 0 8px;
}

.login-development-note a {
  color: var(--login-accent);
  font-weight: 600;
  text-decoration: none;
}

.login-development-note a:hover {
  text-decoration: underline;
}

/*
|--------------------------------------------------------------------------
| Browser autofill
|--------------------------------------------------------------------------
*/

.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--login-cream);
  -webkit-box-shadow: 0 0 0 1000px var(--login-input) inset;

  caret-color: var(--login-cream);

  transition: background-color 9999s ease-out;
}
