/*
  Colors: http://getuicolors.com
*/

/* Setup */
:root {
  --black: #000000;
  --almost-black: #263238;
  --white: #ffffff;
  --almost-white: #FBFBFB;
  --grey-light: #CFD8DC;
  --grey: #B0BEC5;
  --grey-medium: #78909C;
  --grey-dark: #455A64;
  --primary: #1E88E5;
  --primary-dark: #1976D2;
  --secondary: #CFD8DC;
  --secondary-dark: #B0BEC5;
  --red: #EF4836;
  --success: #2E7D32;
}

* {
  position: relative;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  font-size: 18px;
  line-height: 28px;
  color: var(--black);
}

/* Typography */
.center {
  text-align: center;
}

h1 {
  margin: 0.5em 0 1em;
  font-size: 26px;
  line-height: 1.2;
  color: var(--almost-black);
}

h2 {
  margin: 0.5em 0 1em;
  font-size: 20px;
  line-height: 1.2;
  color: var(--grey-dark);
}

p {
  margin: 24px 0;
}

/* Cards */
.card-wrapper {
  margin: 0 auto;
  padding: 90px 30px;
  flex-wrap: wrap;
  justify-content: center;
  display: flex;
}

.card {
  margin: 0 30px 60px;
  padding: 20px 40px;
  width: 460px;
  box-shadow: 0 8px 26px -4px rgb(0 0 0 / 0.15);
  border-radius: 5px;
  background: var(--white);
}

@media (width <= 520px) {
  .card-wrapper {
    padding: 30px 0 0;
  }

  .card {
    margin: 0 0 30px;
    width: 100%;
    border-radius: 0;
  }
}

/* Forms */
form {
  transition: opacity .15s ease;
}

form.loading {
  pointer-events: none;
  opacity: 0.75;
}

label {
  margin: 0 0 2px;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 1px;
  color: var(--grey-medium);
  display: block;
}

.field {
  margin: 0 0 24px;
  padding: 11px 16px 9px;
  width: 100%;
  font-size: 16px;
  line-height: 26px;
  color: var(--almost-black);
  border: 1px solid var(--grey);
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.1);
  display: block;
  background: var(--almost-white);
  transition: border-color .15s ease;
}

.field:focus {
  border-color: var(--grey-medium);
  outline: none;
}

/* Password field + show/hide toggle. The wrapper doesn't strictly need
   position:relative given the global `* { position: relative; }` rule
   above, but it's declared explicitly anyway - relying on a universal
   selector for a specific component's positioning is easy to miss when
   reading this rule in isolation. */
.field-with-toggle {
  position: relative;
}

.field-with-toggle .field {
  /* room on the end so typed text never runs under the toggle button */
  padding-inline-end: 44px;
  margin: 0; /* the wrapper carries the margin instead, see below */
}

.field-with-toggle {
  margin: 0 0 24px;
}

.pwd-toggle {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--grey-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwd-toggle:hover,
.pwd-toggle:focus-visible {
  color: var(--grey-dark);
  outline: none;
}

.pwd-toggle svg {
  width: 20px;
  height: 20px;
}

/* Only one of the two eye icons is shown at a time, flipped by
   user-mgmt.js toggling aria-pressed - see initPasswordToggles(). */
.pwd-toggle .icon-eye-off {
  display: none;
}

.pwd-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

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

.error {
  margin: 0;
  font-size: 16px;
  line-height: 26px;
  text-align: center;
  color: var(--red);
}

.error--hidden {
  display: none;
}

.success {
  margin: 0;
  font-size: 16px;
  line-height: 26px;
  text-align: center;
  color: var(--success);
  opacity: 1;
  transition: opacity .3s ease;
}

.success--hidden {
  opacity: 0;
  pointer-events: none;
}

/* Buttons */
.btn {
  margin: 0 0 24px;
  padding: 11px 30px 10px;
  font-size: 14px;
  line-height: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  text-decoration: none;
  color: var(--white);
  border: none;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  display: inline-block;
  background: var(--primary);
  transition: color .15s ease, background-color .15s ease;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: var(--secondary);
  color: var(--grey-dark);
}

.btn:disabled:hover,
.btn[aria-disabled="true"]:hover {
  background: var(--secondary);
}

.btn--secondary {
  color: var(--almost-black);
  background: var(--secondary);
}

.btn--secondary:hover {
  background: var(--secondary-dark);
}

input[type="submit"] {
  margin: 34px auto 24px;
  display: block;
}

/* Settings form: grouped fields, styled selects/radios/checkboxes.
   Reuses the existing --primary/--grey-medium/--almost-black palette
   above rather than introducing new colors. */

.settings-group {
  margin: 0 0 22px;
}

.settings-group-label {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 1px;
  color: var(--grey-medium);
  display: block;
  cursor: help;
}

.settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  line-height: 22px;
  color: var(--almost-black);
  cursor: help;
}

.settings-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
}

.settings-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--almost-black);
  cursor: help;
}

.settings-checkbox-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-inline-end: 36px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378909C' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.settings-checkboxes {
  margin: 0 0 22px;
}
