/*
* auth.css
* The signed-out pages: /landing with the forms its cards open, and the /login, /partner_login,
* /redeem and /sysadmin_redemption pages. Rendered in auth_layout.erb.
*/

a {
  color: var(--link-color);
}

a:hover {
  color: var(--link-hover-color);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

/* Brand panel */
/* Stays one screen tall while the cards scroll, so an opened form does not shift it */
.brand-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  flex: 0 0 40%;
  max-width: 512px;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 3.5rem;
  /* A soft purple glow top left and a faint warm one bottom right, over a diagonal plum to indigo */
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--gitlab-purple) 25%, transparent) 0%, transparent 55%),
    radial-gradient(circle at 90% 95%, color-mix(in srgb, var(--gitlab-orange) 10%, transparent) 0%, transparent 50%),
    linear-gradient(160deg, var(--brand-bg) 0%, color-mix(in srgb, var(--brand-bg) 75%, var(--gitlab-indigo)) 100%);
  color: var(--brand-text);
}

.brand-wordmark {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-text);
  text-decoration: none;
}

.brand-wordmark:hover {
  color: var(--brand-text);
}

.brand-back {
  align-self: flex-start;
  font-size: 0.95rem;
  color: color-mix(in srgb, var(--brand-text) 80%, transparent);
  text-decoration: none;
}

.brand-back:hover {
  color: var(--brand-text);
}

/* A page heading has no tagline under it, so it sits in the middle of the panel */
.brand-back + .brand-intro {
  margin-bottom: auto;
}

.brand-back + .brand-intro .brand-title {
  margin-bottom: 2.5rem;
}

.brand-intro {
  margin-top: auto;
}

.brand-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-accent);
}

.brand-title {
  margin: 1.25rem 0 1.75rem;
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: inherit;
}

.brand-lede {
  max-width: 20rem;
  font-size: 1rem;
  opacity: 0.9;
}

.brand-tagline {
  margin-top: auto;
  padding-top: 4rem;
  font-size: 1.4rem;
  line-height: 1.35;
}

.brand-tagline::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-bottom: 1.5rem;
  background-color: var(--brand-accent);
}

.brand-footer {
  margin-top: 4rem;
  font-size: 0.7rem;
  opacity: 0.75;
}

/* Main panel */
.paths-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4rem 3.5rem 2.5rem;
}

.paths {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin: 3.5rem auto 0;
}

.paths h1 {
  font-size: 2.1rem;
  font-weight: 600;
}

.paths-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.section-label {
  margin: 0.8rem 0 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.path-grid + .section-label {
  margin-top: 2.5rem;
}

.section-label span {
  color: color-mix(in srgb, var(--accent) 70%, var(--bg-color));
}

/* Cards in a row share one height. The sign-in drop-downs float over the page, so opening
   one never stretches a card. */
.path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.path-card {
  padding: 1rem 1rem 1.75rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--card-bg);
}

/* Sits at the bottom of the panel, level with the brand panel's copyright line */
.paths-footer {
  margin-top: auto;
  padding-top: 2.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.path-card-primary {
  border: 2px solid var(--accent);
}

.path-card > p {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* A sign-in form that drops down over the page, anchored under its button and as wide as it */
.path-card .dropdown {
  position: relative;
}

.path-dropdown.dropdown-menu {
  --bs-dropdown-min-width: 0;
  left: 0;
  right: 0;
  margin-top: 0;
  padding: 1.4rem 1.1rem 1.1rem;
  border: 1px solid var(--outline-color);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background-color: var(--card-bg);
  color: var(--text-color);
  box-shadow: var(--shadow-lg);
}

.path-dropdown.show {
  animation: path-dropdown-open 0.18s ease-out;
}

@keyframes path-dropdown-open {
  from {
    opacity: 0;
    clip-path: inset(0 0 100% 0 round 0 0 10px 10px);
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 0 0 10px 10px);
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .path-dropdown.show {
    animation: none;
  }
}

.path-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

/* An open sign-in button and its drop-down read as one shape */
.path-card .dropdown .path-btn[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.path-btn[aria-expanded="true"] .path-arrow {
  transform: rotate(90deg);
}

/* Buttons are components.css's .ui-btn; the path cards and sign-in forms use .ui-btn-split */

/* Standalone sign-in pages */
.auth-page {
  width: 100%;
  max-width: 560px;
  margin: 3.5rem auto 0;
}

/* Centred in the panel, level with the brand panel's heading. A form taller than the
   window starts at the top instead, since auto margins never go below zero. */
.auth-page-centered {
  margin-top: auto;
  margin-bottom: auto;
}

.auth-page h1 {
  font-size: 1.9rem;
  font-weight: 600;
}

/* components.css's back link and card, sized for these pages */
.auth-page .ui-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  font-weight: 400;
}

.auth-page .ui-card {
  margin-top: 1.5rem;
  border-radius: 10px;
}

/* Sign-in forms (inside a .ui-card or a landing card) */
.auth-form .form-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.auth-form .form-control {
  border-color: var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
}

.auth-form .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--accent) 25%, transparent);
}

.auth-form .form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.auth-form .form-text,
.auth-option p,
.auth-agreement {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* The code entry pages (/redeem, /sysadmin_redemption): the form sits on the page, no card */
.auth-form-open .form-label {
  font-size: 0.95rem;
}

.auth-form-open .form-control {
  padding: 0.9rem 1rem;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-color));
  font-size: 1rem;
}

.auth-form-open .form-text {
  display: block;
  margin-top: 0.5rem;
}

.auth-form-open .ui-btn {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  font-size: 1rem;
}

.auth-form code,
.auth-form a:not(.ui-btn) {
  color: var(--accent);
}

.auth-option + .auth-option {
  margin-top: 1.25rem;
}

.auth-option p {
  margin: 0.5rem 0 0;
}

.auth-agreement {
  margin: 1.25rem 0 1rem;
}

.auth-help {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 991.98px) {
  body {
    flex-direction: column;
  }

  .brand-panel {
    position: static;
    height: auto;
    flex: none;
    max-width: none;
    padding: 2rem 1.5rem;
  }

  .brand-intro {
    margin-top: 2.5rem;
  }

  .brand-title {
    font-size: 2.5rem;
  }

  .brand-tagline,
  .brand-footer {
    display: none;
  }

  .paths-panel {
    padding: 1.5rem 1rem 2rem;
  }

  .paths,
  .auth-page {
    margin-top: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .path-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
