/* Shared form patterns */
.auth-form {
  display: grid;
  gap: 14px;
}

.auth-label {
  font-weight: 700;
  color: #e6ecf8;
}

.auth-input {
  width: 100%;
  height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(74,130,193,0.24);
  padding: 0 16px;
  font: inherit;
  background: linear-gradient(145deg, rgba(23,35,58,0.55), rgba(15,25,46,0.7));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 12px 30px rgba(0,0,0,0.35);
  color: #e5edff;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(90,146,210,0.55);
  box-shadow:
    0 0 0 3px rgba(90,146,210,0.22),
    inset 0 1px 0 rgba(255,255,255,0.08);
  background: linear-gradient(145deg, rgba(27,42,70,0.8), rgba(18,29,52,0.85));
}

.auth-password {
  position: relative;
}

.auth-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  width: 34px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.auth-sep {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.14);
}

.auth-small {
  margin: 0;
  color: #cbd5ff;
  font-size: 14px;
}

#twofaActions {
  margin-top: 5px;
}

#twofaActions .auth-small + .auth-small {
  margin-top: 5px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 700;
  color: #e6ecf8;
}

.field input {
  height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(74,130,193,0.24);
  padding: 0 16px;
  font: inherit;
  background: linear-gradient(145deg, rgba(23,35,58,0.55), rgba(15,25,46,0.7));
  color: #e5edff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 12px 30px rgba(0,0,0,0.35);
}

.field input:focus {
  outline: none;
  border-color: rgba(90,146,210,0.55);
  box-shadow:
    0 0 0 3px rgba(90,146,210,.22),
    inset 0 1px 0 rgba(255,255,255,0.08);
  background: linear-gradient(145deg, rgba(27,42,70,0.8), rgba(18,29,52,0.85));
}

.field .hint {
  color: #b6c4ff;
  font-size: 13px;
}

.showpw-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.showpw {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #d8e1f8;
}

.showpw input {
  width: 16px;
  height: 16px;
  accent-color: var(--cta);
}

.showpw input:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}

.auth-btn {
  background: linear-gradient(135deg, #5c7fb2 0%, #3f5f94 55%, #2b446f 100%);
  color: #eaf1ff;
  font-weight: 800;
  border: 0;
  border-radius: 16px;
  height: 52px;
  padding: 0 26px;
  cursor: pointer;
  box-shadow:
    0 16px 36px rgba(29, 49, 86, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

.auth-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.auth-link {
  color: #cbd7f5;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-error {
  color: #b91c1c;
  font-weight: 700;
  margin-top: 6px;
}

.auth-input,
.field input {
  caret-color: #f8fafc;
}

.auth-input::placeholder,
.field input::placeholder {
  color: #b6c4ff;
  opacity: 1;
}

.auth-input:-webkit-autofill,
.field input:-webkit-autofill {
  -webkit-text-fill-color: #e5edff;
  transition: background-color 9999s ease-out, color 9999s ease-out;
}

body.light-ui .auth-label,
body.light-ui .field label {
  color: #0f172a;
}

body.light-ui .auth-input,
body.light-ui .field input {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.16);
  color: #0f172a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(15, 23, 42, 0.08);
}

body.light-ui .auth-input:focus,
body.light-ui .field input:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  background: #ffffff;
}

body.light-ui .auth-small,
body.light-ui .field .hint {
  color: #64748b;
}

body.light-ui .showpw {
  color: #475569;
}

body.light-ui .auth-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow:
    0 16px 30px rgba(37, 99, 235, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.light-ui .auth-link {
  color: #2563eb;
}

body.light-ui .auth-sep {
  border-top-color: rgba(15, 23, 42, 0.12);
}

body.light-ui .auth-input::placeholder,
body.light-ui .field input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

body.light-ui .auth-input:-webkit-autofill,
body.light-ui .field input:-webkit-autofill {
  -webkit-text-fill-color: #0f172a;
}
